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
|
|---|---|---|---|---|---|---|---|---|---|
0bc5dac3db25de42dfd86cfd7c3e4cc33587d8f3
|
src/client/crypt.c
|
src/client/crypt.c
|
#include <openssl/aes.h>
#include <openssl/rand.h>
#include <stdio.h>
#include <string.h>
#include "crypt.h"
typedef unsigned char aes_t;
void generate_bytes(aes_t *buf) {
if (!RAND_bytes(buf, sizeof(buf))) {
fprintf(stderr, "[!] Could not generate key");
}
}
aes_t *encrypt(char *plaintext, aes_t *key, aes_t *iv) {
aes_t *ciphertext = (aes_t *) malloc(BUFFER_SIZE);
AES_KEY wctx;
AES_set_encrypt_key(key, KEY_SIZE * 8, &wctx);
AES_cbc_encrypt((aes_t *)plaintext, ciphertext, sizeof(ciphertext), &wctx, iv, AES_ENCRYPT);
memset(iv, 0x00, AES_BLOCK_SIZE);
return ciphertext;
}
char *decrypt(aes_t *ciphertext, aes_t *key, aes_t *iv) {
aes_t *plaintext = (aes_t *) malloc(BUFFER_SIZE);
AES_KEY wctx;
AES_set_decrypt_key(key, KEY_SIZE * 8, &wctx);
AES_cbc_encrypt(ciphertext, plaintext, sizeof(plaintext), &wctx, iv, AES_DECRYPT);
memset(iv, 0x00, AES_BLOCK_SIZE);
return (char *) plaintext;
}
|
#include <openssl/aes.h>
#include <openssl/rand.h>
#include <stdio.h>
#include <string.h>
#include "crypt.h"
typedef unsigned char aes_t;
void generate_bytes(aes_t *buf) {
if (!RAND_bytes(buf, sizeof(buf))) {
fprintf(stderr, "[!] Could not generate key");
}
}
aes_t *encrypt(char *plaintext, aes_t *key, aes_t *iv) {
aes_t *ciphertext = (aes_t *) malloc(BUFFER_SIZE);
AES_KEY wctx;
AES_set_encrypt_key(key, KEY_SIZE * 8, &wctx);
AES_cbc_encrypt((aes_t *)plaintext, ciphertext, strlen(plaintext), &wctx, iv, AES_ENCRYPT);
memset(iv, 0x00, AES_BLOCK_SIZE);
return ciphertext;
}
char *decrypt(aes_t *ciphertext, aes_t *key, aes_t *iv) {
aes_t *plaintext = (aes_t *) malloc(BUFFER_SIZE);
AES_KEY wctx;
AES_set_decrypt_key(key, KEY_SIZE * 8, &wctx);
AES_cbc_encrypt(ciphertext, plaintext, strlen((char *)ciphertext), &wctx, iv, AES_DECRYPT);
memset(iv, 0x00, AES_BLOCK_SIZE);
return (char *) plaintext;
}
|
Use strlen instead of sizeof
|
Use strlen instead of sizeof
|
C
|
mit
|
ThisIsMyNick/CChat,ThisIsMyNick/CChat
|
9aa854c9ff8be24d6d16404b591f9a5b2e2e5237
|
priv/qfappscriptdispatcherwrapper.h
|
priv/qfappscriptdispatcherwrapper.h
|
#ifndef QFAPPSCRIPTDISPATCHERWRAPPER_H
#define QFAPPSCRIPTDISPATCHERWRAPPER_H
#include <QQuickItem>
#include <QPointer>
#include "qfappdispatcher.h"
class QFAppScriptDispatcherWrapper : public QQuickItem
{
Q_OBJECT
public:
QFAppScriptDispatcherWrapper();
QString type() const;
void setType(const QString &type);
QFAppDispatcher *dispatcher() const;
void setDispatcher(QFAppDispatcher *dispatcher);
public slots:
void dispatch(QJSValue arguments);
private:
QString m_type;
QPointer<QFAppDispatcher> m_dispatcher;
};
#endif // QFAPPSCRIPTDISPATCHERWRAPPER_H
|
#ifndef QFAPPSCRIPTDISPATCHERWRAPPER_H
#define QFAPPSCRIPTDISPATCHERWRAPPER_H
#include <QQuickItem>
#include <QPointer>
#include "qfappdispatcher.h"
class QFAppScriptDispatcherWrapper : public QObject
{
Q_OBJECT
public:
QFAppScriptDispatcherWrapper();
QString type() const;
void setType(const QString &type);
QFAppDispatcher *dispatcher() const;
void setDispatcher(QFAppDispatcher *dispatcher);
public slots:
void dispatch(QJSValue arguments);
private:
QString m_type;
QPointer<QFAppDispatcher> m_dispatcher;
};
#endif // QFAPPSCRIPTDISPATCHERWRAPPER_H
|
Change parent of QFAppScriptDispatcherWrapper from QQuickItem to QObject
|
Change parent of QFAppScriptDispatcherWrapper from QQuickItem to QObject
|
C
|
apache-2.0
|
benlau/quickflux,benlau/quickflux
|
1505139f741e601408dc4aaddf8e352d28085f00
|
test/Driver/offloading-interoperability.c
|
test/Driver/offloading-interoperability.c
|
// REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -no-canonical-prefixes -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \
// RUN: | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
//
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NOT: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ptxas" "-m64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: fatbinary" "--cuda" "-64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux-gnu"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ld" {{.*}}"-m" "elf64lppc"
|
// REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -no-canonical-prefixes -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \
// RUN: | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
//
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NOT: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ptxas" "-m64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: fatbinary" "--cuda" "-64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux-gnu"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE: -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: {{ld(.exe)?"}} {{.*}}"-m" "elf64lppc"
|
Allow .exe extension to ld to fix test with mingw.
|
Allow .exe extension to ld to fix test with mingw.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@277334 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
|
5446062ac8d33adda2927d122e7fe4e7052c2666
|
sys/pc98/include/param.h
|
sys/pc98/include/param.h
|
/*-
* This file is in the public domain.
*/
/* $FreeBSD$ */
#include <i386/param.h>
|
/*-
* Copyright (c) 2005 TAKAHASHI Yoshihiro.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#define MACHINE "pc98"
#include <i386/param.h>
|
Switch MACHINE to "pc98" on FreeBSD/pc98. Add copyright.
|
Switch MACHINE to "pc98" on FreeBSD/pc98.
Add copyright.
Approved by: FreeBSD/pc98 development team.
|
C
|
bsd-3-clause
|
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
|
617ff31664d7aaaf391272da30d3ae65d0426df7
|
test/Analysis/array-struct.c
|
test/Analysis/array-struct.c
|
// RUN: clang -checker-simple -verify %s
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct s {
int data;
int data_array[10];
};
typedef struct {
int data;
} STYPE;
void g1(struct s* p);
void f(void) {
int a[10];
int (*p)[10];
p = &a;
(*p)[3] = 1;
struct s d;
struct s *q;
q = &d;
q->data = 3;
d.data_array[9] = 17;
}
void f2() {
char *p = "/usr/local";
char (*q)[4];
q = &"abc";
}
void f3() {
STYPE s;
}
void f4() {
int a[] = { 1, 2, 3};
int b[3] = { 1, 2 };
}
void f5() {
struct s data;
g1(&data);
}
void f6() {
char *p;
p = __builtin_alloca(10);
p[1] = 'a';
}
struct s2;
void g2(struct s2 *p);
void f7() {
struct s2 *p = __builtin_alloca(10);
g2(p);
}
void f8() {
int a[10];
a[sizeof(a) - 1] = 1;
}
|
// RUN: clang -checker-simple -verify %s
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct s {
int data;
int data_array[10];
};
typedef struct {
int data;
} STYPE;
void g1(struct s* p);
void f(void) {
int a[10];
int (*p)[10];
p = &a;
(*p)[3] = 1;
struct s d;
struct s *q;
q = &d;
q->data = 3;
d.data_array[9] = 17;
}
void f2() {
char *p = "/usr/local";
char (*q)[4];
q = &"abc";
}
void f3() {
STYPE s;
}
void f4() {
int a[] = { 1, 2, 3};
int b[3] = { 1, 2 };
}
void f5() {
struct s data;
g1(&data);
}
void f6() {
char *p;
p = __builtin_alloca(10);
p[1] = 'a';
}
struct s2;
void g2(struct s2 *p);
void f7() {
struct s2 *p = __builtin_alloca(10);
g2(p);
}
void f8() {
int a[10];
a[sizeof(a) - 1] = 1;
}
void f9() {
struct s a[10];
}
|
Add test cast for struct array.
|
Add test cast for struct array.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@59522 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
|
f49f7674b9ec11b777b0954ea9fa0fe73a7ad4be
|
RobotC/Headers/Helper.h
|
RobotC/Headers/Helper.h
|
#ifndef HELPER_H
#define HELPER_H
/*Helper function for calculating ABSOLUTE maximum of two floats
Will return maximum absolute value (ignores sign) */
float helpFindMaxAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs > bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Helper function for calculating ABSOLUTE minimum of two floats
//Will return minimum absolute value (ignores sign)
float helpFindMinAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs < bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Returns sign of float
int helpFindSign(float x) {
if (x > 0.0) {
return 1;
} else if (x < 0.0) {
return -1;
} else {
return 0;
}
}
int helpRoundFloat(float x) {
if (x > 0) {
return (int)(x+0.5);
} else {
return (int)(x-0.5);
}
}
#endif
|
#ifndef HELPER_H
#define HELPER_H
/*Helper function for calculating ABSOLUTE maximum of two floats
Will return maximum absolute value (ignores sign) */
float helpFindMaxAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs > bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Helper function for calculating ABSOLUTE minimum of two floats
//Will return minimum absolute value (ignores sign)
float helpFindMinAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs < bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Returns sign of int
int helpFindSign(int x) {
if (x > 0.0) {
return 1;
} else if (x < 0.0) {
return -1;
} else {
return 0;
}
}
int helpRoundFloat(float x) {
if (x > 0) {
return (int)(x+0.5);
} else {
return (int)(x-0.5);
}
}
#endif
|
Fix helpFindSign (floats don't have signs....)
|
Fix helpFindSign (floats don't have signs....)
|
C
|
mit
|
RMRobotics/FTC_5421_2014-2015,RMRobotics/FTC_5421_2014-2015
|
0d06b78d10a5648560158f958973f9e07edd194b
|
swap.c
|
swap.c
|
#include <stdio.h>
#define SWAP(x, y) { \
typeof (x) tmp = y; \
y = x; \
x = tmp; \
}
int main() {
int a = 1;
int b = 2;
SWAP(a, b);
printf("a: %d, b: %d\n", a, b);
return 0;
}
|
#include <stdio.h>
#define SWAP(x, y) { \
typeof (x) tmp = y; \
y = x; \
x = tmp; \
}
int main() {
int a = 1;
int b = 2;
SWAP(a, b);
printf("a: %d, b: %d\n", a, b);
float arr[2] = {3.0, 4.0};
SWAP(arr[0], arr[1]);
printf("arr[0]: %f, arr[1]: %f\n", arr[0], arr[1]);
return 0;
}
|
Test we work with other, more complex types.
|
Test we work with other, more complex types.
|
C
|
mit
|
Wilfred/comparative_macrology,Wilfred/comparative_macrology,Wilfred/comparative_macrology,Wilfred/comparative_macrology
|
cf45dd1238806c0a9ff74043694f5d276efc7f4a
|
phase-01/main.c
|
phase-01/main.c
|
/**
* Phase 01 - Get a Window that works and can be closed.
*
* This code won't be structured very well, just trying to get stuff working.
*/
#include <stdlib.h>
int main(int argc, char *argv[])
{
return EXIT_SUCCESS;
}
|
/**
* Phase 01 - Get a Window that works and can be closed.
*
* This code won't be structured very well, just trying to get stuff working.
*/
#include <stdlib.h>
#include <X11/Xlib.h>
int main(int argc, char *argv[])
{
Display *dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
return EXIT_FAILURE;
}
XCloseDisplay(dpy);
dpy = NULL;
return EXIT_SUCCESS;
}
|
Create the display, free it at the end, exit with failure if the display doesn't open
|
Create the display, free it at the end, exit with failure if the display doesn't open
|
C
|
mit
|
Faison/xlib-learning
|
af533b7e864c9a3790abe2095110924cc374af3c
|
DocFormats/DFTypes.h
|
DocFormats/DFTypes.h
|
// Copyright 2012-2014 UX Productivity Pty Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef DocFormats_DFTypes_h
#define DocFormats_DFTypes_h
#ifdef _MSC_VER
#define ATTRIBUTE_ALIGNED(n)
#define ATTRIBUTE_FORMAT(archetype,index,first)
#else
#define ATTRIBUTE_ALIGNED(n) __attribute__ ((aligned (n)))
#define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first)))
#endif
#include <sys/types.h>
#include <stdint.h>
#include <stdarg.h>
#endif
|
// Copyright 2012-2014 UX Productivity Pty Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef DocFormats_DFTypes_h
#define DocFormats_DFTypes_h
#ifdef _MSC_VER
#define ATTRIBUTE_ALIGNED(n)
#define ATTRIBUTE_FORMAT(archetype,index,first)
#else
#define ATTRIBUTE_ALIGNED(n) __attribute__ ((aligned (n)))
#define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first)))
#endif
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <sys/types.h>
#include <stdint.h>
#include <stdarg.h>
#endif
|
Disable warnings about insecure functions
|
Win32: Disable warnings about insecure functions
Set the _CRT_SECURE_NO_WARNINGS macro so that VC++ doesn't complain
about commonly-used functions like open and vsnprintf that it considers
"unsafe". The alternatives it suggests are not available on Unix-based
platforms, and they're used extensively throughout the codebase.
|
C
|
apache-2.0
|
apache/incubator-corinthia,corinthia/corinthia-docformats,apache/incubator-corinthia,apache/incubator-corinthia,apache/incubator-corinthia,apache/incubator-corinthia,corinthia/corinthia-docformats,apache/incubator-corinthia,corinthia/corinthia-docformats,corinthia/corinthia-docformats,corinthia/corinthia-docformats,apache/incubator-corinthia
|
991fa7648b54c6d03bfe0d112a37d17dd2054d52
|
test_utils/mock_queue.h
|
test_utils/mock_queue.h
|
#ifndef TACHYON_TEST_UTILS_MOCK_QUEUE_H_
#define TACHYON_TEST_UTILS_MOCK_QUEUE_H_
#include "gmock/gmock.h"
#include "lib/queue_interface.h"
namespace tachyon {
namespace testing {
// Mock class for queues.
template <class T>
class MockQueue : public QueueInterface<T> {
public:
MOCK_METHOD1_T(Enqueue, bool(const T &item));
MOCK_METHOD1_T(EnqueueBlocking, bool(const T &item));
MOCK_METHOD1_T(DequeueNext, bool(T *item));
MOCK_METHOD1_T(DequeueNextBlocking, void(T *item));
MOCK_METHOD0_T(GetOffset, int());
MOCK_METHOD0_T(FreeQueue, void());
};
} // namespace testing
} // namespace tachyon
#endif // TACHYON_TEST_UTILS_MOCK_QUEUE_H_
|
#ifndef TACHYON_TEST_UTILS_MOCK_QUEUE_H_
#define TACHYON_TEST_UTILS_MOCK_QUEUE_H_
#include "gmock/gmock.h"
#include "lib/queue_interface.h"
namespace tachyon {
namespace testing {
// Mock class for queues.
template <class T>
class MockQueue : public QueueInterface<T> {
public:
MOCK_METHOD1_T(Enqueue, bool(const T &item));
MOCK_METHOD1_T(EnqueueBlocking, bool(const T &item));
MOCK_METHOD1_T(DequeueNext, bool(T *item));
MOCK_METHOD1_T(DequeueNextBlocking, void(T *item));
MOCK_CONST_METHOD0_T(GetOffset, int());
MOCK_METHOD0_T(FreeQueue, void());
};
} // namespace testing
} // namespace tachyon
#endif // TACHYON_TEST_UTILS_MOCK_QUEUE_H_
|
Fix issue with mock method.
|
Fix issue with mock method.
|
C
|
mit
|
djpetti/gaia,djpetti/gaia,djpetti/gaia
|
21ae225c5b7e15ef2ea46608f8cb4d9b8777a9cf
|
test2/initialisation/struct/empty/init.c
|
test2/initialisation/struct/empty/init.c
|
// RUN: %layout_check %s
// RUN: %check %s
struct A
{
}; // CHEKC: /warning: empty struct/
struct Containter
{
struct A a;
};
struct Pre
{
int i;
struct A a;
int j;
};
struct Pre p = { 1, /* warn */ 2 }; // CHECK: /warning: missing {} initialiser for empty struct/
struct Pre q = { 1, {}, 2 };
main()
{
struct A a = { 5 }; // CHECK: /warning: missing {} initialiser for empty struct/
struct A b = {};
struct Containter c = {{}};
c.a = (struct A){};
}
|
// RUN: %layout_check %s
// RUN: %check %s
struct A
{
}; // CHECK: /warning: empty struct/
struct Container
{
struct A a;
};
struct Pre
{
int i;
struct A a;
int j;
};
struct Pre p = { 1, /* warn */ 2 }; // CHECK: /warning: missing {} initialiser for empty struct/
struct Pre q = { 1, {}, 2 };
main()
{
struct A a = { 5 }; // CHECK: /warning: missing {} initialiser for empty struct/
struct A b = {};
struct Container c = {{}};
c.a = (struct A){};
}
|
Fix typo in empty struct test check
|
Fix typo in empty struct test check
|
C
|
mit
|
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
|
9e95e999cf87215b33d0b5b203b4a3cd0381a368
|
verilog/tools/kythe/kythe_proto_output.h
|
verilog/tools/kythe/kythe_proto_output.h
|
// Copyright 2017-2020 The Verible Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
#define VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
#include "verilog/tools/kythe/kythe_facts.h"
#include "verilog/tools/kythe/kythe_facts_extractor.h"
namespace verilog {
namespace kythe {
class KytheProtoOutput : public KytheOutput {
public:
KytheProtoOutput() = default;
// Output all Kythe facts from the indexing data in proto format.
void Emit(const KytheIndexingData& indexing_data);
};
} // namespace kythe
} // namespace verilog
#endif // VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
|
// Copyright 2017-2020 The Verible Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
#define VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
#include "verilog/tools/kythe/kythe_facts.h"
#include "verilog/tools/kythe/kythe_facts_extractor.h"
namespace verilog {
namespace kythe {
class KytheProtoOutput : public KytheOutput {
public:
// Output all Kythe facts from the indexing data in proto format.
void Emit(const KytheIndexingData& indexing_data);
};
} // namespace kythe
} // namespace verilog
#endif // VERIBLE_VERILOG_TOOLS_KYTHE_KYTHE_PROTO_OUTPUT_H_
|
Remove unnecessary default constructor from KytheProtoOutput
|
[kythe] Remove unnecessary default constructor from KytheProtoOutput
|
C
|
apache-2.0
|
chipsalliance/verible,chipsalliance/verible,chipsalliance/verible,chipsalliance/verible,chipsalliance/verible
|
3a999bf6de5a6c4963f448c5498cd2c9c488d1a0
|
temperature.c
|
temperature.c
|
// Copyright 2016, Jeffrey E. Bedard
#include "temperature.h"
#include "config.h"
#include "font.h"
#include "util.h"
#include <stdio.h>
#include <string.h>
// Returns x offset for next item
uint16_t draw_temp(xcb_connection_t * xc, const uint16_t offset)
{
const uint8_t v
= xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE)/1000;
uint8_t sz = 4;
char buf[sz];
const struct JBDim f = xstatus_get_font_size();
sz = snprintf(buf, sz, "%dC", v);
xcb_image_text_8(xc, sz, xstatus_get_window(xc),
xstatus_get_gc(xc), offset + XSTATUS_CONST_WIDE_PAD, f.h, buf);
return f.w * strlen(buf) + offset + XSTATUS_CONST_WIDE_PAD
+ XSTATUS_CONST_PAD;
}
|
// Copyright 2016, Jeffrey E. Bedard
#include "temperature.h"
#include "config.h"
#include "font.h"
#include "util.h"
#include <stdio.h>
static uint16_t get_offset(const uint16_t fw, const uint16_t offset,
const uint8_t len)
{
return fw * len + offset + XSTATUS_CONST_WIDE_PAD
+ XSTATUS_CONST_PAD;
}
// Returns x offset for next item
uint16_t draw_temp(xcb_connection_t * xc, const uint16_t offset)
{
const uint8_t v
= xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE)/1000;
uint8_t sz = 4;
char buf[sz];
const struct JBDim f = xstatus_get_font_size();
sz = snprintf(buf, sz, "%dC", v);
xcb_image_text_8(xc, sz, xstatus_get_window(xc),
xstatus_get_gc(xc), offset + XSTATUS_CONST_WIDE_PAD, f.h, buf);
return get_offset(f.w, offset, sz);
}
|
Split out get_offset(). Eliminated unnecessary call to strlen().
|
Split out get_offset(). Eliminated unnecessary call to strlen().
|
C
|
mit
|
jefbed/xstatus,jefbed/xstatus,jefbed/xstatus,jefbed/xstatus
|
1c0969525f2500603fbb9f2360fbda3439831003
|
thingshub/CDZThingsHubErrorDomain.h
|
thingshub/CDZThingsHubErrorDomain.h
|
//
// CDZThingsHubErrorDomain.h
// thingshub
//
// Created by Chris Dzombak on 1/14/14.
// Copyright (c) 2014 Chris Dzombak. All rights reserved.
//
#import "CDZThingsHubApplication.h"
extern NSString * const kThingsHubErrorDomain;
typedef NS_ENUM(NSInteger, CDZErrorCode) {
CDZErrorCodeConfigurationValidationError = CDZThingsHubApplicationReturnCodeConfigError,
CDZErrorCodeTestError = -1,
};
|
//
// CDZThingsHubErrorDomain.h
// thingshub
//
// Created by Chris Dzombak on 1/14/14.
// Copyright (c) 2014 Chris Dzombak. All rights reserved.
//
#import "CDZThingsHubApplication.h"
extern NSString * const kThingsHubErrorDomain;
typedef NS_ENUM(NSInteger, CDZErrorCode) {
CDZErrorCodeTestError = 0,
CDZErrorCodeAuthError = CDZThingsHubApplicationReturnCodeAuthError,
CDZErrorCodeConfigurationValidationError = CDZThingsHubApplicationReturnCodeConfigError,
CDZErrorCodeSyncFailure = CDZThingsHubApplicationReturnCodeSyncFailed,
};
|
Make error domain constants mirror app return codes
|
Make error domain constants mirror app return codes
|
C
|
mit
|
cdzombak/thingshub,cdzombak/thingshub,cdzombak/thingshub
|
d01500c7ed2b6445d37176a05c911f25a299f38a
|
Pod/Classes/Private/IRLSizePrivate.h
|
Pod/Classes/Private/IRLSizePrivate.h
|
//
// IRLSizePrivate.h
// IRLSize
//
// Created by Jeff Kelley on 6/29/16.
// Copyright © 2016 Detroit Labs. All rights reserved.
//
#ifndef IRLSizePrivate_h
#define IRLSizePrivate_h
typedef float RawLengthMeasurement; // meters
typedef struct {
RawLengthMeasurement width;
RawLengthMeasurement height;
} RawSize;
#define RAW_SIZE_UNIT [NSUnitLength meters]
#endif /* IRLSizePrivate_h */
|
//
// IRLSizePrivate.h
// IRLSize
//
// Created by Jeff Kelley on 6/29/16.
// Copyright © 2016 Detroit Labs. All rights reserved.
//
#ifndef IRLSizePrivate_h
#define IRLSizePrivate_h
typedef float RawLengthMeasurement; // meters
typedef struct {
RawLengthMeasurement width;
RawLengthMeasurement height;
} RawSize;
#define RAW_SIZE_UNIT NSUnitLength.meters
#endif /* IRLSizePrivate_h */
|
Use the class property instead of getter method
|
Use the class property instead of getter method
|
C
|
mit
|
detroit-labs/IRLSize,detroit-labs/IRLSize,detroit-labs/IRLSize
|
ad18456cbcd2a498a259eaefa98d77263a5eebb5
|
src/gdomdebug.c
|
src/gdomdebug.c
|
#include <gdomdebug.h>
#include <glib/gprintf.h>
static gboolean debug_enabled = FALSE;
void
gdom_debug (char const *format, ...)
{
va_list args;
if (!debug_enabled)
return;
va_start (args, format);
g_vprintf (format, args);
g_printf ("\n");
va_end (args);
}
void
gdom_debug_enable (void)
{
debug_enabled = TRUE;
}
|
#include <gdomdebug.h>
#include <glib/gprintf.h>
#include <stdlib.h>
static gboolean debug_checked = FALSE;
static gboolean debug_enabled = FALSE;
static gboolean
_is_debug_enabled ()
{
const char *debug_var;
if (debug_checked)
return debug_enabled;
debug_var = g_getenv ("GMATHML_DEBUG");
debug_enabled = debug_var != NULL ? atoi (debug_var) != 0 : FALSE;
debug_checked = TRUE;
return debug_enabled;
}
void
gdom_debug (char const *format, ...)
{
va_list args;
if (!_is_debug_enabled())
return;
va_start (args, format);
g_vprintf (format, args);
g_printf ("\n");
va_end (args);
}
void
gdom_debug_enable (void)
{
debug_enabled = TRUE;
debug_checked = TRUE;
}
|
Allow debug messages using GMATHML_DEBUG environment variable.
|
[debug] Allow debug messages using GMATHML_DEBUG environment variable.
|
C
|
lgpl-2.1
|
wavewave/lasem,gjtorikian/lasem,janmarthedal/mathml2svg,wavewave/lasem,gjtorikian/lasem,wavewave/lasem,janmarthedal/mathml2svg,wavewave/lasem,gjtorikian/lasem,janmarthedal/mathml2svg,gjtorikian/lasem,janmarthedal/mathml2svg
|
982c1323303be930ecafb072c7075de0319dd48c
|
src/starlight.h
|
src/starlight.h
|
#pragma once
#include <string>
#if 0
int Stricmp(const char* str1, const char* str2) {
int d;
while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
str1++;
str2++;
}
return d;
}
int Strnicmp(const char* str1, const char* str2, int count) {
int d = 0;
while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
str1++; str2++; count--;
}
return d;
}
#endif
#ifdef _MSC_VER
#if _MSC_VER >= 1800
#define SL_CALL __vectorcall
#else
#define SL_CALL __cdecl
#endif
#else
#define SL_CALL
#endif
#define COUNT_OF(X) (sizeof(X) / sizeof((X)[0]))
#define ZERO_MEM(X, Y) (memset(X, 0, Y));
// For this to work, at least one .cpp file using this macro
// needs to be compiled on _every_ build, otherwise it is outdated.
#define SL_BUILD_DATE __DATE__ __TIME__
|
#pragma once
#include <string>
#if 0
int Stricmp(const char* str1, const char* str2) {
int d;
while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
str1++;
str2++;
}
return d;
}
int Strnicmp(const char* str1, const char* str2, int count) {
int d = 0;
while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
str1++; str2++; count--;
}
return d;
}
#endif
#ifdef _MSC_VER
#if _MSC_VER >= 1800
#define SL_CALL __vectorcall
#else
#define SL_CALL __cdecl
#endif
#else
#define SL_CALL
#endif
#define COUNT_OF(X) (sizeof(X) / sizeof((X)[0]))
#define ZERO_MEM(X, Y) (memset(X, 0, Y));
// For this to work, at least one .cpp file using this macro
// needs to be compiled on _every_ build, otherwise it is outdated.
#define SL_BUILD_DATE __DATE__ " " __TIME__
|
Add space between date and time
|
Add space between date and time
|
C
|
mit
|
darkedge/starlight,darkedge/starlight,darkedge/starlight
|
d9ee51a1ce04dfe0db1f89c34aa21ebc408ad869
|
input.c
|
input.c
|
#include "input.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
void read_line(char *p)
{
if (fgets(p, MAX_SIZE, stdin) == NULL){
p[0] = '\0';
return;
}
remove_space(p);
}
int is_exit(const char* p)
{
const char* exit_words[] = {
"exit",
"quit",
};
int len = (int)(sizeof(exit_words) / sizeof(char*));
int i;
if (strlen(p) == 0){
return (1);
}
for (i = 0; i < len; i++){
if (strcmp(p, exit_words[i]) == 0){
return (1);
}
}
return (0);
}
void remove_space(char* p)
{
int i, j;
i = j = 0;
while (p[i] != '\0'){
while (isspace(p[j])){
j++;
}
while (!isspace(p[j])){
p[i] = p[j];
if (p[i] == '\0'){
break;
}
else {
i++;
j++;
}
}
}
}
|
#include "input.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
void read_line(char *p)
{
if (fgets(p, MAX_SIZE, stdin) == NULL){
p[0] = '\0';
return;
}
remove_space(p);
}
int is_exit(const char* p)
{
const char* exit_words[] = {
"exit",
"quit",
"bye",
};
int len = (int)(sizeof(exit_words) / sizeof(char*));
int i;
if (strlen(p) == 0){
return (1);
}
for (i = 0; i < len; i++){
if (strcmp(p, exit_words[i]) == 0){
return (1);
}
}
return (0);
}
void remove_space(char* p)
{
int i, j;
i = j = 0;
while (p[i] != '\0'){
while (isspace(p[j])){
j++;
}
while (!isspace(p[j])){
p[i] = p[j];
if (p[i] == '\0'){
break;
}
else {
i++;
j++;
}
}
}
}
|
Add bye to exit words
|
Add bye to exit words
|
C
|
mit
|
Roadagain/Calculator,Roadagain/Calculator
|
0872c7be8541e059241d0bbe89a442a8c4b90215
|
Include/genobject.h
|
Include/genobject.h
|
/* Generator object interface */
#ifndef Py_LIMITED_API
#ifndef Py_GENOBJECT_H
#define Py_GENOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
struct _frame; /* Avoid including frameobject.h */
typedef struct {
PyObject_HEAD
/* The gi_ prefix is intended to remind of generator-iterator. */
/* Note: gi_frame can be NULL if the generator is "finished" */
struct _frame *gi_frame;
/* True if generator is being executed. */
int gi_running;
/* The code object backing the generator */
PyObject *gi_code;
/* List of weak reference. */
PyObject *gi_weakreflist;
} PyGenObject;
PyAPI_DATA(PyTypeObject) PyGen_Type;
#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
#define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type)
PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *);
PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *);
PyAPI_FUNC(int) PyGen_FetchStopIterationValue(PyObject **);
#ifdef __cplusplus
}
#endif
#endif /* !Py_GENOBJECT_H */
#endif /* Py_LIMITED_API */
|
/* Generator object interface */
#ifndef Py_LIMITED_API
#ifndef Py_GENOBJECT_H
#define Py_GENOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
struct _frame; /* Avoid including frameobject.h */
typedef struct {
PyObject_HEAD
/* The gi_ prefix is intended to remind of generator-iterator. */
/* Note: gi_frame can be NULL if the generator is "finished" */
struct _frame *gi_frame;
/* True if generator is being executed. */
char gi_running;
/* The code object backing the generator */
PyObject *gi_code;
/* List of weak reference. */
PyObject *gi_weakreflist;
} PyGenObject;
PyAPI_DATA(PyTypeObject) PyGen_Type;
#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
#define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type)
PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *);
PyAPI_FUNC(int) PyGen_NeedsFinalizing(PyGenObject *);
PyAPI_FUNC(int) PyGen_FetchStopIterationValue(PyObject **);
#ifdef __cplusplus
}
#endif
#endif /* !Py_GENOBJECT_H */
#endif /* Py_LIMITED_API */
|
Fix regression after c8d1df9ac987 (PPC buildbot)
|
Fix regression after c8d1df9ac987
(PPC buildbot)
|
C
|
mit
|
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
|
c2475f236c7da439da5acc27114a92ae9ffe5ef4
|
LYCategory/Classes/_UIKit/UIColor+Speed.h
|
LYCategory/Classes/_UIKit/UIColor+Speed.h
|
//
// UIColor+Speed.h
// LYCategory
//
// CREATED BY LUO YU ON 26/10/2016.
// COPYRIGHT © 2016 LUO YU. ALL RIGHTS RESERVED.
//
#import <UIKit/UIKit.h>
@interface UIColor (Speed)
- (UIColor *)colorWithR:(CGFloat)redValue G:(CGFloat)greenValue B:(CGFloat)blueValue;
@end
|
//
// UIColor+Speed.h
// LYCategory
//
// CREATED BY LUO YU ON 26/10/2016.
// COPYRIGHT © 2016 LUO YU. ALL RIGHTS RESERVED.
//
#import <UIKit/UIKit.h>
@interface UIColor (Speed)
/**
generate color object with red-green-blue values
@param redValue red color value, 0~255
@param greenValue green color value, 0~255
@param blueValue blue color value, 0~255
@return color object
*/
- (UIColor *)colorWithR:(CGFloat)redValue G:(CGFloat)greenValue B:(CGFloat)blueValue;
@end
|
Modify : doc for color
|
Modify : doc for color
|
C
|
mit
|
blodely/LYCategory,blodely/LYCategory,blodely/LYCategory,blodely/LYCategory
|
a2a0e6f33f8b84f80a558c382214378fa156ecee
|
findbarcode.c
|
findbarcode.c
|
#include <stdio.h>
#include "stb_image.c"
#define FILENAME "wikipedia_barcode.png"
int main(int argc, char **argv)
{
int width, height, bytes_per_pixel;
unsigned char *data = stbi_load(FILENAME, &width, &height, &bytes_per_pixel, STBI_default);
if (data) {
// Run through every pixel and print its greyscale value.
for (int row = 0; row < height; row++) {
int row_offset = row * width;
for (int col = 0; col < width; col++) {
char grey = data[row_offset + col];
printf("row %d, col %d: %d\n", row, col, grey);
}
}
stbi_image_free(data);
printf("width: %d\nheight: %d\nbytes per pixel: %d\n", width, height, bytes_per_pixel);
} else {
printf("stbi_load() failed with error: \"%s\"\n", stbi_failure_reason());
}
return 0;
}
|
#include <stdio.h>
#include "stb_image.c"
#define FILENAME "wikipedia_barcode.png"
int main(int argc, char **argv)
{
int width, height, bytes_per_pixel;
unsigned char *data = stbi_load(FILENAME, &width, &height, &bytes_per_pixel, STBI_default);
if (data) {
// Run through every pixel and print its greyscale value.
for (int row = 0; row < height; row++) {
int row_offset = row * width;
for (int col = 0; col < width; col++) {
char grey = data[row_offset + col];
printf("row %d, col %d: %u\n", row, col, grey);
}
}
stbi_image_free(data);
printf("width: %d\nheight: %d\nbytes per pixel: %d\n", width, height, bytes_per_pixel);
} else {
printf("stbi_load() failed with error: \"%s\"\n", stbi_failure_reason());
}
return 0;
}
|
Print grey pixel value as unsigned
|
Print grey pixel value as unsigned
|
C
|
mit
|
jakeboxer/findbarcode
|
2c1b1a2343f5882ee6f98328ff391478d0d58c23
|
src/3rdparty/win32_src/pdcurses/wincon/pdcwin.h
|
src/3rdparty/win32_src/pdcurses/wincon/pdcwin.h
|
/* PDCurses */
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE 1 /* kill nonsense warnings */
#endif
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE 1 /* kill nonsense warnings */
#endif
#if defined(PDC_WIDE) && !defined(UNICODE)
# define UNICODE
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef MOUSE_MOVED
#include <curspriv.h>
typedef struct {short r, g, b; bool mapped;} PDCCOLOR;
extern PDCCOLOR pdc_color[PDC_MAXCOL];
extern HANDLE pdc_con_out, pdc_con_in;
extern DWORD pdc_quick_edit;
extern DWORD pdc_last_blink;
extern short pdc_curstoreal[16], pdc_curstoansi[16];
extern short pdc_oldf, pdc_oldb, pdc_oldu;
extern bool pdc_conemu, pdc_wt, pdc_ansi;
extern void PDC_blink_text(void);
|
/* PDCurses */
#ifndef __PDC_WIN_H__
#define __PDC_WIN_H__
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE 1 /* kill nonsense warnings */
#endif
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE 1 /* kill nonsense warnings */
#endif
#if defined(PDC_WIDE) && !defined(UNICODE)
# define UNICODE
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef MOUSE_MOVED
#include <curspriv.h>
typedef struct {short r, g, b; bool mapped;} PDCCOLOR;
extern PDCCOLOR pdc_color[PDC_MAXCOL];
extern HANDLE pdc_con_out, pdc_con_in;
extern DWORD pdc_quick_edit;
extern DWORD pdc_last_blink;
extern short pdc_curstoreal[16], pdc_curstoansi[16];
extern short pdc_oldf, pdc_oldb, pdc_oldu;
extern bool pdc_conemu, pdc_wt, pdc_ansi;
extern void PDC_blink_text(void);
#endif
|
Add include guard to fix wincon compile.
|
Add include guard to fix wincon compile.
|
C
|
bsd-3-clause
|
clangen/musikcube,clangen/musikcube,clangen/musikcube,clangen/musikcube,clangen/musikcube,clangen/musikcube,clangen/musikcube,clangen/musikcube
|
0f034d699c77ae4c7c989bf41405ff1b433e37ca
|
core/base/inc/LinkDef.h
|
core/base/inc/LinkDef.h
|
#include "core/base/inc/LinkDef1.h"
#include "core/base/inc/LinkDef2.h"
#include "core/base/inc/LinkDef3.h"
#include "core/clib/inc/LinkDef.h"
#include "core/cont/inc/LinkDef.h"
#include "core/meta/inc/LinkDef.h"
#include "core/metautils/inc/LinkDef.h"
#include "core/textinput/inc/LinkDef.h"
#include "core/zip/inc/LinkDef.h"
#if defined(SYSTEM_TYPE_winnt)
#include "core/winnt/inc/LinkDef.h"
#elif defined(SYSTEM_TYPE_macosx)
#include "core/macosx/inc/LinkDef.h"
#include "core/unix/inc/LinkDef.h"
#else
#include "core/unix/inc/LinkDef.h"
#endif
|
#include "core/base/inc/LinkDef1.h"
#include "core/base/inc/LinkDef2.h"
#include "core/base/inc/LinkDef3.h"
#include "core/clib/inc/LinkDef.h"
#include "core/cont/inc/LinkDef.h"
#include "core/meta/inc/LinkDef.h"
#include "core/metautils/inc/LinkDef.h"
#include "core/textinput/inc/LinkDef.h"
#include "core/zip/inc/LinkDef.h"
#if defined(SYSTEM_TYPE_winnt)
#include "core/winnt/inc/LinkDef.h"
#elif defined(SYSTEM_TYPE_macosx)
#include "core/macosx/inc/LinkDef.h"
#include "core/unix/inc/LinkDef.h"
#elif defined(SYSTEM_TYPE_unix)
#include "core/unix/inc/LinkDef.h"
#else
# error "Unsupported system type."
#endif
|
Verify that one of SYSTEM_TYPE_... is set.
|
Verify that one of SYSTEM_TYPE_... is set.
|
C
|
lgpl-2.1
|
agarciamontoro/root,abhinavmoudgil95/root,abhinavmoudgil95/root,buuck/root,beniz/root,BerserkerTroll/root,BerserkerTroll/root,beniz/root,beniz/root,davidlt/root,simonpf/root,agarciamontoro/root,gganis/root,davidlt/root,karies/root,olifre/root,zzxuanyuan/root-compressor-dummy,simonpf/root,gbitzes/root,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,beniz/root,zzxuanyuan/root,zzxuanyuan/root,satyarth934/root,gbitzes/root,simonpf/root,buuck/root,BerserkerTroll/root,bbockelm/root,gbitzes/root,gbitzes/root,davidlt/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root-compressor-dummy,abhinavmoudgil95/root,olifre/root,mhuwiler/rootauto,zzxuanyuan/root-compressor-dummy,davidlt/root,buuck/root,abhinavmoudgil95/root,gganis/root,karies/root,zzxuanyuan/root-compressor-dummy,olifre/root,satyarth934/root,mhuwiler/rootauto,BerserkerTroll/root,root-mirror/root,agarciamontoro/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root,simonpf/root,mhuwiler/rootauto,buuck/root,zzxuanyuan/root,olifre/root,beniz/root,zzxuanyuan/root,BerserkerTroll/root,root-mirror/root,davidlt/root,root-mirror/root,olifre/root,simonpf/root,mhuwiler/rootauto,bbockelm/root,satyarth934/root,abhinavmoudgil95/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,davidlt/root,abhinavmoudgil95/root,BerserkerTroll/root,olifre/root,buuck/root,zzxuanyuan/root,satyarth934/root,simonpf/root,agarciamontoro/root,satyarth934/root,mhuwiler/rootauto,gbitzes/root,bbockelm/root,bbockelm/root,root-mirror/root,root-mirror/root,root-mirror/root,agarciamontoro/root,BerserkerTroll/root,mhuwiler/rootauto,BerserkerTroll/root,zzxuanyuan/root,beniz/root,gganis/root,root-mirror/root,olifre/root,gganis/root,bbockelm/root,abhinavmoudgil95/root,bbockelm/root,agarciamontoro/root,beniz/root,agarciamontoro/root,gganis/root,karies/root,abhinavmoudgil95/root,simonpf/root,buuck/root,simonpf/root,zzxuanyuan/root,zzxuanyuan/root,mhuwiler/rootauto,bbockelm/root,agarciamontoro/root,karies/root,davidlt/root,gbitzes/root,gganis/root,satyarth934/root,agarciamontoro/root,satyarth934/root,gganis/root,bbockelm/root,karies/root,root-mirror/root,buuck/root,buuck/root,beniz/root,olifre/root,gganis/root,buuck/root,bbockelm/root,karies/root,olifre/root,davidlt/root,bbockelm/root,root-mirror/root,gbitzes/root,buuck/root,gbitzes/root,gganis/root,agarciamontoro/root,satyarth934/root,karies/root,mhuwiler/rootauto,buuck/root,simonpf/root,karies/root,gganis/root,davidlt/root,gbitzes/root,olifre/root,zzxuanyuan/root-compressor-dummy,zzxuanyuan/root,davidlt/root,root-mirror/root,davidlt/root,gbitzes/root,satyarth934/root,gganis/root,mhuwiler/rootauto,karies/root,simonpf/root,BerserkerTroll/root,beniz/root,mhuwiler/rootauto,satyarth934/root,beniz/root,bbockelm/root,zzxuanyuan/root-compressor-dummy,abhinavmoudgil95/root,karies/root,mhuwiler/rootauto,beniz/root,zzxuanyuan/root,simonpf/root,root-mirror/root,satyarth934/root,abhinavmoudgil95/root,BerserkerTroll/root,zzxuanyuan/root,agarciamontoro/root,olifre/root,gbitzes/root,karies/root
|
c28b765893ed505ac62864c9d4ce67cd4f9b9fc0
|
include/bl2/bl2.h
|
include/bl2/bl2.h
|
/*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef BL2_H__
#define BL2_H__
struct entry_point_info;
void bl2_main(void);
struct entry_point_info *bl2_load_images(void);
#endif /* BL2_H__ */
|
/*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef BL2_H__
#define BL2_H__
void bl2_main(void);
#endif /* BL2_H__ */
|
Fix MISRA rule 8.5 in common code
|
Fix MISRA rule 8.5 in common code
Rule 8.5: An external object or function shall be declared
once in one and only one file.
Change-Id: I7c3d4ec7d3ba763fdb4600008ba10b4b93ecdfce
Signed-off-by: Roberto Vargas <d75e640c49defb97bd074f828210df57ed181e1f@arm.com>
|
C
|
bsd-3-clause
|
achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware
|
4575d0a769a4b85012bd82f328038a80555917bd
|
config.h
|
config.h
|
#ifndef CJET_CONFIG_H
#define CJET_CONFIG_H
#define SERVER_PORT \
11122
#define LISTEN_BACKLOG \
40
/*
* It is somehow beneficial if this size is 32 bit aligned.
*/
#define MAX_MESSAGE_SIZE \
256
/* Linux specific configs */
#define MAX_EPOLL_EVENTS \
100
#endif
|
#ifndef CJET_CONFIG_H
#define CJET_CONFIG_H
#define SERVER_PORT \
11122
#define LISTEN_BACKLOG \
40
/*
* It is somehow beneficial if this size is 32 bit aligned.
*/
#define MAX_MESSAGE_SIZE \
512
/* Linux specific configs */
#define MAX_EPOLL_EVENTS \
100
#endif
|
Increase read and write buffer size per peer.
|
Increase read and write buffer size per peer.
|
C
|
mit
|
mloy/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet
|
04c226aab970da86fc9f59ec3a808cf916458261
|
test/CodeGen/arm-neon-fma.c
|
test/CodeGen/arm-neon-fma.c
|
// REQUIRES: arm-registered-target
// RUN: %clang -target thumbv7-none-linux-gnueabihf \
// RUN: -mcpu=cortex-a8 -mfloat-abi=hard \
// RUN: -O3 -S -emit-llvm -o - %s | FileCheck %s
#include <arm_neon.h>
float32x2_t test_fma_order(float32x2_t accum, float32x2_t lhs, float32x2_t rhs) {
return vfma_f32(accum, lhs, rhs);
// CHECK: call <2 x float> @llvm.fma.v2f32(<2 x float> %lhs, <2 x float> %rhs, <2 x float> %accum)
}
float32x4_t test_fmaq_order(float32x4_t accum, float32x4_t lhs, float32x4_t rhs) {
return vfmaq_f32(accum, lhs, rhs);
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %lhs, <4 x float> %rhs, <4 x float> %accum)
}
|
// REQUIRES: arm-registered-target
// RUN: %clang_cc1 -triple thumbv7-none-linux-gnueabihf \
// RUN: -target-abi aapcs \
// RUN: -target-cpu cortex-a8 \
// RUN: -mfloat-abi hard \
// RUN: -ffreestanding \
// RUN: -O3 -S -emit-llvm -o - %s | FileCheck %s
#include <arm_neon.h>
float32x2_t test_fma_order(float32x2_t accum, float32x2_t lhs, float32x2_t rhs) {
return vfma_f32(accum, lhs, rhs);
// CHECK: call <2 x float> @llvm.fma.v2f32(<2 x float> %lhs, <2 x float> %rhs, <2 x float> %accum)
}
float32x4_t test_fmaq_order(float32x4_t accum, float32x4_t lhs, float32x4_t rhs) {
return vfmaq_f32(accum, lhs, rhs);
// CHECK: call <4 x float> @llvm.fma.v4f32(<4 x float> %lhs, <4 x float> %rhs, <4 x float> %accum)
}
|
Fix recent test for more diverse environments.
|
Fix recent test for more diverse environments.
I think the main issue was the lack of -ffreestanding, which pulled in
the host's stdint.h. After that things went rapidly downhill.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@172653 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
|
b288888c9a5546844c146d8b7161d24ebbd7c7f7
|
tests/testutils.h
|
tests/testutils.h
|
#ifndef _TESTUTILS_H
#define _TESTUTILS_H
/*
* tslib/tests/testutils.h
*
* Copyright (C) 2004 Michael Opdenacker <michaelo@handhelds.org>
*
* This file is placed under the LGPL.
*
*
* Misc utils for ts test programs
*/
#define RESET "\033[0m"
#define RED "\033[31m"
#define GREEN "\033[32m"
#define BLUE "\033[34m"
#define YELLOW "\033[33m"
struct ts_button {
int x, y, w, h;
char *text;
int flags;
#define BUTTON_ACTIVE 0x00000001
};
void button_draw(struct ts_button *button);
int button_handle(struct ts_button *button, int x, int y, unsigned int pressure);
void getxy(struct tsdev *ts, int *x, int *y);
void ts_flush (struct tsdev *ts);
void print_ascii_logo(void);
#endif /* _TESTUTILS_H */
|
#ifndef _TESTUTILS_H
#define _TESTUTILS_H
/*
* tslib/tests/testutils.h
*
* Copyright (C) 2004 Michael Opdenacker <michaelo@handhelds.org>
*
* This file is placed under the GPL.
*
* SPDX-License-Identifier: GPL-2.0+
*
*
* Misc utils for ts test programs
*/
#define RESET "\033[0m"
#define RED "\033[31m"
#define GREEN "\033[32m"
#define BLUE "\033[34m"
#define YELLOW "\033[33m"
struct ts_button {
int x, y, w, h;
char *text;
int flags;
#define BUTTON_ACTIVE 0x00000001
};
void button_draw(struct ts_button *button);
int button_handle(struct ts_button *button, int x, int y, unsigned int pressure);
void getxy(struct tsdev *ts, int *x, int *y);
void ts_flush (struct tsdev *ts);
void print_ascii_logo(void);
#endif /* _TESTUTILS_H */
|
Fix license statement in header comment and add SPDS identifier
|
tests: Fix license statement in header comment and add SPDS identifier
This file had been copied around a long time ago, and included a wrong
license. All files in the tests directory (except for this small header)
are GPL licensed.
I actually doubt that the copyright notice is accurate here -.-
Signed-off-by: Martin Kepplinger <07ddf30bcca2a0d3056e54ffbfe155352a6af244@posteo.de>
|
C
|
lgpl-2.1
|
kergoth/tslib,kergoth/tslib,kergoth/tslib,kergoth/tslib
|
b1e1910a974865a362546d7d4bee35becb69b5e2
|
src/condor_syscall_lib/scanner.h
|
src/condor_syscall_lib/scanner.h
|
#define FUNC 1
#define PARAM 2
#define PTR_PARAM 3
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
int is_mapped;
int is_array;
int extract;
struct node *next;
struct node *prev;
};
union yystype {
struct token tok;
struct node *node;
};
#define YYSTYPE union yystype
|
#define FUNC 1
#define PARAM 2
#define PTR_PARAM 3
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
int is_const_ptr;
int is_mapped;
int is_array;
int in_param;
int out_param;
int extract;
struct node *next;
struct node *prev;
};
struct p_mode {
int in;
int out;
};
union yystype {
struct token tok;
struct node *node;
struct p_mode param_mode;
int bool;
};
#define YYSTYPE union yystype
|
Add boolean type so yacc productions can return a boolean value. Add parameter mode type so we can tag parameters as IN, OUT, or BOTH.
|
Add boolean type so yacc productions can return a boolean value.
Add parameter mode type so we can tag parameters as IN, OUT, or BOTH.
|
C
|
apache-2.0
|
htcondor/htcondor,djw8605/condor,htcondor/htcondor,htcondor/htcondor,djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,djw8605/condor,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,clalancette/condor-dcloud,djw8605/condor,djw8605/condor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,zhangzhehust/htcondor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/htcondor,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,djw8605/htcondor,djw8605/htcondor,htcondor/htcondor,neurodebian/htcondor,djw8605/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/condor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,neurodebian/htcondor,djw8605/condor,neurodebian/htcondor,neurodebian/htcondor,clalancette/condor-dcloud
|
e501b91a4a8f680ed453a6ad372f07d0836ab42b
|
Core/Code/Testing/mitkRenderingTestHelper.h
|
Core/Code/Testing/mitkRenderingTestHelper.h
|
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date: 2010-03-31 17:34:48 +0200 (Wed, 31 Mar 2010) $
Version: $Revision: 21985 $
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef mitkRenderingTestHelper_h
#define mitkRenderingTestHelper_h
#include <string>
#include <vtkSmartPointer.h>
#include <vtkRenderWindow.h>
#include <mitkRenderWindow.h>
class vtkRenderWindow;
class vtkRenderer;
namespace mitk
{
class DataStorage;
}
class MITK_CORE_EXPORT mitkRenderingTestHelper
{
public:
mitkRenderingTestHelper(int width, int height, mitk::DataStorage* ds);
~mitkRenderingTestHelper();
vtkRenderer* GetVtkRenderer();
vtkRenderWindow* GetVtkRenderWindow();
void SaveAsPNG(std::string fileName);
protected:
mitk::RenderWindow::Pointer m_RenderWindow;
};
#endif
|
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date: 2010-03-31 17:34:48 +0200 (Wed, 31 Mar 2010) $
Version: $Revision: 21985 $
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef mitkRenderingTestHelper_h
#define mitkRenderingTestHelper_h
#include <string>
#include <vtkSmartPointer.h>
#include <vtkRenderWindow.h>
#include <mitkRenderWindow.h>
class vtkRenderWindow;
class vtkRenderer;
namespace mitk
{
class DataStorage;
}
class mitkRenderingTestHelper
{
public:
mitkRenderingTestHelper(int width, int height, mitk::DataStorage* ds);
~mitkRenderingTestHelper();
vtkRenderer* GetVtkRenderer();
vtkRenderWindow* GetVtkRenderWindow();
void SaveAsPNG(std::string fileName);
protected:
mitk::RenderWindow::Pointer m_RenderWindow;
};
#endif
|
Fix linker warnings in rendering tests
|
Fix linker warnings in rendering tests
|
C
|
bsd-3-clause
|
nocnokneo/MITK,danielknorr/MITK,iwegner/MITK,NifTK/MITK,danielknorr/MITK,danielknorr/MITK,NifTK/MITK,lsanzdiaz/MITK-BiiG,MITK/MITK,nocnokneo/MITK,rfloca/MITK,fmilano/mitk,fmilano/mitk,lsanzdiaz/MITK-BiiG,rfloca/MITK,MITK/MITK,lsanzdiaz/MITK-BiiG,iwegner/MITK,lsanzdiaz/MITK-BiiG,iwegner/MITK,MITK/MITK,NifTK/MITK,danielknorr/MITK,fmilano/mitk,fmilano/mitk,rfloca/MITK,danielknorr/MITK,MITK/MITK,iwegner/MITK,RabadanLab/MITKats,danielknorr/MITK,NifTK/MITK,danielknorr/MITK,nocnokneo/MITK,nocnokneo/MITK,RabadanLab/MITKats,nocnokneo/MITK,fmilano/mitk,iwegner/MITK,RabadanLab/MITKats,nocnokneo/MITK,rfloca/MITK,MITK/MITK,rfloca/MITK,lsanzdiaz/MITK-BiiG,fmilano/mitk,nocnokneo/MITK,iwegner/MITK,lsanzdiaz/MITK-BiiG,NifTK/MITK,RabadanLab/MITKats,MITK/MITK,rfloca/MITK,RabadanLab/MITKats,RabadanLab/MITKats,NifTK/MITK,fmilano/mitk,lsanzdiaz/MITK-BiiG,rfloca/MITK,lsanzdiaz/MITK-BiiG
|
3cd04e32a8cd9497bd2882d7767e40ae9a936e24
|
test/sanitizer_common/print_address.h
|
test/sanitizer_common/print_address.h
|
#include <stdio.h>
#include <stdarg.h>
void print_address(const char *str, int n, ...) {
fprintf(stderr, "%s", str);
va_list ap;
va_start(ap, n);
while (n--) {
void *p = va_arg(ap, void *);
#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
// On FreeBSD, the %p conversion specifier works as 0x%x and thus does not
// match to the format used in the diagnotic message.
fprintf(stderr, "0x%012lx ", (unsigned long) p);
#elif defined(__i386__) || defined(__arm__)
fprintf(stderr, "0x%8lx ", (unsigned long) p);
#elif defined(__mips64)
fprintf(stderr, "0x%010lx ", (unsigned long) p);
#endif
}
fprintf(stderr, "\n");
}
|
#include <stdio.h>
#include <stdarg.h>
void print_address(const char *str, int n, ...) {
fprintf(stderr, "%s", str);
va_list ap;
va_start(ap, n);
while (n--) {
void *p = va_arg(ap, void *);
#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
// On FreeBSD, the %p conversion specifier works as 0x%x and thus does not
// match to the format used in the diagnotic message.
fprintf(stderr, "0x%012lx ", (unsigned long) p);
#elif defined(__i386__) || defined(__arm__)
fprintf(stderr, "0x%08lx ", (unsigned long) p);
#elif defined(__mips64)
fprintf(stderr, "0x%010lx ", (unsigned long) p);
#endif
}
fprintf(stderr, "\n");
}
|
Use 0-padding for i386 and arm print format specifiers
|
Use 0-padding for i386 and arm print format specifiers
Summary:
This is used for the other architectures in print_address, but is
missing from i386 and arm.
Reviewers: m.ostapenko, spetrovic
Subscribers: aemerson, rengolin, llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D31977
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@300065 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
|
3fff79f7dd1d8821a2d6c730f2aff3f994a15558
|
crypto/s2n_hkdf.h
|
crypto/s2n_hkdf.h
|
/*
* Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#pragma once
#include <stdint.h>
#include "utils/s2n_blob.h"
#include "crypto/s2n_hmac.h"
extern int s2n_hkdf(struct s2n_hmac_state *hmac, s2n_hmac_algorithm alg, const struct s2n_blob *salt,
const struct s2n_blob *key, const struct s2n_blob *info, struct s2n_blob *output);
|
/*
* Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#pragma once
#include <stdint.h>
#include "utils/s2n_blob.h"
#include "crypto/s2n_hmac.h"
extern int s2n_hkdf(struct s2n_hmac_state *hmac, s2n_hmac_algorithm alg, const struct s2n_blob *salt,
const struct s2n_blob *key, const struct s2n_blob *info, struct s2n_blob *output);
extern int s2n_hkdf_extract(struct s2n_hmac_state *hmac, s2n_hmac_algorithm alg, const struct s2n_blob *salt,
const struct s2n_blob *key, struct s2n_blob *pseudo_rand_key);
extern int s2n_hkdf_expand_label(struct s2n_hmac_state *hmac, s2n_hmac_algorithm alg, const struct s2n_blob *secret, const struct s2n_blob *label,
const struct s2n_blob *context, struct s2n_blob *output);
|
Add missing header changes from previous commit
|
Add missing header changes from previous commit
|
C
|
apache-2.0
|
wcs1only/s2n,awslabs/s2n,gibson-compsci/s2n,PKRoma/s2n,awslabs/s2n,PKRoma/s2n,colmmacc/s2n,alexeblee/s2n,raycoll/s2n,raycoll/s2n,wcs1only/s2n,PKRoma/s2n,alexeblee/s2n,gibson-compsci/s2n,wcs1only/s2n,colmmacc/s2n,raycoll/s2n,wcs1only/s2n,colmmacc/s2n,wcs1only/s2n,awslabs/s2n,raycoll/s2n,PKRoma/s2n,PKRoma/s2n,alexeblee/s2n,raycoll/s2n,alexeblee/s2n,gibson-compsci/s2n,alexeblee/s2n,gibson-compsci/s2n,wcs1only/s2n,PKRoma/s2n,gibson-compsci/s2n,PKRoma/s2n,wcs1only/s2n,wcs1only/s2n,colmmacc/s2n,awslabs/s2n,awslabs/s2n,colmmacc/s2n,raycoll/s2n,colmmacc/s2n,awslabs/s2n,alexeblee/s2n,gibson-compsci/s2n,PKRoma/s2n
|
412865c8ea9f94a487d9887360b8adb6032e6a80
|
test/Profile/profile-does-not-exist.c
|
test/Profile/profile-does-not-exist.c
|
// RUN: not %clang_cc1 -emit-llvm %s -fprofile-instr-use=%t.nonexistent.profdata 2>&1 | FileCheck %s
// CHECK: error: Could not read profile:
// CHECK-NOT: Assertion failed
|
// RUN: not %clang_cc1 -emit-llvm %s -o - -fprofile-instr-use=%t.nonexistent.profdata 2>&1 | FileCheck %s
// CHECK: error: Could not read profile:
// CHECK-NOT: Assertion failed
|
Fix this test so it doesn't try to open a file to write to the source tree
|
Fix this test so it doesn't try to open a file to write to the source tree
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@234173 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
|
75488d5639819f31b01f76433b82d6259323230d
|
unix-cpy/mpconfigport.h
|
unix-cpy/mpconfigport.h
|
// options to control how Micro Python is built
#define MICROPY_EMIT_CPYTHON (1)
#define MICROPY_ENABLE_LEXER_UNIX (1)
#define MICROPY_ENABLE_FLOAT (1)
// type definitions for the specific machine
#ifdef __LP64__
typedef long machine_int_t; // must be pointer size
typedef unsigned long machine_uint_t; // must be pointer size
#else
// These are definitions for machines where sizeof(int) == sizeof(void*),
// regardless for actual size.
typedef int machine_int_t; // must be pointer size
typedef unsigned int machine_uint_t; // must be pointer size
#endif
#define BYTES_PER_WORD sizeof(machine_int_t)
typedef void *machine_ptr_t; // must be of pointer size
typedef const void *machine_const_ptr_t; // must be of pointer size
typedef double machine_float_t;
machine_float_t machine_sqrt(machine_float_t x);
|
// options to control how Micro Python is built
#define MICROPY_EMIT_CPYTHON (1)
#define MICROPY_ENABLE_LEXER_UNIX (1)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
// type definitions for the specific machine
#ifdef __LP64__
typedef long machine_int_t; // must be pointer size
typedef unsigned long machine_uint_t; // must be pointer size
#else
// These are definitions for machines where sizeof(int) == sizeof(void*),
// regardless for actual size.
typedef int machine_int_t; // must be pointer size
typedef unsigned int machine_uint_t; // must be pointer size
#endif
#define BYTES_PER_WORD sizeof(machine_int_t)
typedef void *machine_ptr_t; // must be of pointer size
typedef const void *machine_const_ptr_t; // must be of pointer size
typedef double machine_float_t;
machine_float_t machine_sqrt(machine_float_t x);
|
Switch to use MICROPY_FLOAT_IMPL config define.
|
unix-cpy: Switch to use MICROPY_FLOAT_IMPL config define.
|
C
|
mit
|
micropython/micropython-esp32,SHA2017-badge/micropython-esp32,torwag/micropython,AriZuu/micropython,xhat/micropython,utopiaprince/micropython,AriZuu/micropython,ahotam/micropython,heisewangluo/micropython,firstval/micropython,hiway/micropython,cloudformdesign/micropython,mianos/micropython,kostyll/micropython,Timmenem/micropython,xuxiaoxin/micropython,matthewelse/micropython,rubencabrera/micropython,Vogtinator/micropython,bvernoux/micropython,infinnovation/micropython,deshipu/micropython,cnoviello/micropython,henriknelson/micropython,omtinez/micropython,adamkh/micropython,lowRISC/micropython,mgyenik/micropython,martinribelotta/micropython,infinnovation/micropython,kerneltask/micropython,trezor/micropython,dxxb/micropython,ryannathans/micropython,mianos/micropython,blazewicz/micropython,tuc-osg/micropython,methoxid/micropystat,lowRISC/micropython,rubencabrera/micropython,utopiaprince/micropython,ericsnowcurrently/micropython,pfalcon/micropython,torwag/micropython,ganshun666/micropython,xyb/micropython,blmorris/micropython,hosaka/micropython,adafruit/micropython,firstval/micropython,ChuckM/micropython,feilongfl/micropython,orionrobots/micropython,SungEun-Steve-Kim/test-mp,paul-xxx/micropython,adamkh/micropython,Peetz0r/micropython-esp32,ceramos/micropython,aitjcize/micropython,martinribelotta/micropython,micropython/micropython-esp32,KISSMonX/micropython,rubencabrera/micropython,dmazzella/micropython,mpalomer/micropython,supergis/micropython,ceramos/micropython,ChuckM/micropython,danicampora/micropython,firstval/micropython,cwyark/micropython,dhylands/micropython,slzatz/micropython,Timmenem/micropython,ceramos/micropython,noahwilliamsson/micropython,cwyark/micropython,stonegithubs/micropython,suda/micropython,mpalomer/micropython,ChuckM/micropython,blmorris/micropython,MrSurly/micropython-esp32,methoxid/micropystat,blazewicz/micropython,oopy/micropython,EcmaXp/micropython,AriZuu/micropython,dmazzella/micropython,feilongfl/micropython,bvernoux/micropython,jlillest/micropython,tdautc19841202/micropython,jlillest/micropython,trezor/micropython,stonegithubs/micropython,redbear/micropython,hosaka/micropython,ganshun666/micropython,warner83/micropython,neilh10/micropython,lbattraw/micropython,ahotam/micropython,skybird6672/micropython,bvernoux/micropython,HenrikSolver/micropython,oopy/micropython,kostyll/micropython,aethaniel/micropython,galenhz/micropython,MrSurly/micropython-esp32,paul-xxx/micropython,torwag/micropython,matthewelse/micropython,vriera/micropython,PappaPeppar/micropython,pozetroninc/micropython,selste/micropython,MrSurly/micropython,ruffy91/micropython,tuc-osg/micropython,jmarcelino/pycom-micropython,danicampora/micropython,chrisdearman/micropython,heisewangluo/micropython,ernesto-g/micropython,praemdonck/micropython,swegener/micropython,ahotam/micropython,pfalcon/micropython,alex-robbins/micropython,redbear/micropython,drrk/micropython,infinnovation/micropython,cloudformdesign/micropython,henriknelson/micropython,Vogtinator/micropython,adamkh/micropython,torwag/micropython,TDAbboud/micropython,dinau/micropython,turbinenreiter/micropython,martinribelotta/micropython,adafruit/micropython,redbear/micropython,hosaka/micropython,SungEun-Steve-Kim/test-mp,MrSurly/micropython-esp32,SungEun-Steve-Kim/test-mp,dmazzella/micropython,adafruit/circuitpython,tralamazza/micropython,henriknelson/micropython,jimkmc/micropython,SHA2017-badge/micropython-esp32,mpalomer/micropython,methoxid/micropystat,KISSMonX/micropython,jlillest/micropython,galenhz/micropython,alex-march/micropython,tobbad/micropython,kerneltask/micropython,drrk/micropython,aethaniel/micropython,dinau/micropython,pramasoul/micropython,alex-march/micropython,tobbad/micropython,xuxiaoxin/micropython,vitiral/micropython,deshipu/micropython,alex-robbins/micropython,selste/micropython,Timmenem/micropython,tdautc19841202/micropython,mgyenik/micropython,feilongfl/micropython,lowRISC/micropython,ryannathans/micropython,cwyark/micropython,micropython/micropython-esp32,EcmaXp/micropython,noahwilliamsson/micropython,mhoffma/micropython,ahotam/micropython,adafruit/circuitpython,skybird6672/micropython,mianos/micropython,PappaPeppar/micropython,ernesto-g/micropython,omtinez/micropython,aitjcize/micropython,vitiral/micropython,chrisdearman/micropython,heisewangluo/micropython,cnoviello/micropython,swegener/micropython,ernesto-g/micropython,ryannathans/micropython,mpalomer/micropython,rubencabrera/micropython,mianos/micropython,mgyenik/micropython,emfcamp/micropython,neilh10/micropython,trezor/micropython,lowRISC/micropython,ericsnowcurrently/micropython,slzatz/micropython,xhat/micropython,jmarcelino/pycom-micropython,AriZuu/micropython,ruffy91/micropython,galenhz/micropython,ganshun666/micropython,dxxb/micropython,mpalomer/micropython,toolmacher/micropython,jimkmc/micropython,supergis/micropython,Vogtinator/micropython,pfalcon/micropython,ruffy91/micropython,bvernoux/micropython,omtinez/micropython,PappaPeppar/micropython,swegener/micropython,deshipu/micropython,paul-xxx/micropython,mhoffma/micropython,matthewelse/micropython,vriera/micropython,vitiral/micropython,ryannathans/micropython,xhat/micropython,alex-march/micropython,lbattraw/micropython,jmarcelino/pycom-micropython,tuc-osg/micropython,drrk/micropython,firstval/micropython,blazewicz/micropython,tdautc19841202/micropython,tralamazza/micropython,warner83/micropython,ernesto-g/micropython,misterdanb/micropython,aitjcize/micropython,deshipu/micropython,dhylands/micropython,xuxiaoxin/micropython,matthewelse/micropython,PappaPeppar/micropython,MrSurly/micropython,xyb/micropython,AriZuu/micropython,xyb/micropython,alex-robbins/micropython,puuu/micropython,ernesto-g/micropython,aethaniel/micropython,ganshun666/micropython,feilongfl/micropython,dhylands/micropython,tdautc19841202/micropython,MrSurly/micropython,suda/micropython,emfcamp/micropython,turbinenreiter/micropython,PappaPeppar/micropython,noahchense/micropython,MrSurly/micropython,dinau/micropython,warner83/micropython,noahchense/micropython,henriknelson/micropython,tobbad/micropython,noahchense/micropython,adamkh/micropython,dxxb/micropython,trezor/micropython,orionrobots/micropython,ceramos/micropython,misterdanb/micropython,adafruit/micropython,hosaka/micropython,infinnovation/micropython,martinribelotta/micropython,turbinenreiter/micropython,noahchense/micropython,SungEun-Steve-Kim/test-mp,cwyark/micropython,selste/micropython,dxxb/micropython,jlillest/micropython,tobbad/micropython,omtinez/micropython,ryannathans/micropython,dhylands/micropython,ericsnowcurrently/micropython,emfcamp/micropython,galenhz/micropython,swegener/micropython,feilongfl/micropython,adamkh/micropython,emfcamp/micropython,danicampora/micropython,pramasoul/micropython,vriera/micropython,praemdonck/micropython,dmazzella/micropython,xyb/micropython,noahwilliamsson/micropython,kostyll/micropython,suda/micropython,hiway/micropython,drrk/micropython,danicampora/micropython,alex-march/micropython,heisewangluo/micropython,tuc-osg/micropython,adafruit/micropython,pozetroninc/micropython,ruffy91/micropython,alex-robbins/micropython,ceramos/micropython,KISSMonX/micropython,chrisdearman/micropython,MrSurly/micropython-esp32,HenrikSolver/micropython,vriera/micropython,cloudformdesign/micropython,aethaniel/micropython,misterdanb/micropython,TDAbboud/micropython,tralamazza/micropython,turbinenreiter/micropython,orionrobots/micropython,firstval/micropython,pfalcon/micropython,praemdonck/micropython,misterdanb/micropython,dinau/micropython,SungEun-Steve-Kim/test-mp,supergis/micropython,Timmenem/micropython,chrisdearman/micropython,deshipu/micropython,misterdanb/micropython,blazewicz/micropython,skybird6672/micropython,mhoffma/micropython,warner83/micropython,adafruit/micropython,micropython/micropython-esp32,adafruit/circuitpython,suda/micropython,turbinenreiter/micropython,SHA2017-badge/micropython-esp32,neilh10/micropython,kerneltask/micropython,methoxid/micropystat,lbattraw/micropython,ruffy91/micropython,redbear/micropython,KISSMonX/micropython,bvernoux/micropython,jmarcelino/pycom-micropython,dhylands/micropython,kostyll/micropython,mianos/micropython,neilh10/micropython,toolmacher/micropython,lowRISC/micropython,alex-robbins/micropython,HenrikSolver/micropython,heisewangluo/micropython,supergis/micropython,selste/micropython,warner83/micropython,praemdonck/micropython,utopiaprince/micropython,EcmaXp/micropython,micropython/micropython-esp32,noahwilliamsson/micropython,mhoffma/micropython,blmorris/micropython,pramasoul/micropython,kerneltask/micropython,xuxiaoxin/micropython,henriknelson/micropython,slzatz/micropython,rubencabrera/micropython,cwyark/micropython,chrisdearman/micropython,galenhz/micropython,jmarcelino/pycom-micropython,orionrobots/micropython,oopy/micropython,ChuckM/micropython,suda/micropython,Timmenem/micropython,Vogtinator/micropython,puuu/micropython,HenrikSolver/micropython,Peetz0r/micropython-esp32,toolmacher/micropython,oopy/micropython,neilh10/micropython,pozetroninc/micropython,adafruit/circuitpython,jimkmc/micropython,jlillest/micropython,paul-xxx/micropython,swegener/micropython,lbattraw/micropython,cloudformdesign/micropython,hiway/micropython,emfcamp/micropython,EcmaXp/micropython,cnoviello/micropython,trezor/micropython,lbattraw/micropython,Peetz0r/micropython-esp32,xuxiaoxin/micropython,pramasoul/micropython,drrk/micropython,puuu/micropython,dinau/micropython,MrSurly/micropython,Peetz0r/micropython-esp32,cloudformdesign/micropython,vitiral/micropython,blmorris/micropython,jimkmc/micropython,hosaka/micropython,omtinez/micropython,matthewelse/micropython,cnoviello/micropython,hiway/micropython,aitjcize/micropython,methoxid/micropystat,tdautc19841202/micropython,ahotam/micropython,cnoviello/micropython,SHA2017-badge/micropython-esp32,SHA2017-badge/micropython-esp32,mhoffma/micropython,martinribelotta/micropython,matthewelse/micropython,noahwilliamsson/micropython,oopy/micropython,ChuckM/micropython,puuu/micropython,KISSMonX/micropython,tuc-osg/micropython,mgyenik/micropython,xyb/micropython,adafruit/circuitpython,praemdonck/micropython,ericsnowcurrently/micropython,redbear/micropython,HenrikSolver/micropython,noahchense/micropython,utopiaprince/micropython,aethaniel/micropython,orionrobots/micropython,dxxb/micropython,mgyenik/micropython,utopiaprince/micropython,slzatz/micropython,hiway/micropython,pramasoul/micropython,toolmacher/micropython,puuu/micropython,vitiral/micropython,blazewicz/micropython,danicampora/micropython,supergis/micropython,blmorris/micropython,ganshun666/micropython,TDAbboud/micropython,Vogtinator/micropython,tobbad/micropython,Peetz0r/micropython-esp32,stonegithubs/micropython,xhat/micropython,torwag/micropython,TDAbboud/micropython,toolmacher/micropython,jimkmc/micropython,pfalcon/micropython,pozetroninc/micropython,adafruit/circuitpython,TDAbboud/micropython,ericsnowcurrently/micropython,MrSurly/micropython-esp32,kostyll/micropython,paul-xxx/micropython,infinnovation/micropython,skybird6672/micropython,vriera/micropython,alex-march/micropython,stonegithubs/micropython,EcmaXp/micropython,xhat/micropython,selste/micropython,tralamazza/micropython,slzatz/micropython,kerneltask/micropython,skybird6672/micropython,stonegithubs/micropython,pozetroninc/micropython
|
1a3c1576138400b28ca7093a842dc7d044d5892b
|
MKFirebaseObjectMapping/Classes/MKFirebaseModel.h
|
MKFirebaseObjectMapping/Classes/MKFirebaseModel.h
|
//
// Created by Michael Kuck on 7/7/16.
// Copyright (c) 2016 Michael Kuck. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class FIRDatabaseReference;
@class FIRDataSnapshot;
//============================================================
//== Public Interface
//============================================================
@interface MKFirebaseModel : NSObject
@property (nonatomic, readonly) FIRDatabaseReference *firebaseRef;
@property (nonatomic, readonly) NSString *identifier;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithFirebaseRef:(FIRDatabaseReference *)firebaseRef snapshotValue:(NSDictionary *)snapshotValue NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithSnapshot:(FIRDataSnapshot *)snapshot;
@end
NS_ASSUME_NONNULL_END
|
//
// Created by Michael Kuck on 7/7/16.
// Copyright (c) 2016 Michael Kuck. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class FIRDatabaseReference;
@class FIRDataSnapshot;
//============================================================
//== Public Interface
//============================================================
@interface MKFirebaseModel : NSObject
@property (nonatomic, readonly) FIRDatabaseReference *firebaseRef;
@property (nonatomic, readonly) NSString *identifier;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithFirebaseRef:(FIRDatabaseReference *)firebaseRef snapshotValue:(NSDictionary *)snapshotValue NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithSnapshot:(FIRDataSnapshot *)snapshot;
- (BOOL)isEqualToFirebaseModel:(MKFirebaseModel *)firebaseModel;
@end
NS_ASSUME_NONNULL_END
|
Add `isEqualToFirebaseModel:` to public header
|
Add `isEqualToFirebaseModel:` to public header
|
C
|
mit
|
mikumi/MKFirebaseObjectMapping,mikumi/MKFirebaseObjectMapping,mikumi/MKFirebaseObjectMapping
|
8e1f636ced4380a559aaf8eb14cae88442fc15c1
|
lib/Solenoid/Solenoid.h
|
lib/Solenoid/Solenoid.h
|
/****************************************************************************
* Copyright 2016 BlueMasters
*
* 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 SOLENOID__H
#define SOLENOID__H
#include <Arduino.h>
#include "StateMachine.h"
#include "LED.h"
#include "RFIDSensor.h"
#include "WolvesTypes.h"
enum solenoidState {
SOLENOID_IDLE,
SOLENOID_FROZEN,
SOLENOID_FIRED,
SOLENOID_WAITING
};
class Solenoid : public StateMachine {
public:
Solenoid(int impulsePin, RFIDSensor sensor, LED led) :
_impulsePin(impulsePin), _sensor(sensor), _led(led) {};
void begin();
void on();
void off();
void tick();
private:
int _impulsePin;
RFIDSensor _sensor;
LED _led;
solenoidState _state;
long _timestamp;
void fire(long t);
void release(long t);
};
#endif
|
/****************************************************************************
* Copyright 2016 BlueMasters
*
* 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 SOLENOID__H
#define SOLENOID__H
#include <Arduino.h>
#include "StateMachine.h"
#include "LED.h"
#include "RFIDSensor.h"
#include "WolvesTypes.h"
class Solenoid : public StateMachine {
public:
Solenoid(int impulsePin, RFIDSensor sensor, LED led) :
_impulsePin(impulsePin), _sensor(sensor), _led(led) {};
void begin();
void on();
void off();
void tick();
private:
enum solenoidState {
SOLENOID_IDLE,
SOLENOID_FROZEN,
SOLENOID_FIRED,
SOLENOID_WAITING
};
int _impulsePin;
RFIDSensor _sensor;
LED _led;
solenoidState _state;
long _timestamp;
void fire(long t);
void release(long t);
};
#endif
|
Put states inside the class
|
Put states inside the class
|
C
|
apache-2.0
|
BlueMasters/arduino-wolves,BlueMasters/arduino-wolves,BlueMasters/arduino-wolves
|
34ac8717bf58b13a6c2b8743e57506255434d731
|
src/Developer/ImageFilterMultipleOutputs.h
|
src/Developer/ImageFilterMultipleOutputs.h
|
#ifndef __itkImageFilterMultipleOutputs_h
#define __itkImageFilterMultipleOutputs_h
#include "itkImageToImageFilter.h"
namespace itk
{
template <class TImage>
class ImageFilterMultipleOutputs : public ImageToImageFilter<TImage, TImage>
{
public:
/** Standard class type alias. */
using Self = ImageFilterMultipleOutputs;
using Superclass = ImageToImageFilter<TImage, TImage>;
using Pointer = SmartPointer<Self>;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ImageFilterMultipleOutputs, ImageToImageFilter);
TImage *
GetOutput1();
TImage *
GetOutput2();
protected:
ImageFilterMultipleOutputs();
~ImageFilterMultipleOutputs() override = default;
/** Does the real work. */
void
GenerateData() override;
/** Create the Output */
DataObject::Pointer
MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx);
private:
ImageFilterMultipleOutputs(const Self &) = delete; // purposely not implemented
void
operator=(const Self &) = delete; // purposely not implemented
};
} // namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "ImageFilterMultipleOutputs.hxx"
#endif
#endif // __itkImageFilterMultipleOutputs_h
|
#ifndef __itkImageFilterMultipleOutputs_h
#define __itkImageFilterMultipleOutputs_h
#include "itkImageToImageFilter.h"
namespace itk
{
template <class TImage>
class ImageFilterMultipleOutputs : public ImageToImageFilter<TImage, TImage>
{
public:
/** Standard class type alias. */
using Self = ImageFilterMultipleOutputs;
using Superclass = ImageToImageFilter<TImage, TImage>;
using Pointer = SmartPointer<Self>;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ImageFilterMultipleOutputs, ImageToImageFilter);
TImage *
GetOutput1();
TImage *
GetOutput2();
protected:
ImageFilterMultipleOutputs();
~ImageFilterMultipleOutputs() override = default;
/** Does the real work. */
void
GenerateData() override;
/** Create the Output */
DataObject::Pointer
MakeOutput(ProcessObject::DataObjectPointerArraySizeType idx) override;
private:
ImageFilterMultipleOutputs(const Self &) = delete; // purposely not implemented
void
operator=(const Self &) = delete; // purposely not implemented
};
} // namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "ImageFilterMultipleOutputs.hxx"
#endif
#endif // __itkImageFilterMultipleOutputs_h
|
Remove redundant void argument lists
|
STYLE: Remove redundant void argument lists
Find and remove redundant void argument lists.
|
C
|
apache-2.0
|
InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples
|
fdeab35e4997c16515efea32d97845786d373990
|
tests/test_utilities.h
|
tests/test_utilities.h
|
#pragma once
#include <string>
#include <sstream>
#include <Eigen/Dense>
std::string output_matrices(Eigen::MatrixXd expected, Eigen::MatrixXd actual) {
std::stringstream ss;
ss << "expected:\n" << expected << "\nactual:\n" << actual << std::endl;
return ss.str();
}
|
#pragma once
#include <string>
#include <sstream>
#include <Eigen/Dense>
std::string output_matrices(Eigen::MatrixXd expected, Eigen::MatrixXd actual) {
std::stringstream ss;
ss << "expected:\n" << expected << "\nactual:\n" << actual << std::endl;
return ss.str();
}
/*
* allclose() function to match numpy.allclose
* https://stackoverflow.com/questions/15051367/how-to-compare-vectors-approximately-in-eige://stackoverflow.com/questions/15051367/how-to-compare-vectors-approximately-in-eigen
*/
namespace test {
template<typename DerivedA, typename DerivedB>
bool allclose(const Eigen::DenseBase<DerivedA>& a, const Eigen::DenseBase<DerivedB>& b,
const typename DerivedA::RealScalar& rtol
= Eigen::NumTraits<typename DerivedA::RealScalar>::dummy_precision(),
const typename DerivedA::RealScalar& atol
= Eigen::NumTraits<typename DerivedA::RealScalar>::epsilon()) {
return ((a.derived() - b.derived()).array().abs() <= (atol + rtol * b.derived().array().abs())).all();
}
} // namespace test
|
Add allclose function for testing
|
Add allclose function for testing
Compare relative and absolute tolerence of matrix elements. Eigen
isApprox() functions compare matrix norms.
|
C
|
bsd-2-clause
|
oliverlee/bicycle,oliverlee/bicycle
|
4282ccf09f23c582b16cdc4570de238ac959a2dd
|
firmware/MDNS.h
|
firmware/MDNS.h
|
#include "application.h"
#ifndef _INCL_MDNS
#define _INCL_MDNS
#include "Buffer.h"
#include "Label.h"
#include "Record.h"
#include <map>
#include <vector>
#define MDNS_PORT 5353
#define BUFFER_SIZE 512
#define HOSTNAME ""
class MDNS {
public:
bool setHostname(String hostname);
bool addService(String protocol, String service, uint16_t port, String instance, std::vector<String> subServices = std::vector<String>());
void addTXTEntry(String key, String value = NULL);
bool begin();
bool processQueries();
private:
struct QueryHeader {
uint16_t id;
uint16_t flags;
uint16_t qdcount;
uint16_t ancount;
uint16_t nscount;
uint16_t arcount;
};
UDP * udp = new UDP();
Buffer * buffer = new Buffer(BUFFER_SIZE);
Label * ROOT = new Label("");
Label * LOCAL = new Label("local", ROOT);
Label::Matcher * matcher = new Label::Matcher();
ARecord * aRecord;
TXTRecord * txtRecord;
std::map<String, Label *> labels;
std::vector<Record *> records;
String status = "Ok";
QueryHeader readHeader(Buffer * buffer);
void getResponses();
void writeResponses();
bool isAlphaDigitHyphen(String string);
bool isNetUnicode(String string);
};
#endif
|
#include "application.h"
#ifndef _INCL_MDNS
#define _INCL_MDNS
#include "Buffer.h"
#include "Label.h"
#include "Record.h"
#include <map>
#include <vector>
#define MDNS_PORT 5353
#define BUFFER_SIZE 512
#define HOSTNAME ""
class MDNS {
public:
bool setHostname(String hostname);
bool addService(String protocol, String service, uint16_t port, String instance, std::vector<String> subServices = std::vector<String>());
void addTXTEntry(String key, String value = "");
bool begin();
bool processQueries();
private:
struct QueryHeader {
uint16_t id;
uint16_t flags;
uint16_t qdcount;
uint16_t ancount;
uint16_t nscount;
uint16_t arcount;
};
UDP * udp = new UDP();
Buffer * buffer = new Buffer(BUFFER_SIZE);
Label * ROOT = new Label("");
Label * LOCAL = new Label("local", ROOT);
Label::Matcher * matcher = new Label::Matcher();
ARecord * aRecord;
TXTRecord * txtRecord;
std::map<String, Label *> labels;
std::vector<Record *> records;
String status = "Ok";
QueryHeader readHeader(Buffer * buffer);
void getResponses();
void writeResponses();
bool isAlphaDigitHyphen(String string);
bool isNetUnicode(String string);
};
#endif
|
Fix for particle firmware v0.6.2
|
Fix for particle firmware v0.6.2
|
C
|
mit
|
mrhornsby/spark-core-mdns,mrhornsby/spark-core-mdns
|
3cfe2d2e5b57ff33d4febcb0668d1d71fce2dd21
|
acacia_tests.c
|
acacia_tests.c
|
#include <string.h>
#include "lib/minunit.h"
#include "acacia.h"
//#define TEST_KEY "abcd1111"
#define TEST_KEY "abcdefghijklmnopqrstuvwxyz"
#define TEST_VALUE "foo_bar_baz_111"
MU_TEST(test_check) {
struct Node *cache = cache_init();
cache_set(TEST_KEY, TEST_VALUE, cache);
mu_check(strcmp(cache_get(TEST_KEY, cache), TEST_VALUE) == 0);
cache_close(cache);
}
MU_TEST_SUITE(test_suite) {
MU_RUN_TEST(test_check);
}
int main(int argc, const char *argv[])
{
MU_RUN_SUITE(test_suite);
MU_REPORT();
return 0;
}
|
#include <string.h>
#include "lib/minunit.h"
#include "acacia.h"
#define TEST_KEY "abcdefghijklmnopqrstuvwxyz"
#define TEST_VALUE "foo_bar_baz_111"
MU_TEST(test_store_fetch_simple) {
struct Node *cache = cache_init();
cache_set(TEST_KEY, TEST_VALUE, cache);
mu_check(strcmp(cache_get(TEST_KEY, cache), TEST_VALUE) == 0);
cache_close(cache);
}
MU_TEST(test_store_fetch_empty_string) {
struct Node *cache = cache_init();
cache_set("foo", "", cache);
mu_check(strcmp(cache_get("foo", cache), "") == 0);
cache_close(cache);
}
MU_TEST_SUITE(test_suite) {
MU_RUN_TEST(test_store_fetch_simple);
MU_RUN_TEST(test_store_fetch_empty_string);
}
int main(int argc, const char *argv[])
{
MU_RUN_SUITE(test_suite);
MU_REPORT();
return 0;
}
|
Add a test for caching an empty string
|
Add a test for caching an empty string
|
C
|
mit
|
zedr/acacia
|
3a04ce29a2d92f58ab07f83f4970c544e4afdf00
|
testsuite/tests/rts/exec_signals_prepare.c
|
testsuite/tests/rts/exec_signals_prepare.c
|
#include <signal.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
// Invokes a process, making sure that the state of the signal
// handlers has all been set back to the unix default.
int main(int argc, char **argv)
{
int i;
sigset_t blockedsigs;
struct sigaction action;
// unblock all signals
sigemptyset(&blockedsigs);
sigprocmask(SIG_BLOCK, NULL, NULL);
// reset all signals to SIG_DFL
memset(&action, 0, sizeof(action));
action.sa_handler = SIG_DFL;
action.sa_flags = 0;
sigemptyset(&action.sa_mask);
for(i = 0; i < NSIG; ++i)
sigaction(i, &action, NULL);
execv(argv[1], argv+1);
fprintf(stderr, "failed to execv %s\n", argv[1]);
return 0;
}
|
#include <signal.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
// Invokes a process, making sure that the state of the signal
// handlers has all been set back to the unix default.
int main(int argc, char **argv)
{
int i;
sigset_t blockedsigs;
struct sigaction action;
// unblock all signals
sigemptyset(&blockedsigs);
sigprocmask(SIG_BLOCK, NULL, NULL);
// reset all signals to SIG_DFL
memset(&action, 0, sizeof(action));
action.sa_handler = SIG_DFL;
action.sa_flags = 0;
sigemptyset(&action.sa_mask);
for(i = 0; i < NSIG; ++i)
sigaction(i, &action, NULL);
execv(argv[1], argv+1);
fprintf(stderr, "failed to execv %s\n", argv[1]);
return 0;
}
|
Fix below warning by including "unistd.h" also
|
Fix below warning by including "unistd.h" also
exec_signals_prepare.c:26:5: warning: implicit declaration of function 'execv' is invalid in C99
[-Wimplicit-function-declaration]
execv(argv[1], argv+1);
^
1 warning generated.
|
C
|
bsd-3-clause
|
vTurbine/ghc,sdiehl/ghc,vTurbine/ghc,GaloisInc/halvm-ghc,nathyong/microghc-ghc,ryantm/ghc,urbanslug/ghc,jstolarek/ghc,sdiehl/ghc,TomMD/ghc,vTurbine/ghc,TomMD/ghc,snoyberg/ghc,sdiehl/ghc,spacekitteh/smcghc,jstolarek/ghc,jstolarek/ghc,ezyang/ghc,snoyberg/ghc,mcschroeder/ghc,lukexi/ghc,acowley/ghc,elieux/ghc,christiaanb/ghc,vTurbine/ghc,mcschroeder/ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,siddhanathan/ghc,vikraman/ghc,urbanslug/ghc,GaloisInc/halvm-ghc,fmthoma/ghc,urbanslug/ghc,ml9951/ghc,gcampax/ghc,tjakway/ghcjvm,oldmanmike/ghc,gcampax/ghc,holzensp/ghc,da-x/ghc,wxwxwwxxx/ghc,bitemyapp/ghc,anton-dessiatov/ghc,green-haskell/ghc,gridaphobe/ghc,bitemyapp/ghc,olsner/ghc,gcampax/ghc,gridaphobe/ghc,AlexanderPankiv/ghc,sgillespie/ghc,mettekou/ghc,lukexi/ghc,shlevy/ghc,mettekou/ghc,holzensp/ghc,ezyang/ghc,olsner/ghc,ml9951/ghc,nushio3/ghc,shlevy/ghc,TomMD/ghc,fmthoma/ghc,vTurbine/ghc,vikraman/ghc,siddhanathan/ghc,lukexi/ghc,AlexanderPankiv/ghc,mcschroeder/ghc,sgillespie/ghc,bitemyapp/ghc,fmthoma/ghc,forked-upstream-packages-for-ghcjs/ghc,forked-upstream-packages-for-ghcjs/ghc,tjakway/ghcjvm,shlevy/ghc,urbanslug/ghc,mettekou/ghc,christiaanb/ghc,wxwxwwxxx/ghc,holzensp/ghc,nkaretnikov/ghc,ghc-android/ghc,nushio3/ghc,nkaretnikov/ghc,gridaphobe/ghc,AlexanderPankiv/ghc,ghc-android/ghc,bitemyapp/ghc,nathyong/microghc-ghc,gcampax/ghc,da-x/ghc,wxwxwwxxx/ghc,oldmanmike/ghc,wxwxwwxxx/ghc,sgillespie/ghc,ml9951/ghc,mfine/ghc,vikraman/ghc,nathyong/microghc-ghc,oldmanmike/ghc,olsner/ghc,acowley/ghc,tjakway/ghcjvm,elieux/ghc,forked-upstream-packages-for-ghcjs/ghc,AlexanderPankiv/ghc,spacekitteh/smcghc,wxwxwwxxx/ghc,TomMD/ghc,siddhanathan/ghc,gcampax/ghc,lukexi/ghc,ryantm/ghc,ryantm/ghc,nushio3/ghc,green-haskell/ghc,snoyberg/ghc,tibbe/ghc,gridaphobe/ghc,acowley/ghc,sdiehl/ghc,nathyong/microghc-ghc,ryantm/ghc,sdiehl/ghc,oldmanmike/ghc,tjakway/ghcjvm,nathyong/microghc-ghc,acowley/ghc,mfine/ghc,ghc-android/ghc,forked-upstream-packages-for-ghcjs/ghc,elieux/ghc,fmthoma/ghc,mcschroeder/ghc,ezyang/ghc,gridaphobe/ghc,ghc-android/ghc,urbanslug/ghc,ezyang/ghc,spacekitteh/smcghc,green-haskell/ghc,spacekitteh/smcghc,mcschroeder/ghc,tjakway/ghcjvm,christiaanb/ghc,nkaretnikov/ghc,ml9951/ghc,nushio3/ghc,frantisekfarka/ghc-dsi,green-haskell/ghc,ezyang/ghc,olsner/ghc,shlevy/ghc,oldmanmike/ghc,mfine/ghc,mettekou/ghc,frantisekfarka/ghc-dsi,bitemyapp/ghc,tibbe/ghc,christiaanb/ghc,siddhanathan/ghc,ghc-android/ghc,sgillespie/ghc,nushio3/ghc,tibbe/ghc,wxwxwwxxx/ghc,holzensp/ghc,gridaphobe/ghc,vikraman/ghc,sgillespie/ghc,tibbe/ghc,AlexanderPankiv/ghc,mfine/ghc,oldmanmike/ghc,ml9951/ghc,vikraman/ghc,anton-dessiatov/ghc,christiaanb/ghc,da-x/ghc,gridaphobe/ghc,sgillespie/ghc,TomMD/ghc,mettekou/ghc,vikraman/ghc,GaloisInc/halvm-ghc,elieux/ghc,forked-upstream-packages-for-ghcjs/ghc,mfine/ghc,nkaretnikov/ghc,tjakway/ghcjvm,frantisekfarka/ghc-dsi,gcampax/ghc,shlevy/ghc,olsner/ghc,mcschroeder/ghc,ml9951/ghc,christiaanb/ghc,ghc-android/ghc,ml9951/ghc,shlevy/ghc,nathyong/microghc-ghc,anton-dessiatov/ghc,tibbe/ghc,olsner/ghc,forked-upstream-packages-for-ghcjs/ghc,siddhanathan/ghc,urbanslug/ghc,shlevy/ghc,siddhanathan/ghc,mettekou/ghc,snoyberg/ghc,AlexanderPankiv/ghc,acowley/ghc,da-x/ghc,nkaretnikov/ghc,snoyberg/ghc,ezyang/ghc,mcschroeder/ghc,wxwxwwxxx/ghc,GaloisInc/halvm-ghc,nkaretnikov/ghc,elieux/ghc,acowley/ghc,elieux/ghc,da-x/ghc,tjakway/ghcjvm,anton-dessiatov/ghc,mfine/ghc,acowley/ghc,da-x/ghc,green-haskell/ghc,gcampax/ghc,GaloisInc/halvm-ghc,christiaanb/ghc,olsner/ghc,mfine/ghc,anton-dessiatov/ghc,fmthoma/ghc,frantisekfarka/ghc-dsi,fmthoma/ghc,forked-upstream-packages-for-ghcjs/ghc,ml9951/ghc,da-x/ghc,fmthoma/ghc,sdiehl/ghc,nathyong/microghc-ghc,lukexi/ghc,siddhanathan/ghc,ezyang/ghc,nkaretnikov/ghc,sdiehl/ghc,anton-dessiatov/ghc,anton-dessiatov/ghc,elieux/ghc,holzensp/ghc,snoyberg/ghc,vTurbine/ghc,ryantm/ghc,mettekou/ghc,spacekitteh/smcghc,vTurbine/ghc,TomMD/ghc,urbanslug/ghc,sgillespie/ghc,snoyberg/ghc,nushio3/ghc,frantisekfarka/ghc-dsi,oldmanmike/ghc,ghc-android/ghc,vikraman/ghc,nushio3/ghc,jstolarek/ghc,AlexanderPankiv/ghc,jstolarek/ghc,TomMD/ghc
|
c1e92e075a259543719f7410290aeaffefe783b2
|
include/Map.h
|
include/Map.h
|
#ifndef LAND_H
#define LAND_H
#include <string>
#include "Plant.h"
class Land
{
public:
~Land();
const std::string getPlantName() const { return isStood_? plant_->getName() : "Empty"; }
bool put(Plant & plant);
bool getStood()const{return isStood_;}
private:
Plant * plant_ = nullptr;
bool isStood_ = false;
};
#endif // LAND_H
#ifndef MAP_H
#define MAP_H
#include <vector>
class Map
{
public:
// with this constructor, you could get a map with [land_num] empty land
Map(int land_num);
Land operator[] (int i) { return lands_[i]; }
const Land operator[] (int i) const { return lands_[i]; }
int size() { return lands_.size(); }
bool put(Plant & plant, int position) { return lands_[position].put(plant); }
private:
constexpr static int max_land_num = 10;
std::vector<Land> lands_;
};
#endif // MAP_H
|
#ifndef LAND_H
#define LAND_H
#include <string>
#include "Plant.h"
class Land
{
public:
~Land();
bool put(Plant & plant);
bool getStood()const{return isStood_;}
Plant & getPlant() { return *plant_; }
const Plant & getPlant() const { return *plant_; }
private:
Plant * plant_ = nullptr;
bool isStood_ = false;
};
#endif // LAND_H
#ifndef MAP_H
#define MAP_H
#include <vector>
class Map
{
public:
// with this constructor, you could get a map with [land_num] empty land
Map(int land_num);
Land operator[] (int i) { return lands_[i]; }
const Land operator[] (int i) const { return lands_[i]; }
int size() { return lands_.size(); }
bool put(Plant & plant, int position) { return lands_[position].put(plant); }
private:
constexpr static int max_land_num = 10;
std::vector<Land> lands_;
};
#endif // MAP_H
|
Remove getPlantName metohod & Add getPlant mathod
|
Remove getPlantName metohod & Add getPlant mathod
|
C
|
mit
|
wi1d5ky/AP-Team-Project
|
b3f4c5d49830a8ef77ec1d74e8100fe3cc561230
|
include/api/ofp_odp_compat.h
|
include/api/ofp_odp_compat.h
|
/* Copyright (c) 2015, ENEA Software AB
* Copyright (c) 2015, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __OFP_ODP_COMPAT__
#define __OFP_ODP_COMPAT__
#if ODP_VERSION == 102
#include "linux.h"
#else
#include "odp/helper/linux.h"
#endif /* odp_version == 102 */
#if ODP_VERSION < 105
typedef uint64_t odp_time_t;
#endif /* ODP_VERSION < 105 */
#if ODP_VERSION < 104 && ODP_VERSION > 101
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers)
#elif ODP_VERSION < 102
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask)
#define ODP_THREAD_WORKER
#define ODP_THREAD_CONTROL
#endif
#endif
|
/* Copyright (c) 2015, ENEA Software AB
* Copyright (c) 2015, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __OFP_ODP_COMPAT__
#define __OFP_ODP_COMPAT__
#if ODP_VERSION == 102
#include "linux.h"
#else
#include "odp/helper/linux.h"
#endif /* odp_version == 102 */
#if ODP_VERSION < 105
typedef uint64_t odp_time_t;
#endif /* ODP_VERSION < 105 */
#if ODP_VERSION < 104 && ODP_VERSION > 101
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers)
#elif ODP_VERSION < 102
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask)
#define odp_init_local(x) odp_init_local()
#define ODP_THREAD_WORKER 0
#define ODP_THREAD_CONTROL 1
#endif
#endif
|
Define ODP_THREAD_WORKER and ODP_THREAD_CONTROL as in it's original enum, instead of mangling them.
|
Define ODP_THREAD_WORKER and ODP_THREAD_CONTROL as in it's original enum, instead of mangling them.
Defining odp_init_local like this we can initialized properly the
values of ODP_THREAD_WORKER and ODP_THREAD_CONTROL. This is important
for the following patch where we need to define odp_threat_type_t.
Signed-off-by: José Pekkarinen <d7cb8761fb0e75b1a78c2fda4f1daed76cd46cfe@nokia.com>
Reviewed-and-tested-by: Sorin Vultureanu <8013ba55f8675034bc2ab0d6c3a1c9650437ca36@enea.com>
|
C
|
bsd-3-clause
|
OpenFastPath/ofp,OpenFastPath/ofp,OpenFastPath/ofp,TolikH/ofp,TolikH/ofp,OpenFastPath/ofp,TolikH/ofp
|
00126c32c776459b75e5d2bfaba28bd261c1510a
|
h5py/api_compat.h
|
h5py/api_compat.h
|
/***** Preamble block *********************************************************
*
* This file is part of h5py, a Python interface to the HDF5 library.
*
* http://www.h5py.org
*
* Copyright 2008-2013 Andrew Collette and contributors
*
* License: Standard 3-clause BSD; see "license.txt" for full license terms
* and contributor agreement.
*
****** End preamble block ****************************************************/
/* Contains compatibility macros and definitions for use by Cython code */
#ifndef H5PY_COMPAT
#define H5PY_COMPAT
#include <stddef.h>
#include "Python.h"
#include "numpy/arrayobject.h"
#include "hdf5.h"
/* The HOFFSET macro can't be used from Cython. */
#define h5py_size_n64 (sizeof(npy_complex64))
#define h5py_size_n128 (sizeof(npy_complex128))
#define h5py_offset_n64_real (HOFFSET(npy_complex64, real))
#define h5py_offset_n64_imag (HOFFSET(npy_complex64, imag))
#define h5py_offset_n128_real (HOFFSET(npy_complex128, real))
#define h5py_offset_n128_imag (HOFFSET(npy_complex128, imag))
#endif
|
/***** Preamble block *********************************************************
*
* This file is part of h5py, a Python interface to the HDF5 library.
*
* http://www.h5py.org
*
* Copyright 2008-2013 Andrew Collette and contributors
*
* License: Standard 3-clause BSD; see "license.txt" for full license terms
* and contributor agreement.
*
****** End preamble block ****************************************************/
/* Contains compatibility macros and definitions for use by Cython code */
#ifndef H5PY_COMPAT
#define H5PY_COMPAT
#if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message)
typedef void *PyMPI_MPI_Message;
#define MPI_Message PyMPI_MPI_Message
#endif
#include <stddef.h>
#include "Python.h"
#include "numpy/arrayobject.h"
#include "hdf5.h"
/* The HOFFSET macro can't be used from Cython. */
#define h5py_size_n64 (sizeof(npy_complex64))
#define h5py_size_n128 (sizeof(npy_complex128))
#define h5py_offset_n64_real (HOFFSET(npy_complex64, real))
#define h5py_offset_n64_imag (HOFFSET(npy_complex64, imag))
#define h5py_offset_n128_real (HOFFSET(npy_complex128, real))
#define h5py_offset_n128_imag (HOFFSET(npy_complex128, imag))
#endif
|
Add conditional definition of PyMPI_MPI_Message and MPI_Message PyMPI_MPI_Message. This is needed for MPI_VERSION<3 and a recent version of mpi4py.
|
Add conditional definition of PyMPI_MPI_Message and MPI_Message PyMPI_MPI_Message. This is needed for MPI_VERSION<3 and a recent version of mpi4py.
Follows gh-401 https://groups.google.com/d/topic/h5py/Uw5x3BKwJGU/discussion and https://groups.google.com/d/topic/mpi4py/xnDyYvawB-Q/discussion.
|
C
|
bsd-3-clause
|
h5py/h5py,h5py/h5py,h5py/h5py
|
7a79b1da0c124fb642658c3698a38fdd9e77eb01
|
libc/string/strlcpy.c
|
libc/string/strlcpy.c
|
/*
* Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define L_strlcpy
#define Wstrlcpy __strlcpy
#include "wstring.c"
strong_alias(__strlcpy, strlcpy)
#ifdef __LOCALE_C_ONLY
weak_alias(strlcpy, strxfrm)
#endif
#undef L_strlcpy
|
/*
* Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define L_strlcpy
#define Wstrlcpy __strlcpy
#include "wstring.c"
strong_alias(__strlcpy, strlcpy)
#ifdef __LOCALE_C_ONLY
weak_alias(__strlcpy, __strxfrm)
strong_alias(__strxfrm, strxfrm)
#endif
#undef L_strlcpy
|
Use correct syntax, correct weak/strong for [__]strxfrm
|
Use correct syntax, correct weak/strong for [__]strxfrm
|
C
|
lgpl-2.1
|
hjl-tools/uClibc,klee/klee-uclibc,ChickenRunjyd/klee-uclibc,kraj/uClibc,kraj/uclibc-ng,gittup/uClibc,groundwater/uClibc,waweber/uclibc-clang,ddcc/klee-uclibc-0.9.33.2,foss-xtensa/uClibc,ndmsystems/uClibc,mephi42/uClibc,waweber/uclibc-clang,majek/uclibc-vx32,hjl-tools/uClibc,waweber/uclibc-clang,kraj/uclibc-ng,atgreen/uClibc-moxie,ffainelli/uClibc,skristiansson/uClibc-or1k,foss-xtensa/uClibc,czankel/xtensa-uclibc,ffainelli/uClibc,hwoarang/uClibc,groundwater/uClibc,groundwater/uClibc,hjl-tools/uClibc,ChickenRunjyd/klee-uclibc,foss-for-synopsys-dwc-arc-processors/uClibc,ndmsystems/uClibc,groundwater/uClibc,ffainelli/uClibc,ChickenRunjyd/klee-uclibc,wbx-github/uclibc-ng,hwoarang/uClibc,ndmsystems/uClibc,atgreen/uClibc-moxie,gittup/uClibc,majek/uclibc-vx32,m-labs/uclibc-lm32,foss-for-synopsys-dwc-arc-processors/uClibc,ChickenRunjyd/klee-uclibc,brgl/uclibc-ng,skristiansson/uClibc-or1k,mephi42/uClibc,ddcc/klee-uclibc-0.9.33.2,brgl/uclibc-ng,kraj/uclibc-ng,klee/klee-uclibc,hjl-tools/uClibc,brgl/uclibc-ng,majek/uclibc-vx32,atgreen/uClibc-moxie,wbx-github/uclibc-ng,foss-xtensa/uClibc,czankel/xtensa-uclibc,foss-xtensa/uClibc,kraj/uClibc,OpenInkpot-archive/iplinux-uclibc,skristiansson/uClibc-or1k,OpenInkpot-archive/iplinux-uclibc,hwoarang/uClibc,kraj/uclibc-ng,czankel/xtensa-uclibc,majek/uclibc-vx32,gittup/uClibc,OpenInkpot-archive/iplinux-uclibc,mephi42/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,atgreen/uClibc-moxie,brgl/uclibc-ng,hwoarang/uClibc,wbx-github/uclibc-ng,m-labs/uclibc-lm32,ysat0/uClibc,ffainelli/uClibc,OpenInkpot-archive/iplinux-uclibc,ddcc/klee-uclibc-0.9.33.2,waweber/uclibc-clang,m-labs/uclibc-lm32,czankel/xtensa-uclibc,ndmsystems/uClibc,kraj/uClibc,m-labs/uclibc-lm32,hjl-tools/uClibc,ffainelli/uClibc,ysat0/uClibc,groundwater/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,skristiansson/uClibc-or1k,ysat0/uClibc,mephi42/uClibc,ddcc/klee-uclibc-0.9.33.2,klee/klee-uclibc,gittup/uClibc,klee/klee-uclibc,wbx-github/uclibc-ng,ysat0/uClibc,kraj/uClibc
|
3b4851ccd8e04b2db4127ced955cbfecb1e99786
|
libc/string/strlcpy.c
|
libc/string/strlcpy.c
|
/*
* Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define L_strlcpy
#define Wstrlcpy __strlcpy
#include "wstring.c"
strong_alias(__strlcpy, strlcpy)
#ifdef __LOCALE_C_ONLY
weak_alias(strlcpy, strxfrm)
#endif
#undef L_strlcpy
|
/*
* Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define L_strlcpy
#define Wstrlcpy __strlcpy
#include "wstring.c"
strong_alias(__strlcpy, strlcpy)
#ifdef __LOCALE_C_ONLY
weak_alias(__strlcpy, __strxfrm)
strong_alias(__strxfrm, strxfrm)
#endif
#undef L_strlcpy
|
Use correct syntax, correct weak/strong for [__]strxfrm
|
Use correct syntax, correct weak/strong for [__]strxfrm
|
C
|
lgpl-2.1
|
joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc
|
e44bcd18b20baba5fa95000415440f83c36a9599
|
libk/src/hook/fcntl.c
|
libk/src/hook/fcntl.c
|
#include <fcntl.h>
#include <k/sys.h>
int open(const char *path, int oflag, ...) {
return MAKE_SYSCALL(open, path, oflag);
}
int fcntl(int fildes, int cmd, ...) {
//FIXME for bash
return MAKE_SYSCALL(unimplemented, "fcntl", false);
}
|
#include <fcntl.h>
#include <stdarg.h>
#include <k/sys.h>
int open(const char *path, int oflag, ...) {
int mode = 0;
if(oflag & O_CREAT) {
va_list va;
va_start(va, oflag);
mode = va_arg(va, int);
va_end(va);
}
return MAKE_SYSCALL(open, path, oflag, mode);
}
int fcntl(int fildes, int cmd, ...) {
//FIXME for bash
return MAKE_SYSCALL(unimplemented, "fcntl", false);
}
|
Fix open() syscall in libk
|
Fix open() syscall in libk
|
C
|
bsd-2-clause
|
escortkeel/k-os,escortkeel/k-os,escortkeel/k-os
|
227a2bd5dc57ee93bf4b4ea9e3a2c8837e629f51
|
brightray/browser/mac/cocoa_notification.h
|
brightray/browser/mac/cocoa_notification.h
|
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef BRIGHTRAY_BROWSER_MAC_COCOA_NOTIFICATION_H_
#define BRIGHTRAY_BROWSER_MAC_COCOA_NOTIFICATION_H_
#import <Foundation/Foundation.h>
#include <string>
#include "base/mac/scoped_nsobject.h"
#include "brightray/browser/notification.h"
namespace brightray {
class CocoaNotification : public Notification {
public:
CocoaNotification(NotificationDelegate* delegate,
NotificationPresenter* presenter);
~CocoaNotification();
// Notification:
void Show(const base::string16& title,
const base::string16& msg,
const std::string& tag,
const GURL& icon_url,
const SkBitmap& icon,
bool silent,
const bool has_reply,
const base::string16 reply_placeholder) override;
void Dismiss() override;
void NotificationDisplayed();
void NotificationReplied(const std::string reply);
NSUserNotification* notification() const { return notification_; }
private:
base::scoped_nsobject<NSUserNotification> notification_;
DISALLOW_COPY_AND_ASSIGN(CocoaNotification);
};
} // namespace brightray
#endif // BRIGHTRAY_BROWSER_MAC_COCOA_NOTIFICATION_H_
|
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef BRIGHTRAY_BROWSER_MAC_COCOA_NOTIFICATION_H_
#define BRIGHTRAY_BROWSER_MAC_COCOA_NOTIFICATION_H_
#import <Foundation/Foundation.h>
#include <string>
#include "base/mac/scoped_nsobject.h"
#include "brightray/browser/notification.h"
namespace brightray {
class CocoaNotification : public Notification {
public:
CocoaNotification(NotificationDelegate* delegate,
NotificationPresenter* presenter);
~CocoaNotification();
// Notification:
void Show(const base::string16& title,
const base::string16& msg,
const std::string& tag,
const GURL& icon_url,
const SkBitmap& icon,
bool silent,
const bool has_reply,
const base::string16& reply_placeholder) override;
void Dismiss() override;
void NotificationDisplayed();
void NotificationReplied(const std::string reply);
NSUserNotification* notification() const { return notification_; }
private:
base::scoped_nsobject<NSUserNotification> notification_;
DISALLOW_COPY_AND_ASSIGN(CocoaNotification);
};
} // namespace brightray
#endif // BRIGHTRAY_BROWSER_MAC_COCOA_NOTIFICATION_H_
|
Fix reference typed reply placeholder
|
Fix reference typed reply placeholder
|
C
|
mit
|
bpasero/electron,thomsonreuters/electron,gerhardberger/electron,the-ress/electron,thomsonreuters/electron,gerhardberger/electron,wan-qy/electron,renaesop/electron,seanchas116/electron,tonyganch/electron,electron/electron,wan-qy/electron,the-ress/electron,thomsonreuters/electron,electron/electron,gerhardberger/electron,Floato/electron,bpasero/electron,electron/electron,renaesop/electron,the-ress/electron,seanchas116/electron,gerhardberger/electron,bpasero/electron,thomsonreuters/electron,gerhardberger/electron,electron/electron,wan-qy/electron,Floato/electron,wan-qy/electron,seanchas116/electron,electron/electron,shiftkey/electron,seanchas116/electron,the-ress/electron,the-ress/electron,renaesop/electron,shiftkey/electron,wan-qy/electron,electron/electron,bpasero/electron,seanchas116/electron,bpasero/electron,tonyganch/electron,tonyganch/electron,tonyganch/electron,shiftkey/electron,shiftkey/electron,seanchas116/electron,shiftkey/electron,thomsonreuters/electron,Floato/electron,wan-qy/electron,renaesop/electron,Floato/electron,shiftkey/electron,gerhardberger/electron,Floato/electron,Floato/electron,the-ress/electron,tonyganch/electron,gerhardberger/electron,renaesop/electron,bpasero/electron,bpasero/electron,renaesop/electron,the-ress/electron,electron/electron,tonyganch/electron,thomsonreuters/electron
|
858230f4528ad2f418f97414e3a8be46865c367c
|
include/math_defs.h
|
include/math_defs.h
|
#ifndef AL_MATH_DEFS_H
#define AL_MATH_DEFS_H
#define F_PI (3.14159265358979323846f)
#define F_PI_2 (1.57079632679489661923f)
#define F_TAU (6.28318530717958647692f)
#ifndef FLT_EPSILON
#define FLT_EPSILON (1.19209290e-07f)
#endif
#define DEG2RAD(x) ((ALfloat)(x) * (F_PI/180.0f))
#define RAD2DEG(x) ((ALfloat)(x) * (180.0f/F_PI))
#endif /* AL_MATH_DEFS_H */
|
#ifndef AL_MATH_DEFS_H
#define AL_MATH_DEFS_H
#ifdef HAVE_FLOAT_H
#include <float.h>
#endif
#define F_PI (3.14159265358979323846f)
#define F_PI_2 (1.57079632679489661923f)
#define F_TAU (6.28318530717958647692f)
#ifndef FLT_EPSILON
#define FLT_EPSILON (1.19209290e-07f)
#endif
#define DEG2RAD(x) ((ALfloat)(x) * (F_PI/180.0f))
#define RAD2DEG(x) ((ALfloat)(x) * (180.0f/F_PI))
#endif /* AL_MATH_DEFS_H */
|
Include float.h if present before defining math stuff
|
Include float.h if present before defining math stuff
|
C
|
lgpl-2.1
|
aaronmjacobs/openal-soft,alexxvk/openal-soft,alexxvk/openal-soft,aaronmjacobs/openal-soft
|
43d02e8878a075f2affa41f972c0088ee93f6e8e
|
lib/haka/regexp_module.c
|
lib/haka/regexp_module.c
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <haka/error.h>
#include <haka/regexp_module.h>
struct regexp_module *regexp_module_load(const char *module_name, struct parameters *args) {
struct module *module = module_load(module_name, args);
if (module == NULL || module->type != MODULE_REGEXP) {
if (module != NULL) module_release(module);
error(L"Module %s is not of type MODULE_REGEXP", module_name);
return NULL;
}
return (struct regexp_module *)module;
}
void regexp_module_release(struct regexp_module *module)
{
module_release((struct module *)module);
}
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <haka/error.h>
#include <haka/regexp_module.h>
struct regexp_module *regexp_module_load(const char *module_name, struct parameters *args) {
struct module *module = module_load(module_name, args);
if (module == NULL || module->type != MODULE_REGEXP) {
if (module != NULL) module_release(module);
error(L"Module %s is not of type MODULE_REGEXP", module_name);
return NULL;
}
return (struct regexp_module *)module;
}
void regexp_module_release(struct regexp_module *module)
{
module_release(&module->module);
}
|
Replace cast by safer access
|
Replace cast by safer access
|
C
|
mpl-2.0
|
nabilbendafi/haka,haka-security/haka,lcheylus/haka,nabilbendafi/haka,LubyRuffy/haka,Wingless-Archangel/haka,lcheylus/haka,haka-security/haka,haka-security/haka,Wingless-Archangel/haka,nabilbendafi/haka,LubyRuffy/haka,lcheylus/haka
|
3fdc17f34aed6c08c6803dd91db59dc2971df9b6
|
add.c
|
add.c
|
#include "cx/fileb.h"
static real
sum_line (FileB* f)
{
real x = 0, y = 0;
while (load_real_FileB (f, &y))
x += y;
return x;
}
int main ()
{
DecloStack( FileB, f );
FILE* in = stdin;
FILE* out = stdout;
init_FileB (f);
f->f = in;
f->byline = true;
while (getline_FileB (f))
{
FileB olay;
real x;
olay_FileB (&olay, f);
x = sum_line (&olay);
fprintf (out, "%f\n", x);
fflush (out);
}
return 0;
}
|
#include "cx/fileb.h"
static real
sum_line (FileB* f)
{
real x = 0, y = 0;
while (load_real_FileB (f, &y))
x += y;
f->good = true;
skipds_FileB (f, 0);
if (cstr_FileB (f) [0] != '\0')
fputs ("Line is no good!\n", stderr);
return x;
}
int main ()
{
DecloStack( FileB, f );
FILE* in = stdin;
FILE* out = stdout;
init_FileB (f);
f->f = in;
f->byline = true;
while (getline_FileB (f))
{
FileB olay;
real x;
olay_FileB (&olay, f);
x = sum_line (&olay);
fprintf (out, "%f\n", x);
fflush (out);
}
return 0;
}
|
Add utility gives a warning on bad parse
|
Add utility gives a warning on bad parse
|
C
|
isc
|
grencez/lace,grencez/lace
|
57617193daeecc6ec6adf1057dbd687464558259
|
demo1/src/demo/object/itickable.h
|
demo1/src/demo/object/itickable.h
|
// itickable.h
//
// Interface definition of an object that is updated during the tick cycle.
//
#ifndef DEMO_ITICKABLE_H
#define DEMO_ITICKABLE_H
namespace demo
{
namespace obj
{
class ITickable
{
public:
// CONSTRUCTORS
~ITickable();
// MEMBER FUNCTIONS
/**
* Prepare for the next tick cycle.
*/
virtual void preTick() = 0;
/**
* Update the object.
* @param dt The elapsed time.
*/
virtual void tick( float dt ) = 0;
/**
* Clean up after the tick cycle.
*/
virtual void postTick() = 0;
};
// CONSTRUCTORS
ITickable::~ITickable()
{
}
} // End nspc obj
} // End nspc demo
#endif // DEMO_ITICKABLE_H
|
// itickable.h
//
// Interface definition of an object that is updated during the tick cycle.
//
#ifndef DEMO_ITICKABLE_H
#define DEMO_ITICKABLE_H
namespace demo
{
namespace obj
{
class ITickable
{
public:
// CONSTRUCTORS
/**
* Destruct the tickable.
*/
~ITickable();
// MEMBER FUNCTIONS
/**
* Prepare for the next tick cycle.
*/
virtual void preTick() = 0;
/**
* Update the object.
* @param dt The elapsed time in seconds.
*/
virtual void tick( float dt ) = 0;
/**
* Clean up after the tick cycle.
*/
virtual void postTick() = 0;
};
// CONSTRUCTORS
inline
ITickable::~ITickable()
{
}
} // End nspc obj
} // End nspc demo
#endif // DEMO_ITICKABLE_H
|
Clean up the tickable definition.
|
Clean up the tickable definition.
|
C
|
mit
|
invaderjon/demo,invaderjon/demo
|
040f741c3387244091f24f7232ee85485b77f1f3
|
Source/HYPScatterPlot.h
|
Source/HYPScatterPlot.h
|
@import UIKit;
@protocol HYPScatterPlotDataSource;
@class HYPScatterPoint;
@class HYPScatterLabel;
@interface HYPScatterPlot : UIView
@property (nonatomic) UIColor *averageLineColor;
@property (nonatomic) UIColor *xAxisColor;
@property (nonatomic) UIColor *yAxisMidGradient;
@property (nonatomic) UIColor *yAxisEndGradient;
@property (nonatomic, weak) id<HYPScatterPlotDataSource> dataSource;
@end
@protocol HYPScatterPlotDataSource <NSObject>
@required
- (NSArray *)scatterPointsForScatterPlot:(HYPScatterPlot *)scatterPlot;
- (HYPScatterPoint *)maximumXValue:(HYPScatterPlot *)scatterPlot;
- (HYPScatterPoint *)minimumXValue:(HYPScatterPlot *)scatterPlot;
- (HYPScatterPoint *)maximumYValue:(HYPScatterPlot *)scatterPlot;
- (HYPScatterPoint *)minimumYValue:(HYPScatterPlot *)scatterPlot;
@optional
- (CGFloat)averageYValue:(HYPScatterPlot *)scatterPlot;
- (HYPScatterLabel *)minimumYLabel:(HYPScatterPlot *)scatterPlot;
- (HYPScatterLabel *)maximumYLabel:(HYPScatterPlot *)scatterPlot;
- (HYPScatterLabel *)minimumXLabel:(HYPScatterPlot *)scatterPlot;
- (HYPScatterLabel *)maximumXLabel:(HYPScatterPlot *)scatterPlot;
- (HYPScatterLabel *)averageLabel:(HYPScatterPlot *)scatterPlot;
@end
|
@import UIKit;
@protocol HYPScatterPlotDataSource;
@class HYPScatterPoint;
@class HYPScatterLabel;
@interface HYPScatterPlot : UIView
@property (nonatomic) UIColor *averageLineColor;
@property (nonatomic) UIColor *xAxisColor;
@property (nonatomic) UIColor *yAxisMidGradient;
@property (nonatomic) UIColor *yAxisEndGradient;
@property (nonatomic, weak) id<HYPScatterPlotDataSource> dataSource;
@end
@protocol HYPScatterPlotDataSource <NSObject>
@required
/**
@return should be a list of HYPScatterPoint objects
*/
- (NSArray *)scatterPointsForScatterPlot:(HYPScatterPlot *)scatterPlot;
- (HYPScatterPoint *)maximumXValue:(HYPScatterPlot *)scatterPlot;
- (HYPScatterPoint *)minimumXValue:(HYPScatterPlot *)scatterPlot;
- (HYPScatterPoint *)maximumYValue:(HYPScatterPlot *)scatterPlot;
- (HYPScatterPoint *)minimumYValue:(HYPScatterPlot *)scatterPlot;
@optional
- (CGFloat)averageYValue:(HYPScatterPlot *)scatterPlot;
- (HYPScatterLabel *)minimumYLabel:(HYPScatterPlot *)scatterPlot;
- (HYPScatterLabel *)maximumYLabel:(HYPScatterPlot *)scatterPlot;
- (HYPScatterLabel *)minimumXLabel:(HYPScatterPlot *)scatterPlot;
- (HYPScatterLabel *)maximumXLabel:(HYPScatterPlot *)scatterPlot;
- (HYPScatterLabel *)averageLabel:(HYPScatterPlot *)scatterPlot;
@end
|
Add an important info. for scatter datasource
|
Add an important info. for scatter datasource
|
C
|
mit
|
hyperoslo/Scatter
|
79e3842130d52a70d1f134edf055612220b77bdc
|
flash_writer.h
|
flash_writer.h
|
#ifndef FLASH_WRITER_H
#define FLASH_WRITER_H
#include <stdint.h>
#include <stddef.h>
/** Unlocks the flash for programming. */
void flash_writer_unlock(void);
/** Locks the flash */
void flash_writer_lock(void);
/** Erases the flash page at given address. */
void flash_writer_page_erase(void *page);
/** Writes data to given location in flash. */
void flash_writer_page_write(void *page, uint8_t *data, size_t len);
#endif /* FLASH_WRITER_H */
|
#ifndef FLASH_WRITER_H
#define FLASH_WRITER_H
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Unlocks the flash for programming. */
void flash_writer_unlock(void);
/** Locks the flash */
void flash_writer_lock(void);
/** Erases the flash page at given address. */
void flash_writer_page_erase(void *page);
/** Writes data to given location in flash. */
void flash_writer_page_write(void *page, uint8_t *data, size_t len);
#ifdef __cplusplus
}
#endif
#endif /* FLASH_WRITER_H */
|
Add missing extern "C" statements
|
Add missing extern "C" statements
|
C
|
bsd-2-clause
|
cvra/can-bootloader,cvra/can-bootloader,cvra/can-bootloader,cvra/can-bootloader
|
d4a07988c8ba6b214e8d93c3a4048357484ba771
|
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}} expected-warning{{braces around scalar initializer}}
}
|
// 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.}}
}
void* compound_literal(int x) {
if (x)
return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}}
struct s { int z; double y; int w; };
return &((struct s){ 2, 0.4, 5 * 8 });
}
|
Improve compound literal test case.
|
Improve compound literal test case.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@58447 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
|
a9faab2fa55c45a9886d59c2367a498e8018227f
|
mainwindow.h
|
mainwindow.h
|
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_enableSizeButton_clicked();
private:
Ui::MainWindow *ui;
double **xnPlus, **xnMinus, **ynPlus, **ynMinus;
double alpha, beta, epsilon, lyambda, fi;
double tau, n;
private:
void initArrays();
void initTauComboBox();
void initQwtPlot();
double func1(double xn, double yn);
double func2(double xn);
void buildTrajectory(int numTraj);
};
#endif // MAINWINDOW_H
|
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_enableSizeButton_clicked();
private:
Ui::MainWindow *ui;
double **xnPlus, **xnMinus, **ynPlus, **ynMinus;
private:
void initArrays();
void initTauComboBox();
void initQwtPlot();
double func1(double xn, double yn);
double func2(double xn);
void buildTrajectory(int numTraj);
};
#endif // MAINWINDOW_H
|
Remove unnecessary fields in class.
|
Remove unnecessary fields in class.
|
C
|
mit
|
ivanshchitov/solving-system-ode
|
9698919d35fe7ffdc9e4e4e88de50692d115be10
|
Sources/include/HTMLNode+Private.h
|
Sources/include/HTMLNode+Private.h
|
//
// HTMLNode+Private.h
// HTMLKit
//
// Created by Iska on 20/12/15.
// Copyright © 2015 BrainCookie. All rights reserved.
//
///------------------------------------------------------
/// HTMLKit private header
///------------------------------------------------------
#import <HTMLKit/HTMLKit.h>
/**
Private HTML Node methods which are not intended for public API.
*/
@interface HTMLNode ()
/**
A read-write redeclaration of the same property in the public API.
*/
@property (nonatomic, weak) HTMLDocument *ownerDocument;
/**
A read-write redeclaration of the same property in the public API.
*/
@property (nonatomic, weak) HTMLNode *parentNode;
/**
Designated initializer of the HTML Node, which, however, should not be used directly. It is intended to be called only
by subclasses.
@abstract Use concrete subclasses of the HTML Node.
@param name The node's name.
@param type The node's type.
@return A new instance of a HTML Node.
*/
- (instancetype)initWithName:(NSString *)name type:(HTMLNodeType)type NS_DESIGNATED_INITIALIZER;
/**
Casts this node to a HTML Element. This cast should only be performed after the appropriate check.
*/
- (HTMLElement *)asElement;
/**
Returns the same string representation of the DOM tree rooted at this node that is used by html5lib-tests.
@disucssion This method is indended for testing purposes.
*/
- (NSString *)treeDescription;
@end
|
//
// HTMLNode+Private.h
// HTMLKit
//
// Created by Iska on 20/12/15.
// Copyright © 2015 BrainCookie. All rights reserved.
//
///------------------------------------------------------
/// HTMLKit private header
///------------------------------------------------------
#import "HTMLNode.h"
/**
Private HTML Node methods which are not intended for public API.
*/
@interface HTMLNode ()
/**
A read-write redeclaration of the same property in the public API.
*/
@property (nonatomic, weak) HTMLDocument *ownerDocument;
/**
A read-write redeclaration of the same property in the public API.
*/
@property (nonatomic, weak) HTMLNode *parentNode;
/**
Designated initializer of the HTML Node, which, however, should not be used directly. It is intended to be called only
by subclasses.
@abstract Use concrete subclasses of the HTML Node.
@param name The node's name.
@param type The node's type.
@return A new instance of a HTML Node.
*/
- (instancetype)initWithName:(NSString *)name type:(HTMLNodeType)type NS_DESIGNATED_INITIALIZER;
/**
Casts this node to a HTML Element. This cast should only be performed after the appropriate check.
*/
- (HTMLElement *)asElement;
/**
Returns the same string representation of the DOM tree rooted at this node that is used by html5lib-tests.
@disucssion This method is indended for testing purposes.
*/
- (NSString *)treeDescription;
@end
|
Fix import in private HTMLNode header
|
Fix import in private HTMLNode header
|
C
|
mit
|
iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit
|
5e9b10290a20a4d141e6db96a2f4b767ad5077ea
|
src/SGFeature.h
|
src/SGFeature.h
|
//
// SGFeature.h
// SimpleGeo
//
// Created by Seth Fitzsimmons on 11/14/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "SGPoint.h"
@interface SGFeature : NSObject
{
NSString* featureId;
SGPoint* geometry;
NSDictionary* properties;
NSString* rawBody;
}
@property (readonly) NSString* featureId;
@property (readonly) SGPoint* geometry;
@property (readonly) NSDictionary* properties;
@property (readonly) NSString* rawBody;
+ (SGFeature *)featureWithId:(NSString *)id;
+ (SGFeature *)featureWithId:(NSString *)id
data:(NSDictionary *)data;
+ (SGFeature *)featureWithId:(NSString *)id
data:(NSDictionary *)data
rawBody:(NSString *)rawBody;
+ (SGFeature *)featureWithData:(NSDictionary *)data;
- (id)initWithId:(NSString *)id;
- (id)initWithId:(NSString *)id
data:(NSDictionary *)data;
- (id)initWithId:(NSString *)id
data:(NSDictionary *)data
rawBody:(NSString *)rawBody;
@end
|
//
// SGFeature.h
// SimpleGeo
//
// Created by Seth Fitzsimmons on 11/14/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "SGPoint.h"
@interface SGFeature : NSObject
{
NSString* featureId;
SGPoint* geometry;
NSDictionary* properties;
NSString* rawBody;
}
@property (retain,readonly) NSString* featureId;
@property (retain,readonly) SGPoint* geometry;
@property (retain,readonly) NSDictionary* properties;
@property (retain,readonly) NSString* rawBody;
+ (SGFeature *)featureWithId:(NSString *)id;
+ (SGFeature *)featureWithId:(NSString *)id
data:(NSDictionary *)data;
+ (SGFeature *)featureWithId:(NSString *)id
data:(NSDictionary *)data
rawBody:(NSString *)rawBody;
+ (SGFeature *)featureWithData:(NSDictionary *)data;
- (id)initWithId:(NSString *)id;
- (id)initWithId:(NSString *)id
data:(NSDictionary *)data;
- (id)initWithId:(NSString *)id
data:(NSDictionary *)data
rawBody:(NSString *)rawBody;
@end
|
Revert "No reason for readonly properties to be retained"
|
Revert "No reason for readonly properties to be retained"
This reverts commit eeed3d87ea740ab73995af2de8f044e3a9a3082d.
|
C
|
bsd-3-clause
|
simplegeo/SimpleGeo.framework,simplegeo/SimpleGeo.framework,simplegeo/SimpleGeo.framework
|
c3afaa342f30aded4270e96254cf0729058e06e8
|
trie.c
|
trie.c
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <util.h>
#include "trie.h"
#define char_index(c) c - 97
trie *
trie_init(void)
{
trie *t = emalloc(sizeof(*t));
memset(t, 0, sizeof(*t));
t->children = emalloc(R_SIZE * sizeof(*(t->children)));
memset(t->children, 0, sizeof(*(t->children)));
return t;
}
void
trie_insert(trie *t, const char *key, size_t value)
{
const char *c = key;
trie *cur_node = t;
while (*c) {
if (cur_node->children[char_index(*c)] == NULL)
cur_node->children[char_index(*c)] = trie_init();
cur_node = cur_node->children[char_index(*c)];
c++;
}
cur_node->count = value;
}
size_t
trie_get(trie *t, const char *key)
{
const char *c = key;
trie *cur_node = t;
while (*c) {
if (cur_node->children[char_index(*c)] == NULL)
return 0;
cur_node = cur_node->children[char_index(*c)];
c++;
}
return cur_node->count;
}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <util.h>
#include "trie.h"
#define char_index(c) c - 97
trie *
trie_init(void)
{
trie *t = emalloc(sizeof(*t));
memset(t, 0, sizeof(*t));
t->children = ecalloc(R_SIZE, sizeof(*(t->children)));
return t;
}
void
trie_insert(trie *t, const char *key, size_t value)
{
const char *c = key;
trie *cur_node = t;
while (*c) {
if (cur_node->children[char_index(*c)] == NULL)
cur_node->children[char_index(*c)] = trie_init();
cur_node = cur_node->children[char_index(*c)];
c++;
}
cur_node->count = value;
}
size_t
trie_get(trie *t, const char *key)
{
const char *c = key;
trie *cur_node = t;
while (*c) {
if (cur_node->children[char_index(*c)] == NULL)
return 0;
cur_node = cur_node->children[char_index(*c)];
c++;
}
return cur_node->count;
}
|
Replace malloc + memset with calloc
|
Replace malloc + memset with calloc
|
C
|
bsd-2-clause
|
abhinav-upadhyay/nbspell,abhinav-upadhyay/nbspell
|
a1556864e486f61c4bf974f5a5595ee4511977b1
|
src/util/util_version.h
|
src/util/util_version.h
|
/*
* Copyright 2011-2016 Blender Foundation
*
* 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 __UTIL_VERSION_H__
#define __UTIL_VERSION_H__
/* Cycles version number */
CCL_NAMESPACE_BEGIN
#define CYCLES_VERSION_MAJOR 1
#define CYCLES_VERSION_MINOR 10
#define CYCLES_VERSION_PATCH 0
#define CYCLES_MAKE_VERSION_STRING2(a, b, c) #a "." #b "." #c
#define CYCLES_MAKE_VERSION_STRING(a, b, c) CYCLES_MAKE_VERSION_STRING2(a, b, c)
#define CYCLES_VERSION_STRING \
CYCLES_MAKE_VERSION_STRING(CYCLES_VERSION_MAJOR, CYCLES_VERSION_MINOR, CYCLES_VERSION_PATCH)
CCL_NAMESPACE_END
#endif /* __UTIL_VERSION_H__ */
|
/*
* Copyright 2011-2016 Blender Foundation
*
* 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 __UTIL_VERSION_H__
#define __UTIL_VERSION_H__
/* Cycles version number */
CCL_NAMESPACE_BEGIN
#define CYCLES_VERSION_MAJOR 1
#define CYCLES_VERSION_MINOR 11
#define CYCLES_VERSION_PATCH 0
#define CYCLES_MAKE_VERSION_STRING2(a, b, c) #a "." #b "." #c
#define CYCLES_MAKE_VERSION_STRING(a, b, c) CYCLES_MAKE_VERSION_STRING2(a, b, c)
#define CYCLES_VERSION_STRING \
CYCLES_MAKE_VERSION_STRING(CYCLES_VERSION_MAJOR, CYCLES_VERSION_MINOR, CYCLES_VERSION_PATCH)
CCL_NAMESPACE_END
#endif /* __UTIL_VERSION_H__ */
|
Bump Cycles version to 1.11.0 (Blender 2.81)
|
Bump Cycles version to 1.11.0 (Blender 2.81)
|
C
|
apache-2.0
|
tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird
|
d099ccc83b7cb2a7809708722f515c5e091293df
|
chrome/browser/cocoa/objc_zombie.h
|
chrome/browser/cocoa/objc_zombie.h
|
// Copyright (c) 2010 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_COCOA_NSOBJECT_ZOMBIE_H_
#define CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
#pragma once
#import <Foundation/Foundation.h>
// You should think twice every single time you use anything from this
// namespace.
namespace ObjcEvilDoers {
// Enable zombies. Returns NO if it fails to enable.
//
// When |zombieAllObjects| is YES, all objects inheriting from
// NSObject become zombies on -dealloc. If NO, -shouldBecomeCrZombie
// is queried to determine whether to make the object a zombie.
//
// |zombieCount| controls how many zombies to store before freeing the
// oldest. Set to 0 to free objects immediately after making them
// zombies.
BOOL ZombieEnable(BOOL zombieAllObjects, size_t zombieCount);
// Disable zombies.
void ZombieDisable();
} // namespace ObjcEvilDoers
@interface NSObject (CrZombie)
- (BOOL)shouldBecomeCrZombie;
@end
#endif // CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
|
// Copyright (c) 2010 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_COCOA_NSOBJECT_ZOMBIE_H_
#define CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
#pragma once
#import <Foundation/Foundation.h>
// You should think twice every single time you use anything from this
// namespace.
namespace ObjcEvilDoers {
// Enable zombie object debugging. This implements a variant of Apple's
// NSZombieEnabled which can help expose use-after-free errors where messages
// are sent to freed Objective-C objects in production builds.
//
// Returns NO if it fails to enable.
//
// When |zombieAllObjects| is YES, all objects inheriting from
// NSObject become zombies on -dealloc. If NO, -shouldBecomeCrZombie
// is queried to determine whether to make the object a zombie.
//
// |zombieCount| controls how many zombies to store before freeing the
// oldest. Set to 0 to free objects immediately after making them
// zombies.
BOOL ZombieEnable(BOOL zombieAllObjects, size_t zombieCount);
// Disable zombies.
void ZombieDisable();
} // namespace ObjcEvilDoers
@interface NSObject (CrZombie)
- (BOOL)shouldBecomeCrZombie;
@end
#endif // CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
|
Add link to explanation of what we mean by zombie The person triaging / debugging a zombie crash may never have heard of this before.
|
Add link to explanation of what we mean by zombie
The person triaging / debugging a zombie crash may never have heard of this before.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/3763002
git-svn-id: http://src.chromium.org/svn/trunk/src@62723 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Former-commit-id: afedf4fa79fedacfcd285d49f1c044ddd138951e
|
C
|
bsd-3-clause
|
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser
|
27b36d361060857849880209794c6f6f98457bfe
|
csapex_ros/src/ros_boot.h
|
csapex_ros/src/ros_boot.h
|
#ifndef ROS_BOOT_H
#define ROS_BOOT_H
/// PROJECT
#include <csapex/core/bootstrap_plugin.h>
#include <csapex/core/core_fwd.h>
#include <csapex/model/model_fwd.h>
#include <csapex/msg/msg_fwd.h>
#include <csapex/view/view_fwd.h>
/// SYSTEM
// clang-format off
#include <csapex/utility/suppress_warnings_start.h>
#include <pluginlib/class_loader.hpp>
#include <csapex/utility/suppress_warnings_end.h>
// clang-format on
namespace csapex
{
class RosBoot : public BootstrapPlugin
{
public:
RosBoot();
void boot(csapex::PluginLocator* locator);
private:
std::vector<std::string> valid_plugin_xml_files_;
pluginlib::ClassLoader<CorePlugin> loader_core_;
pluginlib::ClassLoader<MessageProvider> loader_msg_;
pluginlib::ClassLoader<MessageRenderer> loader_msg_renderer_;
pluginlib::ClassLoader<Node> loader_node_;
pluginlib::ClassLoader<NodeAdapterBuilder> loader_node_adapter_;
pluginlib::ClassLoader<ParameterAdapterBuilder> loader_param_adapter_;
pluginlib::ClassLoader<DragIOHandler> loader_drag_io_;
};
} // namespace csapex
#endif // ROS_BOOT_H
|
#ifndef ROS_BOOT_H
#define ROS_BOOT_H
/// PROJECT
#include <csapex/core/bootstrap_plugin.h>
#include <csapex/core/core_fwd.h>
#include <csapex/model/model_fwd.h>
#include <csapex/msg/msg_fwd.h>
#include <csapex/view/view_fwd.h>
/// SYSTEM
// clang-format off
#include <csapex/utility/suppress_warnings_start.h>
#if CLASS_LOADER_USES_HPP
#include <pluginlib/class_loader.hpp>
#else
#include <pluginlib/class_loader.h>
#endif
#include <csapex/utility/suppress_warnings_end.h>
// clang-format on
namespace csapex
{
class RosBoot : public BootstrapPlugin
{
public:
RosBoot();
void boot(csapex::PluginLocator* locator);
private:
std::vector<std::string> valid_plugin_xml_files_;
pluginlib::ClassLoader<CorePlugin> loader_core_;
pluginlib::ClassLoader<MessageProvider> loader_msg_;
pluginlib::ClassLoader<MessageRenderer> loader_msg_renderer_;
pluginlib::ClassLoader<Node> loader_node_;
pluginlib::ClassLoader<NodeAdapterBuilder> loader_node_adapter_;
pluginlib::ClassLoader<ParameterAdapterBuilder> loader_param_adapter_;
pluginlib::ClassLoader<DragIOHandler> loader_drag_io_;
};
} // namespace csapex
#endif // ROS_BOOT_H
|
Fix jade version of class_loader not containing class_loader.hpp
|
Fix jade version of class_loader not containing class_loader.hpp
|
C
|
bsd-3-clause
|
cogsys-tuebingen/csapex_core_plugins,cogsys-tuebingen/csapex_core_plugins,cogsys-tuebingen/csapex_core_plugins
|
eaaf1b668cc99633072ac6c63d2db9dee03fbef5
|
server/gwkv_ht_wrapper.h
|
server/gwkv_ht_wrapper.h
|
#ifndef GWKV_HT_WRAPPER
#define GWKV_HT_WRAPPER
#include <stdlib.h>
#include "../hashtable/hashtable.h"
/* Operations the table supports */
typedef enum {
GET,
SET
} method;
/* Defines for result codes */
#define STORED 0
#define NOT_STORED 1
#define EXISTS 2
#define NOT_FOUND 3
/* Datatype for wrapping datastore values */
struct {
method method_type,
const char* key,
size_t key_length,
const char* value,
size_t value_length
} operation;
/**
* Wrapper function to set a value in the hashtable
* Returns either STORED or NOT_STORED (defined above)
*/
int
gwkv_server_set (memcached_st *ptr,
const char *key,
size_t key_length,
const char *value,
size_t value_length);
/**
* Wrapper function to read a value from the hashtable
* Returns the data if sucessful, or NULL on error
* These correspond to the EXISTS and NOT_FOUND codes above
*/
char*
gwkv_server_get (memcached_st *ptr,
const char *key,
size_t key_length,
size_t *value_length);
#endif
|
#ifndef GWKV_HT_WRAPPER
#define GWKV_HT_WRAPPER
#include <stdlib.h>
#include "../hashtable/hashtable.h"
/* Types of hashing algorithms we support */
typedef enum {
MD5
} hash_type;
/* All encompassing datatype for server datastore */
struct {
ht* hashtable,
hash_type hash
} gwkv_server;
/* Operations the table supports */
typedef enum {
GET,
SET
} method;
/* Defines for result codes */
#define STORED 0
#define NOT_STORED 1
#define EXISTS 2
#define NOT_FOUND 3
/* Datatype for wrapping datastore values */
struct {
method method_type,
const char* key,
size_t key_length,
const char* value,
size_t value_length
} operation;
/* Initialize a new key/value datastore */
gwkv_server*
gwkv_server_init(hash_type hash_algorithm);
/**
* Wrapper function to set a value in the hashtable
* Returns either STORED or NOT_STORED (defined above)
*/
int
gwkv_server_set (memcached_st *ptr,
const char *key,
size_t key_length,
const char *value,
size_t value_length);
/**
* Wrapper function to read a value from the hashtable
* Returns the data if sucessful, or NULL on error
* These correspond to the EXISTS and NOT_FOUND codes above
*/
char*
gwkv_server_get (memcached_st *ptr,
const char *key,
size_t key_length,
size_t *value_length);
/* Frees all memory associated with the datastore */
void
gwkv_server_free(gwkv_server* server);
#endif
|
Add struct to keep datastore things
|
Add struct to keep datastore things
|
C
|
mit
|
gwAdvNet2015/gw-kv-store
|
e9a50022c0fd0f5ca60fd12c542ba9bbdfda7606
|
src/docs.h
|
src/docs.h
|
static const char *docs_usage[] = {
"usage enchive [-p|--pubkey <file>] [-s|--seckey <file>]",
#if ENCHIVE_OPTION_AGENT
" [-a|--agent[=seconds]] [-A|--no-agent]",
#endif
" [--version] [--help]",
" <command> [args]",
"",
"Commands (unique prefixes accepted):",
" keygen generate a new master keypair",
" archive archive using the public key",
" extract extract from an archive using the secret key",
" fingerprint print the master keypair fingerprint",
"",
" -p, --pubkey <file> set the public key file [~/.enchive.pub]",
" -s, --seckey <file> set the secret key file [~/.enchive.sec]",
#if ENCHIVE_OPTION_AGENT
" -a, --agent[=seconds] run key agent after reading a passphrase ["
STR(ENCHIVE_AGENT_TIMEOUT) "]",
" -A, --no-agent don't run the key agent"
# if ENCHIVE_AGENT_DEFAULT_ENABLED
"",
# else
" (default)",
# endif
#endif
" --version display version information",
" --help display this usage information",
"",
"Enchive archives files by encrypting them to yourself using your",
"public key. It uses ChaCha20, Curve25519, and HMAC-SHA256.",
0};
|
static const char *docs_usage[] = {
"usage enchive [-p|--pubkey <file>] [-s|--seckey <file>]",
#if ENCHIVE_OPTION_AGENT
" [-a|--agent[=seconds]] [-A|--no-agent]",
#endif
" [--version] [--help]",
" <command> [args]",
"",
"Commands (unique prefixes accepted):",
" keygen generate a new master keypair",
" archive archive using the public key",
" extract extract from an archive using the secret key",
" fingerprint print the master keypair fingerprint",
"",
" -p, --pubkey <file> set the public key file",
" -s, --seckey <file> set the secret key file",
#if ENCHIVE_OPTION_AGENT
" -a, --agent[=seconds] run key agent after reading a passphrase ["
STR(ENCHIVE_AGENT_TIMEOUT) "]",
" -A, --no-agent don't run the key agent"
# if ENCHIVE_AGENT_DEFAULT_ENABLED
"",
# else
" (default)",
# endif
#endif
" --version display version information",
" --help display this usage information",
"",
"Enchive archives files by encrypting them to yourself using your",
"public key. It uses ChaCha20, Curve25519, and HMAC-SHA256.",
0};
|
Remove incorrect path defaults from --help
|
Remove incorrect path defaults from --help
|
C
|
unlicense
|
skeeto/enchive
|
f969a9b919fb9765c8f955ab2c68284c41abb097
|
aes.c
|
aes.c
|
#include <stdio.h>
#include "aes.h"
static void aes_encrypt_block_openssl(const unsigned char *, unsigned char *, const AES_KEY *);
static void aes_encrypt_block_aesni(const unsigned char *, unsigned char *, const AES_KEY *);
int
use_aesni()
{
return 0;
}
void
aes_encrypt_block(const unsigned char *in, unsigned char *out, const AES_KEY *key)
{
if (use_aesni())
{
aes_encrypt_block_aesni(in, out, key);
}
else
{
aes_encrypt_block_openssl(in, out, key);
}
}
static void
aes_encrypt_block_openssl(const unsigned char *in, unsigned char *out, const AES_KEY *key)
{
AES_encrypt(in, out, key);
}
static void
aes_encrypt_block_aesni(const unsigned char *in, unsigned char *out, const AES_KEY *key)
{
AES_encrypt(in, out, key);
}
|
#include <stdio.h>
#include "aes.h"
static void aes_encrypt_block_openssl(const unsigned char *, unsigned char *, const AES_KEY *);
static void aes_encrypt_block_aesni(const unsigned char *, unsigned char *, const AES_KEY *);
int
use_aesni()
{
return 0;
}
void
aes_encrypt_block(const unsigned char *in, unsigned char *out, const AES_KEY *key)
{
static int aesni;
if (aesni == 0)
{
aesni = use_aesni();
}
if (aesni == 1)
{
aes_encrypt_block_aesni(in, out, key);
}
else
{
aes_encrypt_block_openssl(in, out, key);
}
}
static void
aes_encrypt_block_openssl(const unsigned char *in, unsigned char *out, const AES_KEY *key)
{
AES_encrypt(in, out, key);
}
static void
aes_encrypt_block_aesni(const unsigned char *in, unsigned char *out, const AES_KEY *key)
{
AES_encrypt(in, out, key);
}
|
Use a static variable to track whether to use AES-NI
|
Use a static variable to track whether to use AES-NI
|
C
|
bsd-2-clause
|
seankelly/aesni,seankelly/aesni
|
c2b83606e10756537cdbeb528815808a810460d8
|
ch1/e01-20_detab.c
|
ch1/e01-20_detab.c
|
/*
* detab: Replace tabs with blanks.
*/
#include <stdio.h>
#define MAXLINE 10000 /* Max input line length. */
#define TABSTOP 8 /* Set tab stop to eight characters. */
int getaline(char *, int);
void detab(char *);
/* detab: Replace tabs with blanks. */
int
main(void)
{
char line[MAXLINE]; /* Current input line. */
while (getaline(line, MAXLINE) > 0) {
detab(line);
printf("%s", line);
}
return 0;
}
/* getaline: Read a line into `s'; return length. */
int
getaline(char *s, int lim)
{
int c, i;
c = 0;
for (i = 0; i < lim - 1 && (c = getchar()) != EOF && c != '\n'; ++i)
s[i] = c;
if (c == '\n')
s[i++] = c;
s[i] = '\0';
return i;
}
/* detab: Replace tabs with blanks. */
void
detab(char *s)
{
int i, j;
for (i = 0; s[i] != '\0'; ++i) {
if (s[i] == '\t') {
for (j = 0; j <= (i % TABSTOP + TABSTOP); ++j)
s[i + j] = ' ';
i += j;
}
}
}
|
/*
* detab: Replace tabs with blanks.
*/
#include <stdio.h>
#define TABSIZE 8
/* detab: Replace tabs with blanks. */
int
main(void)
{
int ch, i;
for (i = 0; (ch = getchar()) != EOF; i++) {
if (ch == '\n')
i = 0;
if (ch == '\t') {
putchar(' ');
while (i % TABSIZE) {
putchar(' ');
i++;
}
} else
putchar(ch);
}
return 0;
}
|
Make detab actually work reliably.
|
Make detab actually work reliably.
|
C
|
isc
|
chettrick/tcpl
|
e4b57f3333a9da01b823a0024291c64728c688b4
|
Sources/include/HTMLText.h
|
Sources/include/HTMLText.h
|
//
// HTMLText.h
// HTMLKit
//
// Created by Iska on 26/02/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import "HTMLCharacterData.h"
NS_ASSUME_NONNULL_BEGIN
/**
A HTML Text node
*/
@interface HTMLText : HTMLCharacterData
/**
Initializes a new HTML text node.
@param data The text string.
@return A new isntance of a HTML text node.
*/
- (instancetype)initWithData:(NSString *)data;
/**
Appends the string to this text node.
@param string The string to append.
*/
- (void)appendString:(NSString *)string __attribute__((deprecated("Use the mutable data property instead.")));
@end
NS_ASSUME_NONNULL_END
|
//
// HTMLText.h
// HTMLKit
//
// Created by Iska on 26/02/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import "HTMLCharacterData.h"
NS_ASSUME_NONNULL_BEGIN
/**
A HTML Text node
*/
@interface HTMLText : HTMLCharacterData
/**
Initializes a new HTML text node.
@param data The text string.
@return A new isntance of a HTML text node.
*/
- (instancetype)initWithData:(NSString *)data;
/**
Appends the string to this text node.
@param string The string to append.
*/
- (void)appendString:(NSString *)string __attribute__((deprecated("Use `appendData:` instead.")));
@end
NS_ASSUME_NONNULL_END
|
Update deprecation message in HTML Text node
|
Update deprecation message in HTML Text node
|
C
|
mit
|
iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit
|
7283c0eb982a87ac5afe2897a78f470e078c1e24
|
cmd/smyrna/gui/topviewsettings.h
|
cmd/smyrna/gui/topviewsettings.h
|
#ifndef TOPVIEWSETTINGS_H
#define TOPVIEWSETTINGS_H
#include "smyrnadefs.h"
_BB void on_settingsOKBtn_clicked (GtkWidget *widget,gpointer user_data);
_BB void on_settingsCancelBtn_clicked (GtkWidget *widget,gpointer user_data);
int load_settings_from_graph(Agraph_t *g);
int update_graph_from_settings(Agraph_t *g);
int show_settings_form();
#endif
|
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#ifndef TOPVIEWSETTINGS_H
#define TOPVIEWSETTINGS_H
#include "smyrnadefs.h"
_BB void on_settingsOKBtn_clicked(GtkWidget * widget, gpointer user_data);
_BB void on_settingsCancelBtn_clicked(GtkWidget * widget,
gpointer user_data);
extern int load_settings_from_graph(Agraph_t * g);
extern int update_graph_from_settings(Agraph_t * g);
extern int show_settings_form();
#endif
|
Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings
|
Clean up smyrna files:
remove unnecessary globals
modify libraries not to rely on code in cmd/smyrna
remove static declarations from .h files
remove unnecessary libraries
mark unused code and clean up warnings
|
C
|
epl-1.0
|
pixelglow/graphviz,BMJHayward/graphviz,ellson/graphviz,pixelglow/graphviz,pixelglow/graphviz,kbrock/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,jho1965us/graphviz,jho1965us/graphviz,pixelglow/graphviz,ellson/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,kbrock/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,tkelman/graphviz,kbrock/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,pixelglow/graphviz,tkelman/graphviz,kbrock/graphviz,jho1965us/graphviz,ellson/graphviz,kbrock/graphviz,BMJHayward/graphviz,kbrock/graphviz,pixelglow/graphviz,jho1965us/graphviz,ellson/graphviz,MjAbuz/graphviz,ellson/graphviz,kbrock/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,ellson/graphviz,BMJHayward/graphviz,jho1965us/graphviz,pixelglow/graphviz,ellson/graphviz,tkelman/graphviz,jho1965us/graphviz,tkelman/graphviz,jho1965us/graphviz,jho1965us/graphviz,jho1965us/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,tkelman/graphviz,tkelman/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,pixelglow/graphviz,pixelglow/graphviz,MjAbuz/graphviz,jho1965us/graphviz,tkelman/graphviz,kbrock/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,tkelman/graphviz,kbrock/graphviz,tkelman/graphviz,pixelglow/graphviz,pixelglow/graphviz,MjAbuz/graphviz,MjAbuz/graphviz
|
8207e9b84e9581d286baf5869b9dcbf6351ddd50
|
nwn2mdk-lib/cgmath.h
|
nwn2mdk-lib/cgmath.h
|
#pragma once
template <typename T>
class Vector3 {
public:
T x, y, z;
Vector3(T x, T y, T z)
{
this->x = x;
this->y = y;
this->z = z;
}
};
template <typename T>
class Vector4 {
public:
T x, y, z, w;
Vector4() {}
Vector4(T x, T y, T z, T w)
{
this->x = x;
this->y = y;
this->z = z;
this->w = w;
}
T &operator[](unsigned i)
{
return (&x)[i];
}
};
|
#pragma once
template <typename T>
class Vector3 {
public:
T x, y, z;
Vector3(T x, T y, T z)
{
this->x = x;
this->y = y;
this->z = z;
}
T &operator[](unsigned i)
{
return (&x)[i];
}
};
template <typename T>
class Vector4 {
public:
T x, y, z, w;
Vector4() {}
Vector4(T x, T y, T z, T w)
{
this->x = x;
this->y = y;
this->z = z;
this->w = w;
}
T &operator[](unsigned i)
{
return (&x)[i];
}
};
|
Add subscript operator to Vector3
|
Add subscript operator to Vector3
|
C
|
apache-2.0
|
Arbos/nwn2mdk,Arbos/nwn2mdk,Arbos/nwn2mdk
|
4e74db8e51a59530d7dd2caf48694322ab4cd22b
|
src/xenia/kernel/objects/xsemaphore.h
|
src/xenia/kernel/objects/xsemaphore.h
|
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_KERNEL_XBOXKRNL_XSEMAPHORE_H_
#define XENIA_KERNEL_XBOXKRNL_XSEMAPHORE_H_
#include "xenia/kernel/xobject.h"
#include "xenia/xbox.h"
namespace xe {
namespace kernel {
struct X_SEMAPHORE {
// TODO: Make this not empty!
};
class XSemaphore : public XObject {
public:
XSemaphore(KernelState* kernel_state);
virtual ~XSemaphore();
void Initialize(int32_t initial_count, int32_t maximum_count);
void InitializeNative(void* native_ptr, X_DISPATCH_HEADER& header);
int32_t ReleaseSemaphore(int32_t release_count);
virtual void* GetWaitHandle() { return native_handle_; }
private:
HANDLE native_handle_;
};
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XBOXKRNL_XSEMAPHORE_H_
|
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_KERNEL_XBOXKRNL_XSEMAPHORE_H_
#define XENIA_KERNEL_XBOXKRNL_XSEMAPHORE_H_
#include "xenia/kernel/xobject.h"
#include "xenia/xbox.h"
namespace xe {
namespace kernel {
struct X_SEMAPHORE {
X_DISPATCH_HEADER header;
// TODO: Make this not empty!
};
class XSemaphore : public XObject {
public:
XSemaphore(KernelState* kernel_state);
virtual ~XSemaphore();
void Initialize(int32_t initial_count, int32_t maximum_count);
void InitializeNative(void* native_ptr, X_DISPATCH_HEADER& header);
int32_t ReleaseSemaphore(int32_t release_count);
virtual void* GetWaitHandle() { return native_handle_; }
private:
HANDLE native_handle_;
};
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XBOXKRNL_XSEMAPHORE_H_
|
Add the dispatch header to X_SEMAPHORE
|
Add the dispatch header to X_SEMAPHORE
|
C
|
bsd-3-clause
|
greg100795/xenia,KitoHo/xenia,TRex22/xenia,bowlofstew/xenia,DaTrollMon/xenia,no1dead/xenia,DaTrollMon/xenia,Rhodan81/xenia,TRex22/xenia,toxic88/xenia,KitoHo/xenia,herman-rogers/xenia,TingPing/xenia,pwz3n0/xenia,AbaiQi/xenia,MorganBauer/xenia,Drooids/xenia,no1dead/xenia,TRex22/xenia,AbaiQi/xenia,Rhodan81/xenia,no1dead/xenia,MorganBauer/xenia,pwz3n0/xenia,galek/xenia,pwz3n0/xenia,sephiroth99/xenia,ObsidianGuardian/xenia,toxic88/xenia,Rhodan81/xenia,wrren/xenia,MorganBauer/xenia,Rhodan81/xenia,TingPing/xenia,toxic88/xenia,galek/xenia,ObsidianGuardian/xenia,no1dead/xenia,bowlofstew/xenia,bradparks/xenia__xbox_emulator,Drooids/xenia,greg100795/xenia,bradparks/xenia__xbox_emulator,bowlofstew/xenia,AbaiQi/xenia,toxic88/xenia,galek/xenia,TingPing/xenia,Drooids/xenia,sabretooth/xenia,TingPing/xenia,galek/xenia,sephiroth99/xenia,maxton/xenia,greg100795/xenia,bradparks/xenia__xbox_emulator,DaTrollMon/xenia,AbaiQi/xenia,Drooids/xenia,KitoHo/xenia,sabretooth/xenia,wrren/xenia,sephiroth99/xenia,wrren/xenia,bowlofstew/xenia,KitoHo/xenia,bradparks/xenia__xbox_emulator,herman-rogers/xenia,pwz3n0/xenia,maxton/xenia,herman-rogers/xenia,maxton/xenia,MorganBauer/xenia,sabretooth/xenia,ObsidianGuardian/xenia,greg100795/xenia,herman-rogers/xenia,wrren/xenia,DaTrollMon/xenia
|
ad34178a661c3ff2f0d3caa387b291fb72c49743
|
src/cpu/register.h
|
src/cpu/register.h
|
#pragma once
#include "../definitions.h"
class ByteRegister {
public:
ByteRegister() {};
void set(const u8 new_value) { val = new_value; };
u8 value() const { return val; };
void increment() { val += 1; };
void decrement() { val -= 1; };
private:
u8 val;
};
class WordRegister {
public:
WordRegister() {};
void set(const u16 new_value) { val = new_value; };
u16 value() const { return val; };
u8 low() const;
u8 high() const;
void increment() { val += 1; };
void decrement() { val -= 1; };
private:
u16 val;
};
class RegisterPair {
public:
RegisterPair(ByteRegister& high, ByteRegister& low);
void set_low(const u8 byte);
void set_high(const u8 byte);
void set_low(const ByteRegister& byte);
void set_high(const ByteRegister& byte);
void set(const u16 word);
u8 low() const;
u8 high() const;
u16 value() const;
void increment();
void decrement();
private:
ByteRegister& low_byte;
ByteRegister& high_byte;
};
class Offset {
public:
Offset(u8 val) : val(val) {};
Offset(ByteRegister& reg) : val(reg.value()) {};
u8 value() { return val; }
private:
u8 val;
};
|
#pragma once
#include "../definitions.h"
class ByteRegister {
public:
ByteRegister() {}
void set(const u8 new_value) { val = new_value; }
u8 value() const { return val; }
void increment() { val += 1; }
void decrement() { val -= 1; }
private:
u8 val;
};
class WordRegister {
public:
WordRegister() {}
void set(const u16 new_value) { val = new_value; }
u16 value() const { return val; }
u8 low() const;
u8 high() const;
void increment() { val += 1; }
void decrement() { val -= 1; }
private:
u16 val;
};
class RegisterPair {
public:
RegisterPair(ByteRegister& high, ByteRegister& low);
void set_low(const u8 byte);
void set_high(const u8 byte);
void set_low(const ByteRegister& byte);
void set_high(const ByteRegister& byte);
void set(const u16 word);
u8 low() const;
u8 high() const;
u16 value() const;
void increment();
void decrement();
private:
ByteRegister& low_byte;
ByteRegister& high_byte;
};
class Offset {
public:
Offset(u8 val) : val(val) {}
Offset(ByteRegister& reg) : val(reg.value()) {}
u8 value() { return val; }
private:
u8 val;
};
|
Remove unnecessary semicolon after method definitions
|
Remove unnecessary semicolon after method definitions
|
C
|
bsd-3-clause
|
jgilchrist/emulator,jgilchrist/emulator,jgilchrist/emulator
|
086ad04698d337ba3b4505b320e97eb1c4360e84
|
tests/sarray_tests.c
|
tests/sarray_tests.c
|
#include "minunit.h"
#include <lcthw/sarray.h>
char *test_create_destroy()
{
char test[] = "abracadabra";
char test2[] = "acadabra";
SuffixArray *sarry = SuffixArray_create(test, sizeof(test));
mu_assert(sarry, "Failed to create.");
int at = SuffixArray_find_suffix(sarry, test2, sizeof(test2));
mu_assert(at != -1, "Failed to find the suffix.");
at = SuffixArray_find_suffix(sarry, "yo", sizeof("yo"));
mu_assert(at == -1, "Should fail to find yo.");
SuffixArray_destroy(sarry);
return NULL;
}
char *all_tests() {
mu_suite_start();
mu_run_test(test_create_destroy);
return NULL;
}
RUN_TESTS(all_tests);
|
#include "minunit.h"
#include <lcthw/sarray.h>
static SuffixArray *sarry = NULL;
static char test[] = "abracadabra";
static char test2[] = "acadabra";
char *test_create()
{
sarry = SuffixArray_create(test, sizeof(test));
mu_assert(sarry, "Failed to create.");
return NULL;
}
char *test_destroy()
{
SuffixArray_destroy(sarry);
return NULL;
}
char *test_find_suffix()
{
int at = SuffixArray_find_suffix(sarry, test2, sizeof(test2));
mu_assert(at != -1, "Failed to find the suffix.");
at = SuffixArray_find_suffix(sarry, "yo", sizeof("yo"));
mu_assert(at == -1, "Should fail to find yo.");
return NULL;
}
char *all_tests() {
mu_suite_start();
mu_run_test(test_create);
mu_run_test(test_find_suffix);
mu_run_test(test_destroy);
return NULL;
}
RUN_TESTS(all_tests);
|
Clean up suffix array tests.
|
Clean up suffix array tests.
|
C
|
bsd-3-clause
|
HappyYang/liblcthw,HappyYang/liblcthw,HappyYang/liblcthw
|
96de597b3c9491bb257526cb7ed817238c88916a
|
string_hash.h
|
string_hash.h
|
#include <string.h>
#include <stdint.h>
/**
* Efficient string hash function.
*/
static uint32_t string_hash(const char *str)
{
uint32_t hash = 0;
int32_t c;
while ((c = *str++))
{
hash = c + (hash << 6) + (hash << 16) - hash;
}
return hash;
}
/**
* Test two strings for equality.
*/
static int string_compare(const char *str1, const char *str2)
{
if (str1 == str2)
{
return 1;
}
if (str2 == NULL)
{
return 0;
}
return strcmp(str1, str2) == 0;
}
|
#include <string.h>
#include <stdint.h>
/**
* Efficient string hash function.
*/
__attribute__((unused))
static uint32_t string_hash(const char *str)
{
uint32_t hash = 0;
int32_t c;
while ((c = *str++))
{
hash = c + (hash << 6) + (hash << 16) - hash;
}
return hash;
}
/**
* Test two strings for equality.
*/
__attribute__((unused))
static int string_compare(const char *str1, const char *str2)
{
if (str1 == str2)
{
return 1;
}
if (str2 == NULL)
{
return 0;
}
return strcmp(str1, str2) == 0;
}
|
Mark string functions unused, in case the header is included in files that only use one of them.
|
Mark string functions unused, in case the header is included in files that only use one of them.
|
C
|
mit
|
darlinghq/darling-libobjc2,davidchisnall/libobjc2,ngrewe/libobjc2,crystax/android-vendor-libobjc2,gnustep/libobjc2,davidchisnall/libobjc2,gnustep/libobjc2,crystax/android-vendor-libobjc2,darlinghq/darling-libobjc2,ngrewe/libobjc2
|
d57f4614642ddd22e03f184f5fb430c42f2c4f68
|
dev/pci/drm/r600_blit_shaders.h
|
dev/pci/drm/r600_blit_shaders.h
|
#ifndef R600_BLIT_SHADERS_H
#define R600_BLIT_SHADERS_H
extern const u32 r6xx_ps[];
extern const u32 r6xx_vs[];
extern const u32 r7xx_default_state[];
extern const u32 r6xx_default_state[];
extern const u32 r6xx_ps_size, r6xx_vs_size;
extern const u32 r6xx_default_size, r7xx_default_size;
#endif
|
/*
* Copyright 2009 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Alex Deucher <alexander.deucher@amd.com>
*/
#ifndef R600_BLIT_SHADERS_H
#define R600_BLIT_SHADERS_H
extern const u32 r6xx_ps[];
extern const u32 r6xx_vs[];
extern const u32 r7xx_default_state[];
extern const u32 r6xx_default_state[];
extern const u32 r6xx_ps_size, r6xx_vs_size;
extern const u32 r6xx_default_size, r7xx_default_size;
#endif
|
Add missing license (amd, mit/x11)
|
Add missing license (amd, mit/x11)
armani@ noticed that is was missing.
|
C
|
isc
|
orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars
|
afa170f2cfa7e84e99559d0f1b3ceafec9c75de0
|
test/Driver/unknown-arg.c
|
test/Driver/unknown-arg.c
|
// RUN: not %clang_cc1 %s -cake-is-lie -%0 -%d 2> %t.log
// RUN: FileCheck %s -input-file=%t.log
// CHECK: unknown argument
// CHECK: unknown argument
// CHECK: unknown argument
|
// RUN: not %clang_cc1 %s -cake-is-lie -%0 -%d 2> %t.log
// RUN: FileCheck %s -input-file=%t.log
// CHECK: unknown argument
// CHECK: unknown argument
// CHECK: unknown argument
// RUN: %clang -S %s -o %t.s -funknown-to-clang-option -Wunknown-to-clang-option -munknown-to-clang-optio
// IGNORED: warning: argument unused during compilation: '-funknown-to-clang-option'
// IGNORED: warning: argument unused during compilation: '-munknown-to-clang-option'
// IGNORED: warning: unknown warning option '-Wunknown-to-clang-option'
|
Add tests on how clang currently handles some unknown options.
|
Add tests on how clang currently handles some unknown options.
This is not to say this is the desired behavior, but it makes sure we notice
if it changes.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@191242 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
|
621cbbae5dc02cf57527b5a6b67f06b5224536af
|
templates/template.h
|
templates/template.h
|
/*
* %FFILE%
* Copyright (C) %YEAR% %USER% <%MAIL%>
*
* Distributed under terms of the %LICENSE% license.
*/
#ifndef __%GUARD%__
#define __%GUARD%__
%HERE%
#endif /* !__%GUARD%__ */
|
/*
* %FFILE%
* Copyright (C) %YEAR% %USER% <%MAIL%>
*
* Distributed under terms of the %LICENSE% license.
*/
#ifndef %GUARD%
#define %GUARD%
%HERE%
#endif /* !%GUARD% */
|
Remove underscores from header guard
|
Remove underscores from header guard
|
C
|
bsd-2-clause
|
lmtim/dotfile,JohnHwee/dotfile,hacpai/dotfile,lmtim/dotfile,henry-zhuang/dotfile
|
04d6348536a393439c36a7433c4fbf89c52ded32
|
src/qt/clientmodel.h
|
src/qt/clientmodel.h
|
#ifndef CLIENTMODEL_H
#define CLIENTMODEL_H
#include <QObject>
class OptionsModel;
class AddressTableModel;
class TransactionTableModel;
class CWallet;
QT_BEGIN_NAMESPACE
class QDateTime;
QT_END_NAMESPACE
// Interface to Bitcoin network client
class ClientModel : public QObject
{
Q_OBJECT
public:
// The only reason that this constructor takes a wallet is because
// the global client settings are stored in the main wallet.
explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0);
OptionsModel *getOptionsModel();
int getNumConnections() const;
int getNumBlocks() const;
QDateTime getLastBlockDate() const;
// Return true if client connected to testnet
bool isTestNet() const;
// Return true if core is doing initial block download
bool inInitialBlockDownload() const;
// Return conservative estimate of total number of blocks, or 0 if unknown
int getTotalBlocksEstimate() const;
QString formatFullVersion() const;
private:
OptionsModel *optionsModel;
int cachedNumConnections;
int cachedNumBlocks;
signals:
void numConnectionsChanged(int count);
void numBlocksChanged(int count);
// Asynchronous error notification
void error(const QString &title, const QString &message);
public slots:
private slots:
void update();
};
#endif // CLIENTMODEL_H
|
#ifndef CLIENTMODEL_H
#define CLIENTMODEL_H
#include <QObject>
class OptionsModel;
class AddressTableModel;
class TransactionTableModel;
class CWallet;
QT_BEGIN_NAMESPACE
class QDateTime;
QT_END_NAMESPACE
// Interface to Bitcoin network client
class ClientModel : public QObject
{
Q_OBJECT
public:
explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0);
OptionsModel *getOptionsModel();
int getNumConnections() const;
int getNumBlocks() const;
QDateTime getLastBlockDate() const;
// Return true if client connected to testnet
bool isTestNet() const;
// Return true if core is doing initial block download
bool inInitialBlockDownload() const;
// Return conservative estimate of total number of blocks, or 0 if unknown
int getTotalBlocksEstimate() const;
QString formatFullVersion() const;
private:
OptionsModel *optionsModel;
int cachedNumConnections;
int cachedNumBlocks;
signals:
void numConnectionsChanged(int count);
void numBlocksChanged(int count);
// Asynchronous error notification
void error(const QString &title, const QString &message);
public slots:
private slots:
void update();
};
#endif // CLIENTMODEL_H
|
Remove no longer valid comment
|
Remove no longer valid comment
|
C
|
mit
|
MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin
|
0a39c49f370780025da6bf828bf66c1c1ab25131
|
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;
};
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();
double getModule() const;
void print() const;
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
|
#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();
double getModule() const;
void print() const;
const Point3D& getPoint() const;
Vector3D copy() const;
void multiplyByScalar(const double);
void normalize();
};
namespace VectorsManip {
Vector3D add(Vector3D&, Vector3D&);
Vector3D substract(Vector3D&, Vector3D&);
Vector3D vectorMultiply(Vector3D&, Vector3D&) ;
double scalarMultiply(Vector3D&, Vector3D&);
double sin(Vector3D&, Vector3D&);
double cos(Vector3D&, Vector3D&);
double angle(Vector3D&, Vector3D&);
}
}
#endif // VECTOR_3D_H
|
Move static methods outside of class
|
Move static methods outside of class
|
C
|
mit
|
reeFridge/learn-oop-through-cpp
|
71601dd2f566d712033352dc6dc6595374e74434
|
src/util/util_time.h
|
src/util/util_time.h
|
/*
* Copyright 2011-2013 Blender Foundation
*
* 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 __UTIL_TIME_H__
#define __UTIL_TIME_H__
CCL_NAMESPACE_BEGIN
/* Give current time in seconds in double precision, with good accuracy. */
double time_dt();
/* Sleep for the specified number of seconds */
void time_sleep(double t);
class scoped_timer {
public:
explicit scoped_timer(double *value = NULL) : value_(value)
{
time_start_ = time_dt();
}
~scoped_timer()
{
if(value_ != NULL) {
*value_ = time_dt() - time_start_;
}
}
double get_start() const
{
return time_start_;
}
protected:
double *value_;
double time_start_;
};
CCL_NAMESPACE_END
#endif
|
/*
* Copyright 2011-2013 Blender Foundation
*
* 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 __UTIL_TIME_H__
#define __UTIL_TIME_H__
CCL_NAMESPACE_BEGIN
/* Give current time in seconds in double precision, with good accuracy. */
double time_dt();
/* Sleep for the specified number of seconds */
void time_sleep(double t);
class scoped_timer {
public:
explicit scoped_timer(double *value = NULL) : value_(value)
{
time_start_ = time_dt();
}
~scoped_timer()
{
if(value_ != NULL) {
*value_ = get_time();
}
}
double get_start() const
{
return time_start_;
}
double get_time() const
{
return time_dt() - time_start_;
}
protected:
double *value_;
double time_start_;
};
CCL_NAMESPACE_END
#endif
|
Add utility function to query current value of scoped timer
|
Add utility function to query current value of scoped timer
|
C
|
apache-2.0
|
tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird
|
ea567d2fad625aaa5163beb543ab5a1084103dab
|
src/include/tcop/variable.h
|
src/include/tcop/variable.h
|
/*
* Headers for handling of 'SET var TO', 'SHOW var' and 'RESET var'
* statements
*
* $Id: variable.h,v 1.6 1997/09/08 02:39:21 momjian Exp $
*
*/
enum DateFormat
{
Date_Postgres, Date_SQL, Date_ISO
};
/*-----------------------------------------------------------------------*/
struct PGVariables
{
struct
{
bool euro;
enum DateFormat format;
} date;
};
extern struct PGVariables PGVariables;
/*-----------------------------------------------------------------------*/
bool SetPGVariable(const char *, const char *);
bool GetPGVariable(const char *);
bool ResetPGVariable(const char *);
|
/*
* Headers for handling of 'SET var TO', 'SHOW var' and 'RESET var'
* statements
*
* $Id: variable.h,v 1.7 1997/11/07 06:45:16 thomas Exp $
*
*/
#ifndef VARIABLE_H
#define VARIABLE_H 1
enum DateFormat
{
Date_Postgres, Date_SQL, Date_ISO
};
/*-----------------------------------------------------------------------*/
struct PGVariables
{
struct
{
bool euro;
enum DateFormat format;
} date;
};
extern struct PGVariables PGVariables;
/*-----------------------------------------------------------------------*/
bool SetPGVariable(const char *, const char *);
bool GetPGVariable(const char *);
bool ResetPGVariable(const char *);
extern bool set_date(void);
extern bool show_date(void);
extern bool reset_date(void);
extern bool parse_date(const char *);
extern bool set_timezone(void);
extern bool show_timezone(void);
extern bool reset_timezone(void);
extern bool parse_timezone(const char *);
extern bool set_cost_heap(void);
extern bool show_cost_heap(void);
extern bool reset_cost_heap(void);
extern bool parse_cost_heap(const char *);
extern bool set_cost_index(void);
extern bool show_cost_index(void);
extern bool reset_cost_index(void);
extern bool parse_cost_index(const char *);
extern bool set_r_plans(void);
extern bool show_r_plans(void);
extern bool reset_r_plans(void);
extern bool parse_r_plans(const char *);
extern bool set_geqo(void);
extern bool show_geqo(void);
extern bool reset_geqo(void);
extern bool parse_geqo(const char *);
#endif /* VARIABLE_H */
|
Declare routines which support SET keyword = value SQL commands.
|
Declare routines which support SET keyword = value SQL commands.
|
C
|
apache-2.0
|
kaknikhil/gpdb,tangp3/gpdb,jmcatamney/gpdb,lpetrov-pivotal/gpdb,lisakowen/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,edespino/gpdb,adam8157/gpdb,edespino/gpdb,janebeckman/gpdb,cjcjameson/gpdb,ahachete/gpdb,chrishajas/gpdb,ashwinstar/gpdb,CraigHarris/gpdb,rubikloud/gpdb,chrishajas/gpdb,foyzur/gpdb,Postgres-XL/Postgres-XL,50wu/gpdb,Quikling/gpdb,kmjungersen/PostgresXL,royc1/gpdb,foyzur/gpdb,edespino/gpdb,pavanvd/postgres-xl,cjcjameson/gpdb,snaga/postgres-xl,ahachete/gpdb,atris/gpdb,Chibin/gpdb,xinzweb/gpdb,0x0FFF/gpdb,edespino/gpdb,Quikling/gpdb,adam8157/gpdb,tangp3/gpdb,xuegang/gpdb,50wu/gpdb,royc1/gpdb,snaga/postgres-xl,0x0FFF/gpdb,chrishajas/gpdb,adam8157/gpdb,Chibin/gpdb,tangp3/gpdb,pavanvd/postgres-xl,xuegang/gpdb,cjcjameson/gpdb,50wu/gpdb,greenplum-db/gpdb,atris/gpdb,rvs/gpdb,Quikling/gpdb,arcivanov/postgres-xl,Quikling/gpdb,janebeckman/gpdb,foyzur/gpdb,randomtask1155/gpdb,kaknikhil/gpdb,50wu/gpdb,tpostgres-projects/tPostgres,yuanzhao/gpdb,kaknikhil/gpdb,ovr/postgres-xl,lintzc/gpdb,yuanzhao/gpdb,atris/gpdb,Chibin/gpdb,ashwinstar/gpdb,CraigHarris/gpdb,edespino/gpdb,arcivanov/postgres-xl,chrishajas/gpdb,ashwinstar/gpdb,Postgres-XL/Postgres-XL,janebeckman/gpdb,rubikloud/gpdb,atris/gpdb,xuegang/gpdb,rvs/gpdb,rubikloud/gpdb,kaknikhil/gpdb,rvs/gpdb,kmjungersen/PostgresXL,chrishajas/gpdb,zaksoup/gpdb,tangp3/gpdb,jmcatamney/gpdb,Chibin/gpdb,atris/gpdb,0x0FFF/gpdb,janebeckman/gpdb,foyzur/gpdb,zaksoup/gpdb,edespino/gpdb,royc1/gpdb,yuanzhao/gpdb,zeroae/postgres-xl,xinzweb/gpdb,edespino/gpdb,atris/gpdb,foyzur/gpdb,janebeckman/gpdb,Chibin/gpdb,greenplum-db/gpdb,yazun/postgres-xl,xinzweb/gpdb,zeroae/postgres-xl,xinzweb/gpdb,zaksoup/gpdb,tangp3/gpdb,postmind-net/postgres-xl,jmcatamney/gpdb,Quikling/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,chrishajas/gpdb,lintzc/gpdb,Postgres-XL/Postgres-XL,Postgres-XL/Postgres-XL,xuegang/gpdb,lisakowen/gpdb,ashwinstar/gpdb,zeroae/postgres-xl,cjcjameson/gpdb,rvs/gpdb,yuanzhao/gpdb,techdragon/Postgres-XL,zaksoup/gpdb,randomtask1155/gpdb,chrishajas/gpdb,Chibin/gpdb,postmind-net/postgres-xl,rvs/gpdb,zeroae/postgres-xl,lisakowen/gpdb,yazun/postgres-xl,lisakowen/gpdb,CraigHarris/gpdb,Quikling/gpdb,CraigHarris/gpdb,janebeckman/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,techdragon/Postgres-XL,xuegang/gpdb,lpetrov-pivotal/gpdb,postmind-net/postgres-xl,snaga/postgres-xl,jmcatamney/gpdb,rubikloud/gpdb,CraigHarris/gpdb,Quikling/gpdb,ashwinstar/gpdb,xinzweb/gpdb,rubikloud/gpdb,zaksoup/gpdb,oberstet/postgres-xl,zaksoup/gpdb,techdragon/Postgres-XL,postmind-net/postgres-xl,greenplum-db/gpdb,cjcjameson/gpdb,edespino/gpdb,ovr/postgres-xl,rvs/gpdb,yazun/postgres-xl,cjcjameson/gpdb,yazun/postgres-xl,xuegang/gpdb,xinzweb/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,rubikloud/gpdb,Quikling/gpdb,royc1/gpdb,techdragon/Postgres-XL,xuegang/gpdb,lintzc/gpdb,lintzc/gpdb,Chibin/gpdb,randomtask1155/gpdb,randomtask1155/gpdb,kmjungersen/PostgresXL,zaksoup/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,rvs/gpdb,oberstet/postgres-xl,lintzc/gpdb,pavanvd/postgres-xl,kaknikhil/gpdb,jmcatamney/gpdb,edespino/gpdb,royc1/gpdb,rvs/gpdb,lisakowen/gpdb,ahachete/gpdb,royc1/gpdb,ashwinstar/gpdb,foyzur/gpdb,arcivanov/postgres-xl,greenplum-db/gpdb,kmjungersen/PostgresXL,cjcjameson/gpdb,ovr/postgres-xl,lisakowen/gpdb,arcivanov/postgres-xl,pavanvd/postgres-xl,tpostgres-projects/tPostgres,greenplum-db/gpdb,lpetrov-pivotal/gpdb,royc1/gpdb,xuegang/gpdb,lintzc/gpdb,janebeckman/gpdb,snaga/postgres-xl,royc1/gpdb,atris/gpdb,50wu/gpdb,randomtask1155/gpdb,0x0FFF/gpdb,arcivanov/postgres-xl,ovr/postgres-xl,lintzc/gpdb,kaknikhil/gpdb,postmind-net/postgres-xl,janebeckman/gpdb,adam8157/gpdb,ahachete/gpdb,Quikling/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,foyzur/gpdb,lpetrov-pivotal/gpdb,ashwinstar/gpdb,randomtask1155/gpdb,pavanvd/postgres-xl,kaknikhil/gpdb,kmjungersen/PostgresXL,Quikling/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,chrishajas/gpdb,zaksoup/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,janebeckman/gpdb,Chibin/gpdb,zeroae/postgres-xl,yazun/postgres-xl,greenplum-db/gpdb,janebeckman/gpdb,Chibin/gpdb,Postgres-XL/Postgres-XL,snaga/postgres-xl,0x0FFF/gpdb,ahachete/gpdb,tpostgres-projects/tPostgres,tangp3/gpdb,lpetrov-pivotal/gpdb,lpetrov-pivotal/gpdb,edespino/gpdb,adam8157/gpdb,tangp3/gpdb,CraigHarris/gpdb,foyzur/gpdb,50wu/gpdb,lintzc/gpdb,randomtask1155/gpdb,lisakowen/gpdb,adam8157/gpdb,lintzc/gpdb,lpetrov-pivotal/gpdb,CraigHarris/gpdb,techdragon/Postgres-XL,0x0FFF/gpdb,ahachete/gpdb,ovr/postgres-xl,ahachete/gpdb,rubikloud/gpdb,tpostgres-projects/tPostgres,50wu/gpdb,oberstet/postgres-xl,xinzweb/gpdb,kaknikhil/gpdb,oberstet/postgres-xl,rvs/gpdb,xuegang/gpdb,rvs/gpdb,Chibin/gpdb,50wu/gpdb,ahachete/gpdb,oberstet/postgres-xl,rubikloud/gpdb,ashwinstar/gpdb,lisakowen/gpdb,adam8157/gpdb,atris/gpdb,jmcatamney/gpdb,lpetrov-pivotal/gpdb,tangp3/gpdb,adam8157/gpdb,randomtask1155/gpdb,0x0FFF/gpdb,tpostgres-projects/tPostgres,arcivanov/postgres-xl,kaknikhil/gpdb,xinzweb/gpdb
|
748043fe0214c54be16fadc8fa9b2f50cadfa602
|
libc/signal/sigsetops.c
|
libc/signal/sigsetops.c
|
/* Define the real-function versions of all inline functions
defined in signal.h (or bits/sigset.h). */
#include <features.h>
#define _EXTERN_INLINE
#ifndef __USE_EXTERN_INLINES
# define __USE_EXTERN_INLINES 1
#endif
#include "signal.h"
|
/* Define the real-function versions of all inline functions
defined in signal.h (or bits/sigset.h). */
#include <features.h>
#define _EXTERN_INLINE
#ifndef __USE_EXTERN_INLINES
# define __USE_EXTERN_INLINES 1
#endif
#include <signal.h>
|
Use <> instead of \"\"
|
Use <> instead of \"\"
|
C
|
lgpl-2.1
|
joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc
|
79ac2da646ed6285fc64d6c9e7ba13f1f237be0d
|
test/CodeGen/pr9614.c
|
test/CodeGen/pr9614.c
|
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
extern void foo_alias (void) __asm ("foo");
inline void foo (void) {
return foo_alias ();
}
extern void bar_alias (void) __asm ("bar");
inline __attribute__ ((__always_inline__)) void bar (void) {
return bar_alias ();
}
extern char *strrchr_foo (const char *__s, int __c) __asm ("strrchr");
extern inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strrchr_foo (const char *__s, int __c) {
return __builtin_strrchr (__s, __c);
}
void f(void) {
foo();
bar();
strrchr_foo("", '.');
}
// CHECK: define void @f()
// CHECK: call void @foo()
// CHECK-NEXT: call void @bar()
// CHECK-NEXT: call i8* @strrchr(
// CHECK-NEXT: ret void
// CHECK: declare void @foo()
// CHECK: declare void @bar()
// CHECK: declare i8* @strrchr(i8*, i32)
|
// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s
extern void foo_alias (void) __asm ("foo");
inline void foo (void) {
return foo_alias ();
}
extern void bar_alias (void) __asm ("bar");
inline __attribute__ ((__always_inline__)) void bar (void) {
return bar_alias ();
}
extern char *strrchr_foo (const char *__s, int __c) __asm ("strrchr");
extern inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strrchr_foo (const char *__s, int __c) {
return __builtin_strrchr (__s, __c);
}
void f(void) {
foo();
bar();
strrchr_foo("", '.');
}
// CHECK: define void @f()
// CHECK: call void @foo()
// CHECK-NEXT: call void @bar()
// CHECK-NEXT: call i8* @strrchr(
// CHECK-NEXT: ret void
// CHECK: declare void @foo()
// CHECK: declare void @bar()
// CHECK: declare i8* @strrchr(i8*, i32)
|
Add a triple to the test.
|
Add a triple to the test.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@146871 91177308-0d34-0410-b5e6-96231b3b80d8
|
C
|
apache-2.0
|
apple/swift-clang,apple/swift-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,llvm-mirror/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,llvm-mirror/clang
|
8993b1ede652b3c81b1cae873a00716b3dd8545d
|
include/ipv4.h
|
include/ipv4.h
|
#ifndef IPV4_H
#define IPV4_H
#include "syshead.h"
#include "netdev.h"
#define IPV4 0x04
#define ICMPV4 0x01
struct iphdr {
uint8_t version : 4;
uint8_t ihl : 4;
uint8_t tos;
uint16_t len;
uint16_t id;
uint16_t flags : 3;
uint16_t frag_offset : 13;
uint8_t ttl;
uint8_t proto;
uint16_t csum;
uint32_t saddr;
uint32_t daddr;
} __attribute__((packed));
void ipv4_incoming(struct netdev *netdev, struct eth_hdr *hdr);
#endif
|
#ifndef IPV4_H
#define IPV4_H
#include "syshead.h"
#include "netdev.h"
#define IPV4 0x04
#define ICMPV4 0x01
struct iphdr {
uint8_t ihl : 4; /* TODO: Support Big Endian hosts */
uint8_t version : 4;
uint8_t tos;
uint16_t len;
uint16_t id;
uint16_t flags : 3;
uint16_t frag_offset : 13;
uint8_t ttl;
uint8_t proto;
uint16_t csum;
uint32_t saddr;
uint32_t daddr;
} __attribute__((packed));
void ipv4_incoming(struct netdev *netdev, struct eth_hdr *hdr);
#endif
|
Swap fields in IPv4 header because of little endianness
|
Swap fields in IPv4 header because of little endianness
This should be handled more gracefully. Now, little endian byte order
is assumed.
|
C
|
mit
|
saminiir/level-ip,saminiir/level-ip
|
1e072dd1f87c672e871185d87b08ade975d2ebea
|
src/plugins/zlib/istream-bzlib.c
|
src/plugins/zlib/istream-bzlib.c
|
/* Copyright (c) 2005-2008 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream-internal.h"
#include "istream-zlib.h"
#ifdef HAVE_BZLIB
#include <bzlib.h>
#define BZLIB_INCLUDE
#define gzFile BZFILE
#define gzdopen BZ2_bzdopen
#define gzclose BZ2_bzclose
#define gzread BZ2_bzread
#define gzseek BZ2_bzseek
#define i_stream_create_zlib i_stream_create_bzlib
#include "istream-zlib.c"
#endif
|
/* Copyright (c) 2005-2008 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream-internal.h"
#include "istream-zlib.h"
#ifdef HAVE_BZLIB
#include <stdio.h>
#include <bzlib.h>
#define BZLIB_INCLUDE
#define gzFile BZFILE
#define gzdopen BZ2_bzdopen
#define gzclose BZ2_bzclose
#define gzread BZ2_bzread
#define gzseek BZ2_bzseek
#define i_stream_create_zlib i_stream_create_bzlib
#include "istream-zlib.c"
#endif
|
Include stdio.h in case bzlib.h needs it.
|
bzlib: Include stdio.h in case bzlib.h needs it.
--HG--
branch : HEAD
|
C
|
mit
|
jwm/dovecot-notmuch,jkerihuel/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch
|
9f600fc1d08d458c8ddebe839ee108dd3da324cc
|
src/socketmanager.h
|
src/socketmanager.h
|
#pragma once
#include "main.h"
#include "logmanager.h"
#include "modtypes/socket.h"
const std::set<unsigned int> sockAPIVersions { 3000 };
class SocketManager {
public:
std::shared_ptr<Socket> getSocket(const std::string& socketType);
private:
void removeSocket(const std::string& socketType, void* sockFile, Socket* deletingSocket);
};
class SocketLoadFailed : public std::exception {
public:
SocketLoadFailed(std::string&& desc) : description(std::forward<std::string>(desc)) {}
const char* what() const noexcept { return description.c_str(); }
private:
std::string description;
};
class SocketAPIMismatch : public std::exception {
public:
const char* what() const noexcept { return "The socket module is not compatible with the current module API."; }
};
class SocketOperationFailed : public std::exception {
public:
SocketConnectFailed(std::string&& desc) : description(std::forward<std::string>(desc)) {}
const char* what() const noexcept { return description.c_str(); }
private:
std::string description;
};
|
#pragma once
#include "main.h"
#include "logmanager.h"
#include "modtypes/socket.h"
const std::set<unsigned int> sockAPIVersions { 3000 };
class SocketManager {
public:
std::shared_ptr<Socket> getSocket(const std::string& socketType);
private:
void removeSocket(const std::string& socketType, void* sockFile, Socket* deletingSocket);
};
class SocketLoadFailed : public std::exception {
public:
SocketLoadFailed(std::string&& desc) : description(std::forward<std::string>(desc)) {}
const char* what() const noexcept { return description.c_str(); }
private:
std::string description;
};
class SocketAPIMismatch : public std::exception {
public:
const char* what() const noexcept { return "The socket module is not compatible with the current module API."; }
};
class SocketOperationFailed : public std::exception {
public:
SocketOperationFailed(std::string&& desc) : description(std::forward<std::string>(desc)) {}
const char* what() const noexcept { return description.c_str(); }
private:
std::string description;
};
|
Fix me missing the name
|
Fix me missing the name
|
C
|
mit
|
ElementalAlchemist/RoBoBo,ElementalAlchemist/RoBoBo
|
9b5dba2ddba450639ceebdea107dca8186c6d567
|
include/core/SkMilestone.h
|
include/core/SkMilestone.h
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 82
#endif
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 83
#endif
|
Update Skia milestone to 83
|
Update Skia milestone to 83
Change-Id: I7b62a8c94d1afde1bbec0c476ef8cf8d0e09b677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276636
Reviewed-by: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>
Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
Commit-Queue: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>
|
C
|
bsd-3-clause
|
google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia
|
93d7d23a3a2d293da998187cdc9d628086a60d5f
|
include/core/SkMilestone.h
|
include/core/SkMilestone.h
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 61
#endif
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 62
#endif
|
Update Skia milestone to 62
|
Update Skia milestone to 62
Bug: skia:
Change-Id: I94c906422508a75a859c7c780abf520a6083cbf8
Reviewed-on: https://skia-review.googlesource.com/25360
Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
Commit-Queue: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
|
C
|
bsd-3-clause
|
google/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,google/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,HalCanary/skia-hc,rubenvb/skia,rubenvb/skia,google/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia
|
49fe535bce258eb657ca32e34ef0c50667db044b
|
include/drivers/brcm/scp.h
|
include/drivers/brcm/scp.h
|
/*
* Copyright (c) 2017 - 2020, Broadcom
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef SCP_H_
#define SCP_H
#include <stdint.h>
int download_scp_patch(void *image, unsigned int image_size);
#endif /* SCP_H */
|
/*
* Copyright (c) 2017 - 2020, Broadcom
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef SCP_H
#define SCP_H
#include <stdint.h>
int download_scp_patch(void *image, unsigned int image_size);
#endif /* SCP_H */
|
Fix typo in file Header guard
|
Fix typo in file Header guard
Signed-off-by: Sheetal Tigadoli <7654421d81697baabc5c00f5d81122a6be70fe2d@broadcom.com>
Change-Id: Iaf6deaeee2069720518221157edbb052bc42850a
|
C
|
bsd-3-clause
|
achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware
|
3db51645690be7bf42e954bd154974b5cb5919a9
|
src/main/c++/RefCache.h
|
src/main/c++/RefCache.h
|
#ifndef __REFCACHE_H__
#define __REFCACHE_H__
// Class/Method/Field ID caching
// Cache of frequently-used class references
struct _classRef {
jclass classID;
const char *className;
};
typedef struct _classRef classRef;
// Cache of frequently-used method references
struct _methodRef {
jmethodID methodID;
const int classIndex;
const char *methodName;
const char *methodSignature;
};
typedef struct _methodRef methodRef;
// Cache of frequently-used field references
struct _fieldRef {
jfieldID fieldID;
const int classIndex;
const char *fieldName;
const char *fieldSignature;
};
typedef struct _fieldRef fieldRef;
class RefCache {
public:
RefCache(classRef *cr, methodRef *mr, fieldRef *fr) {
classRefCache = cr;
methodRefCache = mr;
fieldRefCache = fr;
}
jint setUp(JNIEnv *env);
void tearDown(JNIEnv *env);
private:
classRef *classRefCache;
methodRef *methodRefCache;
fieldRef *fieldRefCache;
};
#endif // __REFCACHE_H__
|
#ifndef __REFCACHE_H__
#define __REFCACHE_H__
// Class/Method/Field ID caching
// Cache of frequently-used class references
struct _classRef {
jclass classID;
const char *className;
};
typedef struct _classRef classRef;
// Cache of frequently-used method references
struct _methodRef {
jmethodID methodID;
int classIndex; // Would be const int if it weren't for VC6
const char *methodName;
const char *methodSignature;
};
typedef struct _methodRef methodRef;
// Cache of frequently-used field references
struct _fieldRef {
jfieldID fieldID;
int classIndex; // Would be const int if it weren't for VC6
const char *fieldName;
const char *fieldSignature;
};
typedef struct _fieldRef fieldRef;
class RefCache {
public:
RefCache(classRef *cr, methodRef *mr, fieldRef *fr) {
classRefCache = cr;
methodRefCache = mr;
fieldRefCache = fr;
}
jint setUp(JNIEnv *env);
void tearDown(JNIEnv *env);
private:
classRef *classRefCache;
methodRef *methodRefCache;
fieldRef *fieldRefCache;
};
#endif // __REFCACHE_H__
|
Remove constness of int fields to enable it to build on VC6.0
|
Remove constness of int fields to enable it to build on VC6.0
|
C
|
apache-2.0
|
201270842/devzendo-org-xpfsa,steveturner/devzendo-org-xpfsa,steveturner/devzendo-org-xpfsa,201270842/devzendo-org-xpfsa,201270842/devzendo-org-xpfsa,steveturner/devzendo-org-xpfsa,steveturner/devzendo-org-xpfsa,201270842/devzendo-org-xpfsa
|
8e2cc0f4fff1a414b4ea5a0d27d1a6eb8ba303ef
|
sys/i386/svr4/svr4_genassym.c
|
sys/i386/svr4/svr4_genassym.c
|
/* $FreeBSD$ */
/* Derived from: Id: linux_genassym.c,v 1.8 1998/07/29 15:50:41 bde Exp */
#include <sys/assym.h>
#include <sys/param.h>
struct proc;
#include <svr4/svr4.h>
#include <svr4/svr4_signal.h>
#include <svr4/svr4_ucontext.h>
/* XXX: This bit sucks rocks, but gets rid of compiler errors. Maybe I should
* fix the include files instead... */
#define SVR4_MACHDEP_JUST_REGS
#include <i386/svr4/svr4_machdep.h>
ASSYM(SVR4_SIGF_HANDLER, offsetof(struct svr4_sigframe, sf_handler));
ASSYM(SVR4_SIGF_UC, offsetof(struct svr4_sigframe, sf_uc));
ASSYM(SVR4_UC_FS, offsetof(struct svr4_ucontext,
uc_mcontext.greg[SVR4_X86_FS]));
ASSYM(SVR4_UC_GS, offsetof(struct svr4_ucontext,
uc_mcontext.greg[SVR4_X86_GS]));
ASSYM(SVR4_UC_EFLAGS, offsetof(struct svr4_ucontext,
uc_mcontext.greg[SVR4_X86_EFL]));
|
/* $FreeBSD$ */
/* Derived from: Id: linux_genassym.c,v 1.8 1998/07/29 15:50:41 bde Exp */
#include <stddef.h>
#include <sys/param.h>
#include <sys/assym.h>
#include <svr4/svr4_signal.h>
#include <svr4/svr4_ucontext.h>
/* XXX: This bit sucks rocks, but gets rid of compiler errors. Maybe I should
* fix the include files instead... */
#define SVR4_MACHDEP_JUST_REGS
#include <i386/svr4/svr4_machdep.h>
ASSYM(SVR4_SIGF_HANDLER, offsetof(struct svr4_sigframe, sf_handler));
ASSYM(SVR4_SIGF_UC, offsetof(struct svr4_sigframe, sf_uc));
ASSYM(SVR4_UC_FS, offsetof(struct svr4_ucontext,
uc_mcontext.greg[SVR4_X86_FS]));
ASSYM(SVR4_UC_GS, offsetof(struct svr4_ucontext,
uc_mcontext.greg[SVR4_X86_GS]));
ASSYM(SVR4_UC_EFLAGS, offsetof(struct svr4_ucontext,
uc_mcontext.greg[SVR4_X86_EFL]));
|
Include <stddef.h> here so that <sys/assym.h> can be unpolluted.
|
Include <stddef.h> here so that <sys/assym.h> can be unpolluted.
Include <sys/param.h> before <sys/assym.h> in case any of the magic
in the former is ever needed in the latter.
Removed an unused forward declaration and an unused include.
|
C
|
bsd-3-clause
|
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
|
6b5db364f5e67e85e6dfdc9865d538b7685b8577
|
src/lpc17xx/timer.c
|
src/lpc17xx/timer.c
|
#include "LPC17xx.h"
#include "lpc_types.h"
#include "lpc17xx_timer.h"
#include "timer.h"
#define SYSTEM_CLOCK_TIMER LPC_TIM3
#define DELAY_TIMER LPC_TIM0
void TIMER3_IRQHandler() { }
void delayMs(int delayInMs) {
TIM_TIMERCFG_Type delayTimerConfig;
TIM_ConfigStructInit(TIM_TIMER_MODE, &delayTimerConfig);
TIM_Init(DELAY_TIMER, TIM_TIMER_MODE, &delayTimerConfig);
DELAY_TIMER->PR = 0x00; /* set prescaler to zero */
DELAY_TIMER->MR0 = (SystemCoreClock / 4) / (1000 / delayInMs); //enter delay time
DELAY_TIMER->IR = 0xff; /* reset all interrupts */
DELAY_TIMER->MCR = 0x04; /* stop timer on match */
TIM_Cmd(DELAY_TIMER, ENABLE);
/* wait until delay time has elapsed */
while (DELAY_TIMER->TCR & 0x01);
}
unsigned long systemTimeMs() {
return SYSTEM_CLOCK_TIMER->TC;
}
void initializeTimers() {
TIM_TIMERCFG_Type systemClockTimerConfig;
TIM_ConfigStructInit(TIM_TIMER_MODE, &systemClockTimerConfig);
TIM_Init(SYSTEM_CLOCK_TIMER, TIM_TIMER_MODE, &systemClockTimerConfig);
TIM_Cmd(SYSTEM_CLOCK_TIMER, ENABLE);
}
|
#include "LPC17xx.h"
#include "lpc_types.h"
#include "lpc17xx_timer.h"
#include "timer.h"
#define SYSTEM_CLOCK_TIMER LPC_TIM3
#define DELAY_TIMER LPC_TIM0
void delayMs(int delayInMs) {
TIM_TIMERCFG_Type delayTimerConfig;
TIM_ConfigStructInit(TIM_TIMER_MODE, &delayTimerConfig);
TIM_Init(DELAY_TIMER, TIM_TIMER_MODE, &delayTimerConfig);
DELAY_TIMER->PR = 0x00; /* set prescaler to zero */
DELAY_TIMER->MR0 = (SystemCoreClock / 4) / (1000 / delayInMs); //enter delay time
DELAY_TIMER->IR = 0xff; /* reset all interrupts */
DELAY_TIMER->MCR = 0x04; /* stop timer on match */
TIM_Cmd(DELAY_TIMER, ENABLE);
/* wait until delay time has elapsed */
while (DELAY_TIMER->TCR & 0x01);
}
unsigned long systemTimeMs() {
return SYSTEM_CLOCK_TIMER->TC;
}
void initializeTimers() {
TIM_TIMERCFG_Type systemClockTimerConfig;
systemClockTimerConfig.PrescaleOption = TIM_PRESCALE_TICKVAL;
systemClockTimerConfig.PrescaleValue = SystemCoreClock / (4 * 1000);
TIM_Init(SYSTEM_CLOCK_TIMER, TIM_TIMER_MODE, &systemClockTimerConfig);
TIM_Cmd(SYSTEM_CLOCK_TIMER, ENABLE);
}
|
Store system clock as milliseconds, not microseconds.
|
Store system clock as milliseconds, not microseconds.
|
C
|
bsd-3-clause
|
ene-ilies/vi-firmware,openxc/vi-firmware,mgiannikouris/vi-firmware,ene-ilies/vi-firmware,ene-ilies/vi-firmware,openxc/vi-firmware,ene-ilies/vi-firmware,mgiannikouris/vi-firmware,openxc/vi-firmware,openxc/vi-firmware,mgiannikouris/vi-firmware,mgiannikouris/vi-firmware
|
8bf1dce53748298038119b458ea86a2e6b2ad15b
|
src/gui/document.h
|
src/gui/document.h
|
/*
* Copyright (C) 2008-2013 The Communi Project
*
* This example is free, and not covered by the LGPL license. There is no
* restriction applied to their modification, redistribution, using and so on.
* You can study them, modify them, use them in your own program - either
* completely or partially.
*/
#ifndef DOCUMENT_H
#define DOCUMENT_H
#include "textdocument.h"
class IrcBuffer;
class IrcMessage;
class MessageFormatter;
class Document : public TextDocument
{
Q_OBJECT
public:
Document(IrcBuffer* buffer);
~Document();
IrcBuffer* buffer() const;
static Document* instance(IrcBuffer* buffer = 0);
public slots:
void addBuffer(IrcBuffer* buffer);
void removeBuffer(IrcBuffer* buffer);
private slots:
void receiveMessage(IrcMessage* message);
private:
struct Private {
IrcBuffer* buffer;
MessageFormatter* formatter;
} d;
};
#endif // DOCUMENT_H
|
/*
* Copyright (C) 2008-2013 The Communi Project
*
* This example is free, and not covered by the LGPL license. There is no
* restriction applied to their modification, redistribution, using and so on.
* You can study them, modify them, use them in your own program - either
* completely or partially.
*/
#ifndef DOCUMENT_H
#define DOCUMENT_H
#include "textdocument.h"
class IrcBuffer;
class IrcMessage;
class MessageFormatter;
class Document : public TextDocument
{
Q_OBJECT
public:
Document(IrcBuffer* buffer);
~Document();
IrcBuffer* buffer() const;
static Document* instance(IrcBuffer* buffer = 0);
public slots:
static void addBuffer(IrcBuffer* buffer);
static void removeBuffer(IrcBuffer* buffer);
private slots:
void receiveMessage(IrcMessage* message);
private:
struct Private {
IrcBuffer* buffer;
MessageFormatter* formatter;
} d;
};
#endif // DOCUMENT_H
|
Make Document::add() and remove() static
|
Make Document::add() and remove() static
|
C
|
bsd-3-clause
|
jpnurmi/communi-desktop,sevanteri/communi-desktop,gdamjan/communi-desktop,communi/communi-desktop,communi/communi-desktop
|
b641a5194c9c11cc495cad2404207f47f7d6aa54
|
utils/lstopo-xml.c
|
utils/lstopo-xml.c
|
/*
* Copyright © 2009 CNRS, INRIA, Université Bordeaux 1
* See COPYING in top-level directory.
*/
#include <private/config.h>
#ifdef HAVE_XML
#include <hwloc.h>
#include "lstopo.h"
void output_xml(hwloc_topology_t topology, const char *filename, int verbose_mode)
{
if (!strcasecmp(filename, "-.xml"))
filename = "-";
hwloc_topology_export_xml(topology, filename);
}
#endif /* HAVE_XML */
|
/*
* Copyright © 2009 CNRS, INRIA, Université Bordeaux 1
* See COPYING in top-level directory.
*/
#include <private/config.h>
#ifdef HAVE_XML
#include <hwloc.h>
#include <string.h>
#include "lstopo.h"
void output_xml(hwloc_topology_t topology, const char *filename, int verbose_mode)
{
if (!strcasecmp(filename, "-.xml"))
filename = "-";
hwloc_topology_export_xml(topology, filename);
}
#endif /* HAVE_XML */
|
Fix compiler warning complaining about un-proto...
|
Fix compiler warning complaining about un-proto...
Fix compiler warning complaining about un-prototyped strcasecmp().
This commit was SVN r1191.
|
C
|
bsd-3-clause
|
ggouaillardet/hwloc,ggouaillardet/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc,shekkbuilder/hwloc,shekkbuilder/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc
|
30c1b638dd5d5ec429067a3b2d386bf3f585bdd1
|
sdch_handler.h
|
sdch_handler.h
|
// Copyright (c) 2015 Yandex LLC. All rights reserved.
// Author: Vasily Chekalkin <bacek@yandex-team.ru>
#ifndef SDCH_HANDLER_H_
#define SDCH_HANDLER_H_
namespace sdch {
// SDCH Handler chain.
class Handler {
public:
// Construct Handler with pointer to the next Handler.
// We don't own this pointer. It's owned by nginx pool.
explicit Handler(Handler* next) : next_(next) {}
virtual ~Handler();
// Handle chunk of data. For example encode it with VCDIFF.
// Almost every Handler should call next_->on_data() to keep chain.
virtual void on_data(const char* buf, size_t len) = 0;
protected:
Handler* next_;
};
} // namespace sdch
#endif // SDCH_HANDLER_H_
|
// Copyright (c) 2015 Yandex LLC. All rights reserved.
// Author: Vasily Chekalkin <bacek@yandex-team.ru>
#ifndef SDCH_HANDLER_H_
#define SDCH_HANDLER_H_
#include <cstring> // For size_t
namespace sdch {
// SDCH Handler chain.
class Handler {
public:
// Construct Handler with pointer to the next Handler.
// We don't own this pointer. It's owned by nginx pool.
explicit Handler(Handler* next) : next_(next) {}
virtual ~Handler();
// Handle chunk of data. For example encode it with VCDIFF.
// Almost every Handler should call next_->on_data() to keep chain.
virtual void on_data(const char* buf, size_t len) = 0;
protected:
Handler* next_;
};
} // namespace sdch
#endif // SDCH_HANDLER_H_
|
Fix compilation by using cstring include for size_t definition
|
Fix compilation by using cstring include for size_t definition
|
C
|
mit
|
yandex/sdch_module,yandex/sdch_module,yandex/sdch_module,yandex/sdch_module
|
c88a81fc3174e3989a0d75f68f2836ab55f1639e
|
src/arch/freertos/csp_semaphore.c
|
src/arch/freertos/csp_semaphore.c
|
#include <FreeRTOS.h>
#include <semphr.h>
#include <csp/arch/csp_semaphore.h>
#include <csp/csp_debug.h>
#include <csp/csp.h>
void csp_bin_sem_init(csp_bin_sem_t * sem) {
xSemaphoreCreateBinaryStatic(sem);
xSemaphoreGive(sem);
}
int csp_bin_sem_wait(csp_bin_sem_t * sem, uint32_t timeout) {
csp_log_lock("Wait: %p", sem);
if (timeout != CSP_MAX_TIMEOUT) {
timeout = timeout / portTICK_PERIOD_MS;
}
if (xSemaphoreTake((QueueHandle_t) sem, timeout) == pdPASS) {
return CSP_SEMAPHORE_OK;
}
return CSP_SEMAPHORE_ERROR;
}
int csp_bin_sem_post(csp_bin_sem_t * sem) {
csp_log_lock("Post: %p", sem);
if (xSemaphoreGive((QueueHandle_t)sem) == pdPASS) {
return CSP_SEMAPHORE_OK;
}
return CSP_SEMAPHORE_ERROR;
}
|
#include <FreeRTOS.h>
#include <semphr.h>
#include <csp/arch/csp_semaphore.h>
#include <csp/csp_debug.h>
#include <csp/csp.h>
void csp_bin_sem_init(csp_bin_sem_t * sem) {
xSemaphoreCreateBinaryStatic(sem);
xSemaphoreGive(sem);
}
int csp_bin_sem_wait(csp_bin_sem_t * sem, unsigned int timeout) {
csp_log_lock("Wait: %p", sem);
if (timeout != CSP_MAX_TIMEOUT) {
timeout = timeout / portTICK_PERIOD_MS;
}
if (xSemaphoreTake((QueueHandle_t) sem, timeout) == pdPASS) {
return CSP_SEMAPHORE_OK;
}
return CSP_SEMAPHORE_ERROR;
}
int csp_bin_sem_post(csp_bin_sem_t * sem) {
csp_log_lock("Post: %p", sem);
if (xSemaphoreGive((QueueHandle_t)sem) == pdPASS) {
return CSP_SEMAPHORE_OK;
}
return CSP_SEMAPHORE_ERROR;
}
|
Fix function prototype for sem_wait on freertos
|
Fix function prototype for sem_wait on freertos
|
C
|
mit
|
libcsp/libcsp,libcsp/libcsp
|
7fa397ca3c0d036c835318c9214a9b7343dfcb8d
|
src/condor_ckpt/condor_syscalls.h
|
src/condor_ckpt/condor_syscalls.h
|
#ifndef _CONDOR_SYSCALLS_H
#define _CONDOR_SYSCALLS_H
#if defined( AIX32)
# include "syscall.aix32.h"
#else
# include <syscall.h>
#endif
typedef int BOOL;
static const int SYS_LOCAL = 1;
static const int SYS_REMOTE = 0;
static const int SYS_RECORDED = 2;
static const int SYS_MAPPED = 2;
static const int SYS_UNRECORDED = 0;
static const int SYS_UNMAPPED = 0;
#if defined(__cplusplus)
extern "C" {
#endif
int SetSyscalls( int mode );
BOOL LocalSysCalls();
BOOL RemoteSysCalls();
BOOL MappingFileDescriptors();
int REMOTE_syscall( int syscall_num, ... );
#if 0
#if defined(AIX32) && defined(__cplusplus)
int syscall( ... );
#elif defined(ULTRIX42) && defined(__cplusplus)
int syscall( ... );
#else
int syscall( int, ... );
#endif
#endif
#if defined(__cplusplus)
}
#endif
#endif
|
#ifndef _CONDOR_SYSCALLS_H
#define _CONDOR_SYSCALLS_H
#if defined( AIX32)
# include "syscall.aix32.h"
#else
# include <syscall.h>
#endif
typedef int BOOL;
static const int SYS_LOCAL = 1;
static const int SYS_REMOTE = 0;
static const int SYS_RECORDED = 2;
static const int SYS_MAPPED = 2;
static const int SYS_UNRECORDED = 0;
static const int SYS_UNMAPPED = 0;
#if defined(__cplusplus)
extern "C" {
#endif
int SetSyscalls( int mode );
BOOL LocalSysCalls();
BOOL RemoteSysCalls();
BOOL MappingFileDescriptors();
int REMOTE_syscall( int syscall_num, ... );
#if 0
#if defined(AIX32) && defined(__cplusplus)
int syscall( ... );
#elif defined(ULTRIX42) && defined(__cplusplus)
int syscall( ... );
#else
int syscall( int, ... );
#endif
#endif
#if defined(OSF1)
int syscall( int, ... );
#endif
#if defined(__cplusplus)
}
#endif
#endif
|
Put prototype for syscall() in for OSF/1 machines.
|
Put prototype for syscall() in for OSF/1 machines.
|
C
|
apache-2.0
|
neurodebian/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,djw8605/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,neurodebian/htcondor,djw8605/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/condor,htcondor/htcondor,htcondor/htcondor,djw8605/condor,htcondor/htcondor,neurodebian/htcondor,htcondor/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,clalancette/condor-dcloud,zhangzhehust/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,clalancette/condor-dcloud,htcondor/htcondor,htcondor/htcondor,neurodebian/htcondor,djw8605/condor,clalancette/condor-dcloud,clalancette/condor-dcloud,mambelli/osg-bosco-marco,neurodebian/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/condor,neurodebian/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/condor,djw8605/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/htcondor,djw8605/condor,zhangzhehust/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,htcondor/htcondor,djw8605/htcondor,djw8605/condor,bbockelm/condor-network-accounting
|
67cd74ec17e6061d70d38d48b7c56ce448063f35
|
test/Driver/output-file-is-dir.c
|
test/Driver/output-file-is-dir.c
|
// XFAIL: hexagon
// RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir/a.out
// RUN: cd %t.dir && not %clang %s
// RUN: test -d %t.dir/a.out
// REQUIRES: shell
int main() { return 0; }
|
// RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir
// RUN: not %clang %s -c -emit-llvm -o %t.dir
// RUN: test -d %t.dir
int main() { return 0; }
|
Simplify test so that it is more portable.
|
Simplify test so that it is more portable.
I have checked that the test still fails when the "|| !P.isRegularFile()" from
the original patch is removed.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@179464 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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
|
605ec1ec715d3c33b54152e1797b4241b2c3ef89
|
DigitRecognizerSDK/BNNSHelpers.h
|
DigitRecognizerSDK/BNNSHelpers.h
|
//
// BNNSHelpers.h
// NumberPad
//
// Created by Bridger Maxwell on 9/1/16.
// Copyright © 2016 Bridger Maxwell. All rights reserved.
//
#include <Accelerate/Accelerate.h>
BNNSFilterParameters createEmptyBNNSFilterParameters();
|
//
// BNNSHelpers.h
// NumberPad
//
// Created by Bridger Maxwell on 9/1/16.
// Copyright © 2016 Bridger Maxwell. All rights reserved.
//
@import Accelerate;
BNNSFilterParameters createEmptyBNNSFilterParameters();
|
Fix intermittent build error about non-modular header.
|
Fix intermittent build error about non-modular header.
|
C
|
apache-2.0
|
bridger/NumberPad,bridger/NumberPad,bridger/NumberPad
|
be0d3253f7e2ca4fc4912df8021c32b171ce4bc7
|
src/dirutils.h
|
src/dirutils.h
|
/*
* Copyright (c) 2012 Kyle Isom <kyle@tyrfingr.is>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
* OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* ---------------------------------------------------------------------
*/
#ifndef __VOLTAIRE_MAKEDIR_H
#define __VOLTAIRE_MAKEDIR_H
#include <sys/queue.h>
#include <stdio.h>
enum E_EXISTS_STATUS {
EXISTS_ERROR,
EXISTS_NOENT,
EXISTS_NOPERM,
EXISTS_DIR,
EXISTS_FILE
};
typedef enum E_EXISTS_STATUS EXISTS_STATUS;
int makedirs(const char *, size_t);
int rmdirs(const char *, size_t);
EXISTS_STATUS path_exists(const char *, size_t);
#endif
|
/*
* Copyright (c) 2012 Kyle Isom <kyle@tyrfingr.is>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
* OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* ---------------------------------------------------------------------
*/
#ifndef __DIRUTILS_MAKEDIR_H
#define __DIRUTILS_MAKEDIR_H
#include <sys/queue.h>
#include <stdio.h>
enum E_EXISTS_STATUS {
EXISTS_ERROR,
EXISTS_NOENT,
EXISTS_NOPERM,
EXISTS_DIR,
EXISTS_FILE
};
typedef enum E_EXISTS_STATUS EXISTS_STATUS;
int makedirs(const char *, size_t);
int rmdirs(const char *, size_t);
EXISTS_STATUS path_exists(const char *, size_t);
#endif
|
Include guard reflects the new project name.
|
Include guard reflects the new project name.
The old include guards were an artifact of the presence of this
code in another project before it was split out.
|
C
|
isc
|
kisom/libdirutils,kisom/libdirutils
|
4492babe6ef32033f3e664b99873f8a5ea1dd052
|
src/dynamite.c
|
src/dynamite.c
|
/* $Id$ */
#include "libdynamite.h"
#include <stdio.h>
#define FCLOSE(file) if (file) { fclose(file); file = NULL; }
typedef struct _Cookie
{
FILE* input_file;
FILE* output_file;
} Cookie;
static size_t reader(void* buffer, size_t size, void* cookie)
{
return fread(buffer, 1, size, ((Cookie*)cookie)->input_file);
}
static size_t writer(void* buffer, size_t size, void* cookie)
{
return fwrite(buffer, 1, size, ((Cookie*)cookie)->output_file);
}
int main(int argc, char** argv)
{
int result = -1;
Cookie cookie;
cookie.input_file = fopen(argv[1], "r");
cookie.output_file = fopen(argv[2], "w");
result = dynamite_explode(reader, writer, &cookie);
FCLOSE(cookie.input_file);
FCLOSE(cookie.output_file);
return result;
}
|
/* $Id$ */
#include "libdynamite.h"
#include <stdio.h>
#include <stdlib.h>
#define FCLOSE(file) if (file) { fclose(file); file = NULL; }
typedef struct _Cookie
{
FILE* input_file;
FILE* output_file;
} Cookie;
static size_t reader(void* buffer, size_t size, void* cookie)
{
return fread(buffer, 1, size, ((Cookie*)cookie)->input_file);
}
static size_t writer(void* buffer, size_t size, void* cookie)
{
return fwrite(buffer, 1, size, ((Cookie*)cookie)->output_file);
}
int main(int argc, char** argv)
{
int result = -1;
Cookie cookie;
if (argc < 3)
{
fprintf(stderr, "Missing filenames");
return 1;
}
cookie.input_file = fopen(argv[1], "r");
cookie.output_file = fopen(argv[2], "w");
if (argc >= 4)
{
fseek(cookie.input_file, strtol(argv[3], NULL, 0), SEEK_SET);
}
result = dynamite_explode(reader, writer, &cookie);
FCLOSE(cookie.input_file);
FCLOSE(cookie.output_file);
return result;
}
|
Allow a third parameter for offset
|
Allow a third parameter for offset
|
C
|
mit
|
twogood/dynamite,twogood/dynamite
|
6aa29c5cc51bc2018b76fd70c20c5f2621bf6853
|
src/multithread.c
|
src/multithread.c
|
#include <stdlib.h>
#include <pthread.h>
#include "multithread.h"
mt_threads *mt_threads_create(unsigned nthreads)
{
mt_threads *threads = (mt_threads *) malloc(sizeof(mt_threads));
if (!threads)
return NULL;
threads->contexts = (mt_context *) malloc(sizeof(mt_context) * nthreads);
threads->nthreads = nthreads;
unsigned i;
for (i = 0; i < nthreads; i++)
threads->contexts[i].thread_id = i;
return threads;
}
void mt_threads_free(mt_threads *threads)
{
free(threads->contexts);
free(threads);
}
void mt_threads_start(mt_threads *threads, void*(*runner)(void *))
{
unsigned i;
for (i = 0; i < threads->nthreads; i++)
pthread_create(&threads->contexts[i].pthread, NULL, runner, &threads->contexts[i]);
}
void mt_threads_join(mt_threads *threads)
{
unsigned i;
for (i = 0; i < threads->nthreads; i++)
pthread_join(threads->contexts[i].pthread, NULL);
}
|
#include <stdlib.h>
#include <pthread.h>
#include "multithread.h"
#define THREAD_STACK_SIZE (256*1024)
mt_threads *mt_threads_create(unsigned nthreads)
{
mt_threads *threads = (mt_threads *) malloc(sizeof(mt_threads));
if (!threads)
return NULL;
threads->contexts = (mt_context *) malloc(sizeof(mt_context) * nthreads);
threads->nthreads = nthreads;
unsigned i;
for (i = 0; i < nthreads; i++)
threads->contexts[i].thread_id = i;
return threads;
}
void mt_threads_free(mt_threads *threads)
{
free(threads->contexts);
free(threads);
}
void mt_threads_start(mt_threads *threads, void*(*runner)(void *))
{
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, THREAD_STACK_SIZE);
unsigned i;
for (i = 0; i < threads->nthreads; i++) {
pthread_create(&threads->contexts[i].pthread, &attr, runner, &threads->contexts[i]);
}
}
void mt_threads_join(mt_threads *threads)
{
unsigned i;
for (i = 0; i < threads->nthreads; i++)
pthread_join(threads->contexts[i].pthread, NULL);
}
|
Set thread stack size to 256K
|
Set thread stack size to 256K
|
C
|
bsd-3-clause
|
calmh/ClusteredPoller,calmh/ClusteredPoller
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.