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
7667f3bc0a968667d185887f527d5efecbb5bf52
include/graph.h
include/graph.h
#ifndef GRAPH_H #define GRAPH_H #include <unordered_map> #include <unordered_set> template<typename T> class Graph { public: void connect(const T &a, const T &b); const std::unordered_set<T>& get_vertex_ids() const; inline const std::unordered_set<T>& get_neighbors(const T &vertex_id) const { return vertices_.at(vertex_id)->adjacent_ids_; } ~Graph(); private: struct Vertex { T id_; std::unordered_set<Vertex*> adjacent_; std::unordered_set<T> adjacent_ids_; Vertex(const T &id) : id_(id) {} bool has_neighbor(Vertex *v) const { return adjacent_.find(v) != adjacent_.end(); } void add_neighbor(Vertex* v) { adjacent_.insert(v); adjacent_ids_.insert(v->id_); } }; std::unordered_map<T, Vertex*> vertices_; std::unordered_set<T> vertex_ids; Vertex* get_vertex(const T &a) const; Vertex* get_or_insert(const T &a); }; template class Graph<int>; #endif
#ifndef GRAPH_H #define GRAPH_H #include <unordered_map> #include <unordered_set> template<typename T> class Graph { public: void connect(const T &a, const T &b); const std::unordered_set<T>& get_vertex_ids() const; inline const std::unordered_set<T>& get_neighbors(const T &vertex_id) const { return vertices_.at(vertex_id)->adjacent_ids_; } ~Graph(); private: struct Vertex { T id_; std::unordered_set<Vertex*> adjacent_; std::unordered_set<T> adjacent_ids_; Vertex(const T &id) : id_(id) {} bool has_neighbor(Vertex *v) const { return adjacent_.find(v) != adjacent_.end(); } void add_neighbor(Vertex* v) { adjacent_.insert(v); adjacent_ids_.insert(v->id_); } }; std::unordered_map<T, Vertex*> vertices_; std::unordered_set<T> vertex_ids; std::unordered_map<T, int> alias_id; std::vector<int> reverse_mapping; Vertex* get_vertex(const T &a) const; Vertex* get_or_insert(const T &a); }; template class Graph<int>; #endif
Add initial data structures for mapping
Add initial data structures for mapping
C
mit
chivay/betweenness-centrality
2fb635a28d5165f0a6f5bddf2b6fe28ce09b9dfb
features/nfc/nfc/NFCControllerDriver.h
features/nfc/nfc/NFCControllerDriver.h
/* mbed Microcontroller Library * Copyright (c) 2018 ARM Limited * * 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 MBED_NFC_CONTROLLER_DRIVER_H #define MBED_NFC_CONTROLLER_DRIVER_H #include <stdint.h> #include "events/EventQueue.h" #include "stack/nfc_errors.h" #include "stack/transceiver/transceiver.h" #include "stack/platform/scheduler.h" namespace mbed { namespace nfc { struct NFCControllerDriver { virtual void initialize(scheduler_timer_t* pTimer) = 0; virtual transceiver_t* get_transceiver() const = 0; }; } // namespace nfc } // namespace mbed #endif
/* mbed Microcontroller Library * Copyright (c) 2018 ARM Limited * * 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 MBED_NFC_CONTROLLER_DRIVER_H #define MBED_NFC_CONTROLLER_DRIVER_H #include <stdint.h> #include "events/EventQueue.h" #include "stack/nfc_errors.h" #include "stack/transceiver/transceiver.h" #include "stack/platform/scheduler.h" namespace mbed { namespace nfc { struct NFCControllerDriver { virtual void initialize(scheduler_timer_t* pTimer) = 0; virtual transceiver_t* get_transceiver() const = 0; virtual nfc_rf_protocols_bitmask_t get_supported_rf_protocols() const = 0; }; } // namespace nfc } // namespace mbed #endif
Add get_supported_rf_protocols() method to driver
Add get_supported_rf_protocols() method to driver
C
apache-2.0
c1728p9/mbed-os,kjbracey-arm/mbed,betzw/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,c1728p9/mbed-os,mbedmicro/mbed,betzw/mbed-os,mbedmicro/mbed,andcor02/mbed-os,c1728p9/mbed-os,c1728p9/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed,kjbracey-arm/mbed,c1728p9/mbed-os,betzw/mbed-os,andcor02/mbed-os,andcor02/mbed-os,mbedmicro/mbed,betzw/mbed-os,c1728p9/mbed-os,mbedmicro/mbed,betzw/mbed-os,andcor02/mbed-os,andcor02/mbed-os,betzw/mbed-os
db7e7bd6d0b2695d6c1390e18a4843dbf36b54aa
lib/dec/quant.h
lib/dec/quant.h
/******************************************************************** * * * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2007 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: last mod: $Id$ ********************************************************************/ #if !defined(_quant_H) # define _quant_H (1) # include "theora/codec.h" # include "ocintrin.h" typedef ogg_uint16_t oc_quant_table[64]; typedef oc_quant_table oc_quant_tables[64]; /*Maximum scaled quantizer value.*/ #define OC_QUANT_MAX (1024<<2) /*Minimum scaled DC coefficient frame quantizer value for intra and inter modes.*/ extern unsigned OC_DC_QUANT_MIN[2]; /*Minimum scaled AC coefficient frame quantizer value for intra and inter modes.*/ extern unsigned OC_AC_QUANT_MIN[2]; void oc_dequant_tables_init(oc_quant_table *_dequant[2][3], int _pp_dc_scale[64],const th_quant_info *_qinfo); #endif
/******************************************************************** * * * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2007 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: last mod: $Id$ ********************************************************************/ #if !defined(_quant_H) # define _quant_H (1) # include "theora/codec.h" # include "ocintrin.h" typedef ogg_uint16_t oc_quant_table[64]; typedef oc_quant_table oc_quant_tables[64]; /*Maximum scaled quantizer value.*/ #define OC_QUANT_MAX (1024<<2) void oc_dequant_tables_init(oc_quant_table *_dequant[2][3], int _pp_dc_scale[64],const th_quant_info *_qinfo); #endif
Remove extern references for OC_*_QUANT_MIN.
Remove extern references for OC_*_QUANT_MIN. These were exported for the use of the theora-exp encoder and are not needed in trunk. Part of a patch from issue 1297. git-svn-id: 8dbf393e6e9ab8d4979d29f9a341a98016792aa6@15322 0101bb08-14d6-0310-b084-bc0e0c8e3800
C
bsd-3-clause
KTXSoftware/theora,KTXSoftware/theora,Distrotech/libtheora,Distrotech/libtheora,KTXSoftware/theora,KTXSoftware/theora,Distrotech/libtheora,Distrotech/libtheora,Distrotech/libtheora,KTXSoftware/theora
b1c73bbd6bcd5c4e403998fe8f7bc1e1ace1359b
chip/mchp/adc_chip.h
chip/mchp/adc_chip.h
/* Copyright 2017 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* MCHP MEC specific ADC module for Chrome EC */ #ifndef __CROS_EC_ADC_CHIP_H #define __CROS_EC_ADC_CHIP_H /* Data structure to define ADC channels. */ struct adc_t { const char *name; int factor_mul; int factor_div; int shift; int channel; }; /* * Boards must provide this list of ADC channel definitions. * This must match the enum adc_channel list provided by the board. */ extern const struct adc_t adc_channels[]; /* Minimum and maximum values returned by adc_read_channel(). */ #define ADC_READ_MIN 0 #define ADC_READ_MAX 1023 /* Just plain id mapping for code readability */ #define MCHP_ADC_CH(x) (x) #endif /* __CROS_EC_ADC_CHIP_H */
/* Copyright 2017 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* MCHP MEC specific ADC module for Chrome EC */ #ifndef __CROS_EC_ADC_CHIP_H #define __CROS_EC_ADC_CHIP_H /* Data structure to define ADC channels. */ struct adc_t { const char *name; int factor_mul; int factor_div; int shift; int channel; }; /* List of ADC channels */ enum chip_adc_channel { CHIP_ADC_CH0 = 0, CHIP_ADC_CH1, CHIP_ADC_CH2, CHIP_ADC_CH3, CHIP_ADC_CH4, CHIP_ADC_CH5, CHIP_ADC_CH6, CHIP_ADC_CH7, CHIP_ADC_COUNT, }; /* * Boards must provide this list of ADC channel definitions. * This must match the enum adc_channel list provided by the board. */ extern const struct adc_t adc_channels[]; /* Minimum and maximum values returned by adc_read_channel(). */ #define ADC_READ_MIN 0 #define ADC_READ_MAX 1023 /* Just plain id mapping for code readability */ #define MCHP_ADC_CH(x) (x) #endif /* __CROS_EC_ADC_CHIP_H */
Add ADC channel enumeration to chip
mchp: Add ADC channel enumeration to chip Add a chip level ADC channel enumerated type. BRANCH=none BUG=b:177463787 TEST=Booted skylake RVP to Chrome OS Signed-off-by: Scott Worley <186210b307f58d6c0a191337b635ed93ad075837@microchip.corp-partner.google.com> Change-Id: If30a71698b1d084380c6695e4c4b8921f5b8eec2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2673019 Reviewed-by: Ravin Kumar <a0e97d6aca75c950342a3a8ebb8bd1c89d88be3e@microchip.com> Reviewed-by: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@chromium.org> Tested-by: Ravin Kumar <a0e97d6aca75c950342a3a8ebb8bd1c89d88be3e@microchip.com>
C
bsd-3-clause
coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec
f1dcb34bfc420809b68884260247a14e75776372
cpp/foreach/concat.h
cpp/foreach/concat.h
#ifndef _CONCAT_H_ #define _CONCAT_H_ /// Utitilies to make a unique variable name. #define CONCAT_LINE(x) CONCAT(x, __LINE__) #define CONCAT(a, b) CONCAT_INDIRECT(a, b) #define CONCAT_INDIRECT(a, b) a ## b #endif
#ifndef _CONCAT_H_ #define _CONCAT_H_ /// Utitilies to make a unique variable name. #define CONCAT_LINE(x) CONCAT(x ## _foreach__, __LINE__) #define CONCAT(a, b) CONCAT_INDIRECT(a, b) #define CONCAT_INDIRECT(a, b) a ## b #endif
Fix a __i386 bug in gcc
Fix a __i386 bug in gcc In gcc, __i386 has special meaning for i386 CPU. So we should avoid use __i386 as variable name.
C
unlicense
airekans/Snippet,airekans/Snippet,airekans/Snippet,airekans/Snippet
7c6dcf070a18942956867419ec19f348f2e929cc
test/tsan/libdispatch/dispatch_once_deadlock.c
test/tsan/libdispatch/dispatch_once_deadlock.c
// Check that calling dispatch_once from a report callback works. // RUN: %clang_tsan %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s #include <dispatch/dispatch.h> #include <pthread.h> #include <stdio.h> long g = 0; long h = 0; void f() { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ g++; }); h++; } void __tsan_on_report() { fprintf(stderr, "Report.\n"); f(); } int main() { fprintf(stderr, "Hello world.\n"); f(); pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_unlock(&mutex); // Unlock of an unlocked mutex fprintf(stderr, "g = %ld.\n", g); fprintf(stderr, "h = %ld.\n", h); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: Report. // CHECK: g = 1 // CHECK: h = 2 // CHECK: Done.
// Check that calling dispatch_once from a report callback works. // RUN: %clang_tsan %s -o %t // RUN: not %env_tsan_opts=ignore_noninstrumented_modules=0 %run %t 2>&1 | FileCheck %s #include <dispatch/dispatch.h> #include <pthread.h> #include <stdio.h> long g = 0; long h = 0; void f() { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ g++; }); h++; } void __tsan_on_report() { fprintf(stderr, "Report.\n"); f(); } int main() { fprintf(stderr, "Hello world.\n"); f(); pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_unlock(&mutex); // Unlock of an unlocked mutex fprintf(stderr, "g = %ld.\n", g); fprintf(stderr, "h = %ld.\n", h); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: Report. // CHECK: g = 1 // CHECK: h = 2 // CHECK: Done.
Fix test failing on Linux
[TSan] Fix test failing on Linux git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@368641 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
4f66d2d8091e1faec2eaa138c6e95c928f7b669d
targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis.h
targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis.h
/* mbed Microcontroller Library * Copyright (c) 2015-2017 Nuvoton * * 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 MBED_CMSIS_H #define MBED_CMSIS_H #include "NANO100Series.h" #include "cmsis_nvic.h" // Support linker-generated symbol as start of relocated vector table. #if defined(__CC_ARM) extern uint32_t Image$$ER_IRAMVEC$$ZI$$Base; #elif defined(__ICCARM__) #elif defined(__GNUC__) extern uint32_t __start_vector_table__; #endif #endif
/* mbed Microcontroller Library * Copyright (c) 2015-2017 Nuvoton * * 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 MBED_CMSIS_H #define MBED_CMSIS_H #include "Nano100Series.h" #include "cmsis_nvic.h" // Support linker-generated symbol as start of relocated vector table. #if defined(__CC_ARM) extern uint32_t Image$$ER_IRAMVEC$$ZI$$Base; #elif defined(__ICCARM__) #elif defined(__GNUC__) extern uint32_t __start_vector_table__; #endif #endif
Fix the file name case problem for building code in Linux system
[NANO130] Fix the file name case problem for building code in Linux system
C
apache-2.0
betzw/mbed-os,nRFMesh/mbed-os,Archcady/mbed-os,catiedev/mbed-os,betzw/mbed-os,YarivCol/mbed-os,mazimkhan/mbed-os,ryankurte/mbed-os,karsev/mbed-os,nRFMesh/mbed-os,ryankurte/mbed-os,svogl/mbed-os,andcor02/mbed-os,catiedev/mbed-os,mbedmicro/mbed,YarivCol/mbed-os,andcor02/mbed-os,nRFMesh/mbed-os,mazimkhan/mbed-os,c1728p9/mbed-os,HeadsUpDisplayInc/mbed,HeadsUpDisplayInc/mbed,YarivCol/mbed-os,nRFMesh/mbed-os,kjbracey-arm/mbed,infinnovation/mbed-os,catiedev/mbed-os,Archcady/mbed-os,mazimkhan/mbed-os,ryankurte/mbed-os,c1728p9/mbed-os,mazimkhan/mbed-os,infinnovation/mbed-os,ryankurte/mbed-os,CalSol/mbed,infinnovation/mbed-os,svogl/mbed-os,c1728p9/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed,CalSol/mbed,karsev/mbed-os,HeadsUpDisplayInc/mbed,CalSol/mbed,CalSol/mbed,betzw/mbed-os,c1728p9/mbed-os,karsev/mbed-os,karsev/mbed-os,catiedev/mbed-os,nRFMesh/mbed-os,HeadsUpDisplayInc/mbed,betzw/mbed-os,betzw/mbed-os,Archcady/mbed-os,mbedmicro/mbed,andcor02/mbed-os,CalSol/mbed,YarivCol/mbed-os,andcor02/mbed-os,c1728p9/mbed-os,Archcady/mbed-os,karsev/mbed-os,svogl/mbed-os,CalSol/mbed,svogl/mbed-os,YarivCol/mbed-os,HeadsUpDisplayInc/mbed,andcor02/mbed-os,HeadsUpDisplayInc/mbed,mbedmicro/mbed,catiedev/mbed-os,ryankurte/mbed-os,nRFMesh/mbed-os,kjbracey-arm/mbed,Archcady/mbed-os,catiedev/mbed-os,ryankurte/mbed-os,Archcady/mbed-os,mbedmicro/mbed,mazimkhan/mbed-os,c1728p9/mbed-os,svogl/mbed-os,mazimkhan/mbed-os,mbedmicro/mbed,betzw/mbed-os,infinnovation/mbed-os,karsev/mbed-os,infinnovation/mbed-os,infinnovation/mbed-os,YarivCol/mbed-os,kjbracey-arm/mbed,svogl/mbed-os
f739a7605b738b85ba32436825b44f0059b83f45
test/test_cpuid.c
test/test_cpuid.c
#include "unity.h" #include "cpuid.h" void test_GetVendorName_should_ReturnGenuineIntel(void) { char expected[20] = "GenuineIntel"; char actual[20]; get_vendor_name(actual); TEST_ASSERT_EQUAL_STRING(expected, actual); } void test_GetVendorSignature_should_asdf(void) { uint32_t exp_ebx = 0x756e6547; // translates to "Genu" uint32_t exp_ecx = 0x6c65746e; // translates to "ineI" uint32_t exp_edx = 0x49656e69; // translates to "ntel" cpuid_info_t sig; sig = get_vendor_signature(); TEST_ASSERT_EQUAL_UINT32(exp_ebx, sig.ebx); TEST_ASSERT_EQUAL_UINT32(exp_ecx, sig.ecx); TEST_ASSERT_EQUAL_UINT32(exp_edx, sig.edx); } void test_GetProcessorSignature_should_ReturnFamily6(void) { unsigned int expected = 0x6; unsigned int family; uint32_t processor_signature = get_processor_signature(); family = (processor_signature >> 8) & 0xf; TEST_ASSERT_EQUAL_UINT(expected, family); }
#include "unity.h" #include "cpuid.h" void test_GetVendorName_should_ReturnGenuineIntel(void) { char expected[20] = "GenuineIntel"; char actual[20]; get_vendor_name(actual); TEST_ASSERT_EQUAL_STRING(expected, actual); } void test_GetVendorSignature_should_ReturnCorrectCpuIdValues(void) { uint32_t exp_ebx = 0x756e6547; // translates to "Genu" uint32_t exp_ecx = 0x6c65746e; // translates to "ineI" uint32_t exp_edx = 0x49656e69; // translates to "ntel" cpuid_info_t sig; sig = get_vendor_signature(); TEST_ASSERT_EQUAL_UINT32(exp_ebx, sig.ebx); TEST_ASSERT_EQUAL_UINT32(exp_ecx, sig.ecx); TEST_ASSERT_EQUAL_UINT32(exp_edx, sig.edx); } void test_GetProcessorSignature_should_ReturnFamily6(void) { unsigned int expected = 0x6; unsigned int family; uint32_t processor_signature = get_processor_signature(); family = (processor_signature >> 8) & 0xf; TEST_ASSERT_EQUAL_UINT(expected, family); }
Change method-name to something more appropriate
Change method-name to something more appropriate
C
bsd-2-clause
sosy-lab/power-gadget_benchexec,sosy-lab/power-gadget_benchexec
467b95c1f52ffcd22d928cbbe0bd102d24df3425
print_helpers.h
print_helpers.h
/* * print_helpers.h * * Created on: Nov 29, 2014 * Author: Konstantin Gredeskoul * Code: https://github.com/kigster * * (c) 2014 All rights reserved, MIT License. */ #ifndef printv #define printv(X,Y) (Serial.print(X) || Serial.println(Y)) #endif
/* * print_helpers.h * * Created on: Nov 29, 2014 * Author: Konstantin Gredeskoul * Code: https://github.com/kigster * * (c) 2014 All rights reserved, MIT License. */ #ifndef printv #define printv(X,Y) (Serial.print(X) || Serial.println(Y)) #endif #ifndef _printf #define _printf(X,Y) (Serial.printf(X, Y)) #endif
Add probably useless _printf(x,y) macro
Add probably useless _printf(x,y) macro
C
mit
kigster/flix-capacitor,kigster/FilxCapacitor,kigster/flix-capacitor,kigster/FilxCapacitor
d382aa8fca9778c0251ff9c8e708731c2a1f07ab
cmd/lefty/parse.h
cmd/lefty/parse.h
/* $Id$ $Revision$ */ /* 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 * **********************************************************/ #ifdef __cplusplus extern "C" { #endif /* Lefteris Koutsofios - AT&T Bell Laboratories */ #ifndef _PARSE_H #define _PARSE_H typedef struct Psrc_t { int flag; char *s; FILE *fp; int tok; int lnum; } Psrc_t; void Pinit(void); void Pterm(void); Tobj Punit(Psrc_t *); Tobj Pfcall(Tobj, Tobj); Tobj Pfunction(char *, int); #endif /* _PARSE_H */ #ifdef __cplusplus } #endif
/* $Id$ $Revision$ */ /* 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 * **********************************************************/ #ifdef __cplusplus extern "C" { #endif /* Lefteris Koutsofios - AT&T Labs Research */ #ifndef _PARSE_H #define _PARSE_H typedef struct Psrc_t { int flag; char *s; FILE *fp; int tok; int lnum; } Psrc_t; void Pinit (void); void Pterm (void); Tobj Punit (Psrc_t *); Tobj Pfcall (Tobj, Tobj); Tobj Pfunction (char *, int); #endif /* _PARSE_H */ #ifdef __cplusplus } #endif
Update with new lefty, fixing many bugs and supporting new features
Update with new lefty, fixing many bugs and supporting new features
C
epl-1.0
jho1965us/graphviz,tkelman/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,tkelman/graphviz,pixelglow/graphviz,pixelglow/graphviz,kbrock/graphviz,pixelglow/graphviz,pixelglow/graphviz,jho1965us/graphviz,ellson/graphviz,tkelman/graphviz,BMJHayward/graphviz,tkelman/graphviz,kbrock/graphviz,BMJHayward/graphviz,ellson/graphviz,ellson/graphviz,kbrock/graphviz,tkelman/graphviz,pixelglow/graphviz,ellson/graphviz,BMJHayward/graphviz,pixelglow/graphviz,MjAbuz/graphviz,kbrock/graphviz,pixelglow/graphviz,MjAbuz/graphviz,kbrock/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,jho1965us/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,pixelglow/graphviz,jho1965us/graphviz,pixelglow/graphviz,kbrock/graphviz,BMJHayward/graphviz,pixelglow/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,jho1965us/graphviz,MjAbuz/graphviz,jho1965us/graphviz,tkelman/graphviz,BMJHayward/graphviz,tkelman/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,tkelman/graphviz,jho1965us/graphviz,pixelglow/graphviz,MjAbuz/graphviz,tkelman/graphviz,jho1965us/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,ellson/graphviz,kbrock/graphviz,kbrock/graphviz,kbrock/graphviz,ellson/graphviz,tkelman/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,jho1965us/graphviz,kbrock/graphviz,jho1965us/graphviz
cefd1c2ebc604434a1330ec4f8dd393bb4ad1037
Source/HYPFormsManager.h
Source/HYPFormsManager.h
@import Foundation; #import "HYPFormField.h" @interface HYPFormsManager : NSObject @property (nonatomic, strong) NSMutableArray *forms; @property (nonatomic, strong) NSMutableDictionary *hiddenFields; @property (nonatomic, strong) NSMutableDictionary *hiddenSections; @property (nonatomic, strong) NSArray *disabledFieldsIDs; @property (nonatomic, strong) NSMutableDictionary *values; - (instancetype)initWithJSON:(id)JSON initialValues:(NSDictionary *)initialValues disabledFieldIDs:(NSArray *)disabledFieldIDs disabled:(BOOL)disabled; - (instancetype)initWithForms:(NSMutableArray *)forms initialValues:(NSDictionary *)initialValues; - (NSArray *)invalidFormFields; - (NSDictionary *)requiredFormFields; - (NSMutableDictionary *)valuesForFormula:(HYPFormField *)field; - (HYPFormField *)fieldWithID:(NSString *)fieldID withIndexPath:(BOOL)withIndexPath; - (HYPFormField *)fieldWithID:(NSString *)fieldID withIndexPath:(BOOL)withIndexPath inForms:(NSArray *)forms; @end
@import Foundation; #import "HYPFormField.h" @interface HYPFormsManager : NSObject @property (nonatomic, strong) NSMutableArray *forms; @property (nonatomic, strong) NSMutableDictionary *hiddenFields; @property (nonatomic, strong) NSMutableDictionary *hiddenSections; @property (nonatomic, strong) NSArray *disabledFieldsIDs; @property (nonatomic, strong) NSMutableDictionary *values; - (instancetype)initWithJSON:(id)JSON initialValues:(NSDictionary *)initialValues disabledFieldIDs:(NSArray *)disabledFieldIDs disabled:(BOOL)disabled; - (instancetype)initWithForms:(NSMutableArray *)forms initialValues:(NSDictionary *)initialValues; - (NSArray *)invalidFormFields; - (NSDictionary *)requiredFormFields; - (NSMutableDictionary *)valuesForFormula:(HYPFormField *)field; - (HYPFormField *)fieldWithID:(NSString *)fieldID withIndexPath:(BOOL)withIndexPath; @end
Remove fieldWithID:withIndexPath:inForms: from public header
Remove fieldWithID:withIndexPath:inForms: from public header
C
mit
KevinJacob/Form,0x73/Form,wangmb/Form,Jamonek/Form,Jamonek/Form,0x73/Form,wangmb/Form,KevinJacob/Form,Jamonek/Form,fhchina/Form,kalsariyac/Form,wangmb/Form,KevinJacob/Form,steve21124/Form,steve21124/Form,kalsariyac/Form,fhchina/Form,kalsariyac/Form,steve21124/Form,fhchina/Form
829b6a1e37d7edc599d146618905fb878dd547ee
cvrp/customer.h
cvrp/customer.h
#ifndef VRPSOLVER_CUSTOMER_H #define VRPSOLVER_CUSTOMER_H namespace VrpSolver { class Customer { public: Customer(unsigned int id, std::size_t demand) : id_(id), demand_(demand) {} unsigned int id() const { return id_; } std::size_t demand() const { return demand_; } private: Customer(); unsigned int id_; std::size_t demand_; }; } // namespace VrpSolver #endif // VRPSOLVER_CUSTOMER_H
#ifndef VRPSOLVER_CUSTOMER_H #define VRPSOLVER_CUSTOMER_H namespace VrpSolver { class Customer { public: Customer(std::size_t id, std::size_t demand) : id_(id), demand_(demand) {} std::size_t id() const { return id_; } std::size_t demand() const { return demand_; } private: Customer(); std::size_t id_; std::size_t demand_; }; } // namespace VrpSolver #endif // VRPSOLVER_CUSTOMER_H
Change the type of Customer::id to std::size_t
Change the type of Customer::id to std::size_t
C
mit
U-MA/cvrp,U-MA/cvrp
0decd1c40a34be040381594fd396baee29c14868
Pbind/Classes/Client/_PBRequest.h
Pbind/Classes/Client/_PBRequest.h
// // PBRequest.h // Pbind <https://github.com/wequick/Pbind> // // Created by galen on 15/2/12. // Copyright (c) 2015-present, Wequick.net. All rights reserved. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <Foundation/Foundation.h> /** An instance of PBRequest defines the base factors of fetching a data. @discussion Cause the private ProtocolBuffer.framework use the same class name, we had to rename it as _PBRequest, but owe to the ability of `@compatibility_alias` annotation, we can also use PBRequest in our source code. */ @interface _PBRequest : NSObject @property (nonatomic, strong) NSString *action; // Interface action. @property (nonatomic, strong) NSString *method; // Interface action. @property (nonatomic, strong) NSDictionary *params; // Major params. @property (nonatomic, strong) NSDictionary *extParams; // Minor params. /** Whether the response data should be mutable, default is NO. @discussion if set to YES then will convert all the response data from NSDictionary to PBDictionary in nested. */ @property (nonatomic, assign) BOOL requiresMutableResponse; @end @compatibility_alias PBRequest _PBRequest;
// // PBRequest.h // Pbind <https://github.com/wequick/Pbind> // // Created by galen on 15/2/12. // Copyright (c) 2015-present, Wequick.net. All rights reserved. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <Foundation/Foundation.h> /** An instance of PBRequest defines the base factors of fetching a data. @discussion Cause the private ProtocolBuffer.framework use the same class name, we had to rename it as _PBRequest, but owe to the ability of `@compatibility_alias` annotation, we can also use PBRequest in our source code. */ @interface _PBRequest : NSObject /** The API name for the request. */ @property (nonatomic, strong) NSString *action; /** The method for the request which defined in RESTFul way. @discussion Include: - get - post - put - patch - delete */ @property (nonatomic, strong) NSString *method; /** The parameters for the request. */ @property (nonatomic, strong) NSDictionary *params; /** Whether the response data should be mutable, default is NO. @discussion if set to YES then will convert all the response data from NSDictionary to PBDictionary in nested. */ @property (nonatomic, assign) BOOL requiresMutableResponse; @end @compatibility_alias PBRequest _PBRequest;
Add comments for header file
Add comments for header file
C
mit
wequick/Pbind,wequick/Pbind,wequick/Pbind
7e608001d3125713d007e00b1b08f71abe6d48d4
parameters.h
parameters.h
#ifndef __MY_PARAMETERS_H__ #define __MY_PARAMETERS_H__ #define USE_GCLOCK #define PER_CPU const int AIO_DEPTH_PER_FILE = 32; const int IO_QUEUE_SIZE = AIO_DEPTH_PER_FILE * 5; const int MAX_FETCH_REQS = AIO_DEPTH_PER_FILE; const int MSG_SEND_BUF_SIZE = 10; /** * The number of requests issued by user applications * in one access. */ const int NUM_REQS_BY_USER = 100; /** * The initial size of the queue for pending IO requests * in the global cache. */ const int INIT_GCACHE_PENDING_SIZE = NUM_REQS_BY_USER * 10; /** * The min size of IO vector allocated for an IO request.. */ const int MIN_NUM_ALLOC_IOVECS = 16; const int NUM_EMBEDDED_IOVECS = 1; /** * The maximal size of IO vector issued by the global cache. * The experiment shows AIO with 16 pages in a request can achieve * the best performance. */ const int MAX_NUM_IOVECS = 16; #endif
#ifndef __MY_PARAMETERS_H__ #define __MY_PARAMETERS_H__ #define USE_GCLOCK #define PER_CPU const int AIO_DEPTH_PER_FILE = 32; const int IO_QUEUE_SIZE = AIO_DEPTH_PER_FILE * 5; const int MAX_FETCH_REQS = AIO_DEPTH_PER_FILE; const int MSG_SEND_BUF_SIZE = 10; /** * The number of requests issued by user applications * in one access. */ const int NUM_REQS_BY_USER = 100; /** * The initial size of the queue for pending IO requests * in the global cache. */ const int INIT_GCACHE_PENDING_SIZE = NUM_REQS_BY_USER * 100; /** * The min size of IO vector allocated for an IO request.. */ const int MIN_NUM_ALLOC_IOVECS = 16; const int NUM_EMBEDDED_IOVECS = 1; /** * The maximal size of IO vector issued by the global cache. * The experiment shows AIO with 16 pages in a request can achieve * the best performance. */ const int MAX_NUM_IOVECS = 16; #endif
Increase the default pending IO queue size in global cache.
Increase the default pending IO queue size in global cache.
C
apache-2.0
icoming/FlashX,icoming/FlashGraph,zheng-da/FlashX,icoming/FlashX,silky/FlashGraph,flashxio/FlashX,flashxio/FlashX,icoming/FlashGraph,flashxio/FlashX,flashxio/FlashX,zheng-da/FlashX,icoming/FlashGraph,silky/FlashGraph,flashxio/FlashX,flashxio/FlashX,icoming/FlashGraph,icoming/FlashX,silky/FlashGraph,silky/FlashGraph,icoming/FlashX,zheng-da/FlashX,icoming/FlashGraph,zheng-da/FlashX,zheng-da/FlashX,icoming/FlashX,silky/FlashGraph
d704bbb47a97d087245552a1f28053bf167bd8f4
rbcoremidi.c
rbcoremidi.c
/* * rbcoremidi.c * rbcoremidi * * Created by cypher on 15.07.08. * Copyright 2008 Nuclear Squid. All rights reserved. * */ #include <ruby.h> VALUE crbCoreMidi; void Init_rbcoremidi (void) { // Add the initialization code of your module here. }
/* * Copyright 2008 Markus Prinz * Released unter an MIT licence * */ #include <ruby.h> VALUE crbCoreMidi; void Init_rbcoremidi (void) { // Add the initialization code of your module here. }
Update header + licence information
Update header + licence information
C
mit
cypher/rbcoremidi,cypher/rbcoremidi
8d4224fd16a6c8729e534919aac6d1a9eac3c6e9
mkchld.c
mkchld.c
#include <assert.h> #include <errno.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <stdlib.h> int main(int argc, char **argv) { pid_t pid; assert(argc > 0); if (argc < 2) { printf("usage: %s command [arguments...]\n", argv[0]); return 1; } pid = fork(); if (pid < 0) { perror("fork"); return 1; } if (pid == 0) { execvp(argv[1], argv + 1); perror("execvp"); return 1; } assert(pid > 0); if (wait(NULL) != pid) { perror("wait"); return 1; } return 0; }
#include <assert.h> #include <errno.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <stdlib.h> int main(int argc, char **argv) { pid_t pid; assert(argc > 0); if (argc < 2) { printf("usage: %s command [arguments...]\n", argv[0]); return 1; } pid = fork(); if (pid < 0) { perror("fork"); return 1; } if (pid == 0) { execvp(argv[1], argv + 1); perror(argv[1]); return 1; } assert(pid > 0); if (wait(NULL) != pid) { perror("wait"); return 1; } return 0; }
Update execvp error message on file not found
Update execvp error message on file not found
C
mit
joeljk13/mkchild
6f16758e72150da6b2d98d8fab9fff35ab0777e7
src/dawn/Unittest/UnittestLogger.h
src/dawn/Unittest/UnittestLogger.h
//===--------------------------------------------------------------------------------*- C++ -*-===// // _ // | | // __| | __ ___ ___ ___ // / _` |/ _` \ \ /\ / / '_ | // | (_| | (_| |\ V V /| | | | // \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain // // // This file is distributed under the MIT License (MIT). // See LICENSE.txt for details. // //===------------------------------------------------------------------------------------------===// #ifndef DAWN_UNITTEST_UNITTESTLOGGER_H #define DAWN_UNITTEST_UNITTESTLOGGER_H #include "dawn/Support/Logging.h" namespace dawn { /// @brief Simple logger to std::cout for debugging purposes class UnittestLogger : public LoggerInterface { public: void log(LoggingLevel level, const std::string& message, const char* file, int line) override; }; } // namespace dawn #endif
//===--------------------------------------------------------------------------------*- C++ -*-===// // _ // | | // __| | __ ___ ___ ___ // / _` |/ _` \ \ /\ / / '_ | // | (_| | (_| |\ V V /| | | | // \__,_|\__,_| \_/\_/ |_| |_| - Compiler Toolchain // // // This file is distributed under the MIT License (MIT). // See LICENSE.txt for details. // //===------------------------------------------------------------------------------------------===// #ifndef DAWN_UNITTEST_UNITTESTLOGGER_H #define DAWN_UNITTEST_UNITTESTLOGGER_H #include "dawn/Support/Logging.h" namespace dawn { /// @brief Simple logger to `std::cout` for debugging purposes /// @ingroup unittest class UnittestLogger : public LoggerInterface { public: void log(LoggingLevel level, const std::string& message, const char* file, int line) override; }; } // namespace dawn #endif
Add unittest to unittest group in doxygen
Add unittest to unittest group in doxygen
C
mit
twicki/dawn,twicki/dawn,twicki/dawn,MeteoSwiss-APN/dawn,MeteoSwiss-APN/dawn,twicki/dawn,MeteoSwiss-APN/dawn
79337800123739d13f1e05d7e52458f6fac33f76
qtssh/sshfilesystemmodel.h
qtssh/sshfilesystemmodel.h
#pragma once #include <QObject> #include <QAbstractItemModel> #include <QHash> class SshSFtp; class SshFilesystemNode; class SshFilesystemModel : public QAbstractItemModel { SshSFtp *m_provider; SshFilesystemNode *m_rootItem; QModelIndex m_root; QHash<int, QByteArray> m_roles; public: enum Roles { FileIconRole = Qt::DecorationRole, FilePathRole = Qt::UserRole + 1, FileNameRole = Qt::UserRole + 2, FilePermissions = Qt::UserRole + 3 }; SshFilesystemModel(SshSFtp *provider); // Basic functionality: QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &index) const; int rowCount(const QModelIndex &index = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QHash<int, QByteArray> roleNames() const; void setRootPath(QString root = "/"); };
#pragma once #include <QObject> #include <QAbstractItemModel> #include <QHash> class SshSFtp; class SshFilesystemNode; class SshFilesystemModel : public QAbstractItemModel { SshSFtp *m_provider; SshFilesystemNode *m_rootItem; QModelIndex m_root; QHash<int, QByteArray> m_roles; public: enum Roles { FileNameRole = Qt::UserRole + 1, FilePathRole = Qt::UserRole + 2, FileBaseNameRole = Qt::UserRole + 3, FileSuffixRole = Qt::UserRole + 4, FileSizeRole = Qt::UserRole + 5, FileLastModifiedRole = Qt::UserRole + 6, FileLastReadRole = Qt::UserRole +7, FileIsDirRole = Qt::UserRole + 8, FileUrlRole = Qt::UserRole + 9 }; SshFilesystemModel(SshSFtp *provider); // Basic functionality: QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &index) const; int rowCount(const QModelIndex &index = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QHash<int, QByteArray> roleNames() const; void setRootPath(QString root = "/"); };
Use same Roles as QQuickFolderListModel
SshFilesystemModel: Use same Roles as QQuickFolderListModel
C
bsd-3-clause
condo4/QtSsh
c2d5ab6940fb1d93bcec22278f066f9429fa669a
templates/ComponentsEntities.h
templates/ComponentsEntities.h
// THIS FILE IS AUTO GENERATED, EDIT AT YOUR OWN RISK //% L #ifndef COMPONENTS_ENTITIES_H_ #define COMPONENTS_ENTITIES_H_ //% L #include "Components.h" //% L {% for component in components %} #include "{{component.get_type_name()}}.h" {% endfor %} //% L // Entity definitions //% L {% for entity in entities %} //% L // Definition of {{entity.get_type_name()}} //% L class {{entity.get_type_name()}}: public Entity { //* The vtables for each entities are statically defined static const MessageHandler messageHandlers[]; static const int componentOffsets[]; //% L public: //* Default constructor {{entity.get_type_name()}}( {% for (i, attrib) in enumerate(general.common_entity_attributes) %} {% if i != 0 %}, {% endif %} {{attrib.get_declaration()}} {% endfor %} ); virtual ~{{entity.get_type_name()}}(); //% L //* The components {% for component in entity.get_components() %} {{component.get_type_name()}} {{component.get_variable_name()}}; {% endfor %} }; //% L {% endfor %} //% LL #endif // COMPONENTS_ENTITIES_H_ //% L
// THIS FILE IS AUTO GENERATED, EDIT AT YOUR OWN RISK //% L #ifndef COMPONENTS_ENTITIES_H_ #define COMPONENTS_ENTITIES_H_ //% L #include "Components.h" #include "ComponentImplementationInclude.h" //% L // Entity definitions //% L {% for entity in entities %} //% L // Definition of {{entity.get_type_name()}} //% L class {{entity.get_type_name()}}: public Entity { //* The vtables for each entities are statically defined static const MessageHandler messageHandlers[]; static const int componentOffsets[]; //% L public: //* Default constructor {{entity.get_type_name()}}( {% for (i, attrib) in enumerate(general.common_entity_attributes) %} {% if i != 0 %}, {% endif %} {{attrib.get_declaration()}} {% endfor %} ); virtual ~{{entity.get_type_name()}}(); //% L //* The components {% for component in entity.get_components() %} {{component.get_type_name()}} {{component.get_variable_name()}}; {% endfor %} }; //% L {% endfor %} //% LL #endif // COMPONENTS_ENTITIES_H_ //% L
Include the component implementation include helper instead of the individual components in Components.h.
Include the component implementation include helper instead of the individual components in Components.h.
C
bsd-3-clause
DaemonDevelopers/CBSE-Toolchain,DaemonDevelopers/CBSE-Toolchain,DaemonDevelopers/CBSE-Toolchain
1a266ba95249e635f44b78edcede6444940ba17c
test/profile/instrprof-error.c
test/profile/instrprof-error.c
// RUN: %clang_profgen -o %t -O3 %s // RUN: touch %t.profraw // RUN: chmod -w %t.profraw // RUN: env LLVM_PROFILE_FILE=%t.profraw LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s // RUN: chmod +w %t.profraw int main(int argc, const char *argv[]) { if (argc < 2) return 1; return 0; } // CHECK: LLVM Profile: Failed to write file
// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE="/" LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s int main(int argc, const char *argv[]) { if (argc < 2) return 1; return 0; } // CHECK: LLVM Profile: Failed to write file
Make a test work if run by the super-user
[profile] Make a test work if run by the super-user git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@264773 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
4bd83c842ab1cdc7245b2a6f78ca63047aa4062f
AFToolkit/ObjectProvider/AFObjectModel.h
AFToolkit/ObjectProvider/AFObjectModel.h
#pragma mark Forward Declarations @class AFObjectProvider; #pragma mark Type Definitions typedef void (^AFObjectUpdateBlock)(AFObjectProvider *provider, id object, NSDictionary *values); typedef id (^AFObjectCreateBlock)(AFObjectProvider *provider, NSDictionary *values); #pragma mark - Class Interface @interface AFObjectModel : NSObject #pragma mark - Properties @property (nonatomic, strong) Class myClass; @property (nonatomic, copy) NSArray *idProperties; @property (nonatomic, copy) NSDictionary *propertyKeyMap; @property (nonatomic, copy) NSDictionary *collectionTypeMap; @property (nonatomic, copy) AFObjectUpdateBlock updateBlock; @property (nonatomic, copy) AFObjectCreateBlock createBlock; #pragma mark - Constructors - (id)initWithClass: (Class)myClass idProperties: (NSArray *)idProperties propertyKeyMap: (NSDictionary *)propertyKeyMap collectionTypeMap: (NSDictionary *)collectionTypeMap updateBlock: (AFObjectUpdateBlock)updateBlock createBlock: (AFObjectCreateBlock)createBlock; #pragma mark - Static Methods + (id)objectModelWithClass: (Class)myClass idProperties: (NSArray *)idProperties propertyKeyMap: (NSDictionary *)propertyKeyMap collectionTypeMap: (NSDictionary *)collectionTypeMap updateBlock: (AFObjectUpdateBlock)updateBlock createBlock: (AFObjectCreateBlock)createBlock; @end // @interface AFObjectModel
#pragma mark Forward Declarations @class AFObjectProvider; #pragma mark Type Definitions typedef void (^AFObjectUpdateBlock)(id provider, id object, NSDictionary *values); typedef id (^AFObjectCreateBlock)(id provider, NSDictionary *values); #pragma mark - Class Interface @interface AFObjectModel : NSObject #pragma mark - Properties @property (nonatomic, strong) Class myClass; @property (nonatomic, copy) NSArray *idProperties; @property (nonatomic, copy) NSDictionary *propertyKeyMap; @property (nonatomic, copy) NSDictionary *collectionTypeMap; @property (nonatomic, copy) AFObjectUpdateBlock updateBlock; @property (nonatomic, copy) AFObjectCreateBlock createBlock; #pragma mark - Constructors - (id)initWithClass: (Class)myClass idProperties: (NSArray *)idProperties propertyKeyMap: (NSDictionary *)propertyKeyMap collectionTypeMap: (NSDictionary *)collectionTypeMap updateBlock: (AFObjectUpdateBlock)updateBlock createBlock: (AFObjectCreateBlock)createBlock; #pragma mark - Static Methods + (id)objectModelWithClass: (Class)myClass idProperties: (NSArray *)idProperties propertyKeyMap: (NSDictionary *)propertyKeyMap collectionTypeMap: (NSDictionary *)collectionTypeMap updateBlock: (AFObjectUpdateBlock)updateBlock createBlock: (AFObjectCreateBlock)createBlock; @end // @interface AFObjectModel
Update update and create block signatures.
Update update and create block signatures.
C
mit
mlatham/AFToolkit
6bab2c613d7fa70bb8514f89ab7455ede717142b
include/linux/irqreturn.h
include/linux/irqreturn.h
#ifndef _LINUX_IRQRETURN_H #define _LINUX_IRQRETURN_H /** * enum irqreturn * @IRQ_NONE interrupt was not from this device * @IRQ_HANDLED interrupt was handled by this device * @IRQ_WAKE_THREAD handler requests to wake the handler thread */ enum irqreturn { IRQ_NONE = (0 << 0), IRQ_HANDLED = (1 << 0), IRQ_WAKE_THREAD = (1 << 1), }; typedef enum irqreturn irqreturn_t; #define IRQ_RETVAL(x) ((x) != IRQ_NONE) #endif
#ifndef _LINUX_IRQRETURN_H #define _LINUX_IRQRETURN_H /** * enum irqreturn * @IRQ_NONE interrupt was not from this device * @IRQ_HANDLED interrupt was handled by this device * @IRQ_WAKE_THREAD handler requests to wake the handler thread */ enum irqreturn { IRQ_NONE = (0 << 0), IRQ_HANDLED = (1 << 0), IRQ_WAKE_THREAD = (1 << 1), }; typedef enum irqreturn irqreturn_t; #define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) #endif
Correct fuzzy and fragile IRQ_RETVAL() definition
genirq: Correct fuzzy and fragile IRQ_RETVAL() definition commit bedd30d986a0 ("genirq: make irqreturn_t an enum") blindly replaced "0" by "IRQ_NONE" in the "IRQ_RETVAL(x)" macro definition. However, as "x" is a condition, "0" meant "boolean false", not an irqreturn_t value. All of this worked, and kept working after the addition of IRQ_WAKE_THREAD, as - both "boolean false" and "IRQ_NONE" are "0" (for the comparison), - "boolean true" and "boolean false" nicely map to the correct values of "IRQ_HANDLED" and "IRQ_NONE" (for the return value). Correct the macro definition for clarity and future-proofness. Signed-off-by: Geert Uytterhoeven <0da414d9d963da4039c2a0525b1844228075aa58@linux-m68k.org> Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org> Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
65cb3326e30ef8a67eb1d4411ec563e91be6e9ae
brotli/dec/types.h
brotli/dec/types.h
/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Common types */ #ifndef BROTLI_DEC_TYPES_H_ #define BROTLI_DEC_TYPES_H_ #include <stddef.h> /* for size_t */ #ifndef _MSC_VER #include <inttypes.h> #ifdef __STRICT_ANSI__ #define BROTLI_INLINE #else /* __STRICT_ANSI__ */ #define BROTLI_INLINE inline #endif #else typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef unsigned long long int uint64_t; typedef long long int int64_t; #define BROTLI_INLINE __forceinline #endif /* _MSC_VER */ #endif /* BROTLI_DEC_TYPES_H_ */
/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Common types */ #ifndef BROTLI_DEC_TYPES_H_ #define BROTLI_DEC_TYPES_H_ #include <stddef.h> /* for size_t */ #ifndef _MSC_VER #include <inttypes.h> #if defined(__cplusplus) || !defined(__STRICT_ANSI__) \ || __STDC_VERSION__ >= 199901L #define BROTLI_INLINE inline #else #define BROTLI_INLINE #endif #else typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef unsigned long long int uint64_t; typedef long long int int64_t; #define BROTLI_INLINE __forceinline #endif /* _MSC_VER */ #endif /* BROTLI_DEC_TYPES_H_ */
Allow use of inline keyword in c++/c99 mode
Allow use of inline keyword in c++/c99 mode
C
mit
google/woff2,khaledhosny/woff2,rsheeter/woff2,anthrotype/woff2,bxchusun/le-huong-van,bxchusun/le-huong-van,seanjensengrey/font-compression-reference,bxchusun/le-huong-van,bxchusun/le-huong-van,seanjensengrey/font-compression-reference,seanjensengrey/font-compression-reference
142b3a0aa1e6c5d0addb914a13c3dd8755f89010
kmail/filterimporterexporter.h
kmail/filterimporterexporter.h
#ifndef __FILTERIMPORTEREXPORTER_H__ #define __FILTERIMPORTEREXPORTER_H__ #include <qvalueList.h> class KMFilter; class KConfig; namespace KMail { /** @short Utility class that provides persisting of filters to/from KConfig. @author Till Adam <till@kdab.net> */ class FilterImporterExporter { public: FilterImporterExporter( bool popFilter = false ); virtual ~FilterImporterExporter(); /** Export the given filter rules to a file which * is asked from the user. The list to export is also * presented for confirmation/selection. */ void exportFilters( const QValueList<KMFilter*> & ); /** Import filters. Ask the user where to import them from * and which filters to import. */ QValueList<KMFilter*> importFilters(); static void writeFiltersToConfig( const QValueList<KMFilter*>& filters, KConfig* config, bool bPopFilter ); static QValueList<KMFilter*> readFiltersFromConfig( KConfig* config, bool bPopFilter ); private: bool mPopFilter; }; } #endif /* __FILTERIMPORTEREXPORTER_H__ */
#ifndef __FILTERIMPORTEREXPORTER_H__ #define __FILTERIMPORTEREXPORTER_H__ #include <qvaluelist.h> class KMFilter; class KConfig; namespace KMail { /** @short Utility class that provides persisting of filters to/from KConfig. @author Till Adam <till@kdab.net> */ class FilterImporterExporter { public: FilterImporterExporter( bool popFilter = false ); virtual ~FilterImporterExporter(); /** Export the given filter rules to a file which * is asked from the user. The list to export is also * presented for confirmation/selection. */ void exportFilters( const QValueList<KMFilter*> & ); /** Import filters. Ask the user where to import them from * and which filters to import. */ QValueList<KMFilter*> importFilters(); static void writeFiltersToConfig( const QValueList<KMFilter*>& filters, KConfig* config, bool bPopFilter ); static QValueList<KMFilter*> readFiltersFromConfig( KConfig* config, bool bPopFilter ); private: bool mPopFilter; }; } #endif /* __FILTERIMPORTEREXPORTER_H__ */
Fix compilation for case-sensitive file systems.
Fix compilation for case-sensitive file systems. svn path=/branches/kdepim/enterprise/kdepim/; revision=728559
C
lgpl-2.1
lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi
d06957e790aef773f00332203d69cbb550bf44e7
src/cpp_wrapper/FlatFile.h
src/cpp_wrapper/FlatFile.h
/******************************************************************************/ /** @file @author Dana Klamut @brief The C++ implementation of a flat file dictionary. */ /******************************************************************************/ #if !defined(PROJECT_FLATFILE_H) #define PROJECT_FLATFILE_H #include "Dictionary.h" #include "../key_value/kv_system.h" #include "../dictionary/flat_file/flat_file_dictionary_handler.h" template<typename K, typename V> class FlatFile:public Dictionary<K, V> { public: /** @brief Registers a specific flat file dictionary instance. @details Registers functions for dictionary. @param type_key The type of keys to be stored in the dictionary. @param key_size The size of keys to be stored in the dictionary. @param value_size The size of the values to be stored in the dictionary. */ FlatFile( ion_key_type_t type_key, int key_size, int value_size, int dictionary_size ) { ffdict_init(&this->handler); this->initializeDictionary(type_key, key_size, value_size, dictionary_size); } }; #endif /* PROJECT_FLATFILE_H */
/******************************************************************************/ /** @file @author Dana Klamut @brief The C++ implementation of a flat file dictionary. */ /******************************************************************************/ #if !defined(PROJECT_FLATFILE_H) #define PROJECT_FLATFILE_H #include "Dictionary.h" #include "../key_value/kv_system.h" #include "../dictionary/flat_file/flat_file_dictionary_handler.h" template<typename K, typename V> class FlatFile:public Dictionary<K, V> { public: /** @brief Registers a specific flat file dictionary instance. @details Registers functions for dictionary. @param type_key The type of keys to be stored in the dictionary. @param key_size The size of keys to be stored in the dictionary. @param value_size The size of the values to be stored in the dictionary. @param dictionary_size The size desired for the dictionary. */ FlatFile( ion_key_type_t type_key, int key_size, int value_size, int dictionary_size ) { ffdict_init(&this->handler); this->initializeDictionary(type_key, key_size, value_size, dictionary_size); } }; #endif /* PROJECT_FLATFILE_H */
Update doxygen comments to reflect changes to flat file constructor
Update doxygen comments to reflect changes to flat file constructor
C
bsd-3-clause
iondbproject/iondb,iondbproject/iondb
4f133b2d11568f9e495cfa76ed1a61bed8b4c81c
sys/pc98/include/clock.h
sys/pc98/include/clock.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 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 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$ */ #ifndef _PC98_INCLUDE_CLOCK_H_ #define _PC98_INCLUDE_CLOCK_H_ #include <i386/clock.h> #endif /* _PC98_INCLUDE_CLOCK_H_ */
/*- * This file is in the public domain. */ /* $FreeBSD$ */ #include <i386/clock.h>
Remove my copyright. This file includes simply i386's one now.
Remove my copyright. This file includes simply i386's one now.
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
859f0d817daea24874bda1f07d350be481cc1012
sixtracklib/_impl/namespace_begin.h
sixtracklib/_impl/namespace_begin.h
#pragma once #if !defined( NS_CONCAT_ ) #define NS_CONCAT_( A, B ) A##B #endif /* !defined( NS_CONCAT ) */ #if !defined( NS_CONCAT ) #define NS_CONCAT( A, B ) NS_CONCAT_( A, B ) #endif /* !defined( NS_CONCAT ) */ #if !defined( NAMESPACE ) #define NAMESPACE #endif /* !defined( NAMESPACE ) */ #if !defined( NS ) #define NS(name) NS_CONCAT( NAMESPACE, name ) #endif /* !defined( NS ) */ /* end: sixtracklib/_impl/namespace_begin.h */
#pragma once #if !defined( NS_CONCAT_ ) #define NS_CONCAT_( A, B ) A##B #endif /* !defined( NS_CONCAT ) */ #if !defined( NS_CONCAT ) #define NS_CONCAT( A, B ) NS_CONCAT_( A, B ) #endif /* !defined( NS_CONCAT ) */ #if !defined( __NAMESPACE ) #define __NAMESPACE #endif /* !defined( __NAMESPACE ) */ #if !defined( NS ) #define NS(name) NS_CONCAT( __NAMESPACE, name ) #endif /* !defined( NS ) */ /* end: sixtracklib/_impl/namespace_begin.h */
Fix not yet corrected NAMESPACE macro
Fix not yet corrected NAMESPACE macro
C
lgpl-2.1
SixTrack/SixTrackLib,SixTrack/SixTrackLib,SixTrack/SixTrackLib,SixTrack/SixTrackLib
17c0d74dde5122245a19bd358e2471b0e3fce037
runtime/include/stdchpl.h
runtime/include/stdchpl.h
#ifndef _stdchpl_H_ #define _stdchpl_H_ #include "chplrt.h" #include <errno.h> #include <math.h> #include <float.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/time.h> #include <chpl_md.h> #include "arg.h" #include "config.h" #include "chplcast.h" #include "chplcgfns.h" #include "chpl-atomics.h" #include "chpl-comm.h" #include "chplcopygc.h" #include "chplexit.h" #include <chplfp.h> #include "chplio.h" #include "chplmath.h" #include "chpl-mem.h" #include "chplmemtrack.h" #include "chplsys.h" #include "chpl-tasks.h" #include "chpltimers.h" #include "chpltypes.h" #include "chplgpu.h" #include "error.h" #include "chpl-comm-compiler-macros.h" #endif
#ifndef _stdchpl_H_ #define _stdchpl_H_ #include "chplrt.h" #include <errno.h> #include <math.h> #include <float.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/time.h> #include <chpl_md.h> #include "arg.h" #include "config.h" #include "chplcast.h" #include "chplcgfns.h" #include "chpl-atomics.h" #include "chpl-comm.h" #include "chplcopygc.h" #include "chplexit.h" #include <chplfp.h> #include "chplio.h" #include "chplmath.h" #include "chpl-mem.h" #include "chplmemtrack.h" #include "chplsys.h" #include "chpl-tasks.h" #include "chpltimers.h" #include "chpltypes.h" #include "chplgpu.h" #include "error.h" #include "chplgmp.h" #include "chpl-comm-compiler-macros.h" #endif
Include "chplgmp.h" for the emitted code.
Include "chplgmp.h" for the emitted code. [Not reviewed, because seems obvious (now), small, and safe.] The r21083 change was a bit overenthusiastic in its removal of the inclusion of "chplgmp.h" into stdchpl.h and this the emitted code. Without that, tests that use GMP won't build. Put it back. git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@21107 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
C
apache-2.0
CoryMcCartan/chapel,hildeth/chapel,CoryMcCartan/chapel,chizarlicious/chapel,chizarlicious/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,sungeunchoi/chapel,hildeth/chapel,CoryMcCartan/chapel,hildeth/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,CoryMcCartan/chapel,sungeunchoi/chapel,sungeunchoi/chapel,chizarlicious/chapel,chizarlicious/chapel,sungeunchoi/chapel,chizarlicious/chapel,sungeunchoi/chapel,hildeth/chapel,CoryMcCartan/chapel,hildeth/chapel,hildeth/chapel,chizarlicious/chapel,chizarlicious/chapel,sungeunchoi/chapel,hildeth/chapel
6d6519a43a674622a617cef7171c6003ed85fc0b
src/include/index/index_util.h
src/include/index/index_util.h
//===----------------------------------------------------------------------===// // // Peloton // // index_util.h // // Identification: src/include/index/index_util.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===----------------------------------------------------------------------===// #pragma once #include "index/index.h" namespace peloton { namespace index { void ConstructIntervals(oid_t leading_column_id, const std::vector<Value> &values, const std::vector<oid_t> &key_column_ids, const std::vector<ExpressionType> &expr_types, std::vector<std::pair<Value, Value>> &intervals); void FindMaxMinInColumns(oid_t leading_column_id, const std::vector<Value> &values, const std::vector<oid_t> &key_column_ids, const std::vector<ExpressionType> &expr_types, std::map<oid_t, std::pair<Value, Value>> &non_leading_columns); bool HasNonOptimizablePredicate(const std::vector<ExpressionType> &expr_types); bool IsPointQuery(const IndexMetadata *metadata_p, const std::vector<oid_t> &tuple_column_id_list, const std::vector<ExpressionType> &expr_list); } // End index namespace } // End peloton namespace
//===----------------------------------------------------------------------===// // // Peloton // // index_util.h // // Identification: src/include/index/index_util.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===----------------------------------------------------------------------===// #pragma once #include "index/index.h" namespace peloton { namespace index { void ConstructIntervals(oid_t leading_column_id, const std::vector<Value> &values, const std::vector<oid_t> &key_column_ids, const std::vector<ExpressionType> &expr_types, std::vector<std::pair<Value, Value>> &intervals); void FindMaxMinInColumns(oid_t leading_column_id, const std::vector<Value> &values, const std::vector<oid_t> &key_column_ids, const std::vector<ExpressionType> &expr_types, std::map<oid_t, std::pair<Value, Value>> &non_leading_columns); bool HasNonOptimizablePredicate(const std::vector<ExpressionType> &expr_types); bool IsPointQuery(const IndexMetadata *metadata_p, const std::vector<oid_t> &tuple_column_id_list, const std::vector<ExpressionType> &expr_list, std::vector<std::pair<oid_t, oid_t>> &value_index_list); } // End index namespace } // End peloton namespace
Change interface of IsPointQuery() in header file
Change interface of IsPointQuery() in header file
C
apache-2.0
prashasthip/peloton,haojin2/peloton,malin1993ml/peloton,ShuxinLin/peloton,seojungmin/peloton,haojin2/peloton,AllisonWang/peloton,prashasthip/peloton,vittvolt/15721-peloton,AngLi-Leon/peloton,apavlo/peloton,jessesleeping/iso_peloton,seojungmin/peloton,malin1993ml/peloton,vittvolt/15721-peloton,phisiart/peloton-p3,AngLi-Leon/peloton,vittvolt/15721-peloton,phisiart/peloton-p3,PauloAmora/peloton,PauloAmora/peloton,cmu-db/peloton,ShuxinLin/peloton,apavlo/peloton,ShuxinLin/peloton,cmu-db/peloton,yingjunwu/peloton,cmu-db/peloton,prashasthip/peloton,ShuxinLin/peloton,eric-haibin-lin/peloton-1,yingjunwu/peloton,PauloAmora/peloton,cmu-db/peloton,vittvolt/peloton,phisiart/peloton-p3,phisiart/peloton-p3,eric-haibin-lin/peloton-1,AngLi-Leon/peloton,vittvolt/15721-peloton,yingjunwu/peloton,apavlo/peloton,phisiart/peloton-p3,eric-haibin-lin/peloton-1,AllisonWang/peloton,vittvolt/15721-peloton,prashasthip/peloton,yingjunwu/peloton,malin1993ml/peloton,eric-haibin-lin/peloton-1,malin1993ml/peloton,AngLi-Leon/peloton,eric-haibin-lin/peloton-1,vittvolt/15721-peloton,AllisonWang/peloton,malin1993ml/peloton,haojin2/peloton,wangziqi2016/peloton,apavlo/peloton,haojin2/peloton,AngLi-Leon/peloton,prashasthip/peloton,jessesleeping/iso_peloton,apavlo/peloton,seojungmin/peloton,seojungmin/peloton,vittvolt/peloton,PauloAmora/peloton,AngLi-Leon/peloton,wangziqi2016/peloton,cmu-db/peloton,vittvolt/peloton,vittvolt/peloton,AllisonWang/peloton,jessesleeping/iso_peloton,apavlo/peloton,phisiart/peloton-p3,ShuxinLin/peloton,vittvolt/peloton,yingjunwu/peloton,AllisonWang/peloton,wangziqi2016/peloton,cmu-db/peloton,AllisonWang/peloton,seojungmin/peloton,PauloAmora/peloton,wangziqi2016/peloton,jessesleeping/iso_peloton,jessesleeping/iso_peloton,jessesleeping/iso_peloton,malin1993ml/peloton,vittvolt/peloton,jessesleeping/iso_peloton,ShuxinLin/peloton,eric-haibin-lin/peloton-1,wangziqi2016/peloton,seojungmin/peloton,haojin2/peloton,PauloAmora/peloton,wangziqi2016/peloton,yingjunwu/peloton,prashasthip/peloton,haojin2/peloton
6e61eb443ffd8c2e9e5a7ebca80f3d2fda63fd12
Motif/Motif.h
Motif/Motif.h
// // Motif.h // Motif // // Created by Eric Horacek on 3/29/15. // Copyright (c) 2015 Eric Horacek. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for Motif. FOUNDATION_EXPORT double MotifVersionNumber; //! Project version string for Motif. FOUNDATION_EXPORT const unsigned char MotifVersionString[]; #import "MTFBackwardsCompatableNullability.h" #import "MTFTheme.h" #import "MTFThemeClass.h" #import "MTFThemeClassApplicable.h" #import "MTFDynamicThemeApplier.h" #import "MTFThemeParser.h" #import "NSObject+ThemeClassAppliers.h" #import "NSObject+ThemeClassName.h" #import "MTFReverseTransformedValueClass.h" #import "MTFObjCTypeValueTransformer.h" #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED #import "MTFScreenBrightnessThemeApplier.h" #import "MTFColorFromStringTransformer.h" #import "MTFEdgeInsetsFromStringTransformer.h" #import "MTFPointFromStringTransformer.h" #import "MTFRectFromStringTransformer.h" #import "MTFSizeFromStringTransformer.h" #endif
// // Motif.h // Motif // // Created by Eric Horacek on 3/29/15. // Copyright (c) 2015 Eric Horacek. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for Motif. FOUNDATION_EXPORT double MotifVersionNumber; //! Project version string for Motif. FOUNDATION_EXPORT const unsigned char MotifVersionString[]; #import <Motif/MTFBackwardsCompatableNullability.h> #import <Motif/MTFTheme.h> #import <Motif/MTFThemeClass.h> #import <Motif/MTFThemeClassApplicable.h> #import <Motif/MTFDynamicThemeApplier.h> #import <Motif/MTFThemeParser.h> #import <Motif/NSObject+ThemeClassAppliers.h> #import <Motif/NSObject+ThemeClassName.h> #import <Motif/MTFReverseTransformedValueClass.h> #import <Motif/MTFObjCTypeValueTransformer.h> #ifdef __IPHONE_OS_VERSION_MIN_REQUIRED #import <Motif/MTFScreenBrightnessThemeApplier.h> #import <Motif/MTFColorFromStringTransformer.h> #import <Motif/MTFEdgeInsetsFromStringTransformer.h> #import <Motif/MTFPointFromStringTransformer.h> #import <Motif/MTFRectFromStringTransformer.h> #import <Motif/MTFSizeFromStringTransformer.h> #endif
Use <> import syntax for umbrella header
Use <> import syntax for umbrella header
C
mit
jsslai/Motif,jsslai/Motif,ekurutepe/Motif,erichoracek/Motif,erichoracek/Motif,jlawton/Motif
27ef086cdd1037b2deaf58feeced028b2b8df154
app/tx/main.c
app/tx/main.c
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "radio.h" void radio_event_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; radio_packet_t packet; packet.len = 4; radio_init(radio_event_handler); NRF_GPIO->DIR = 1 << 18; while (1) { packet.data[0] = i++; packet.data[1] = 0x12; radio_send(&packet); NRF_GPIO->OUTSET = 1 << 18; nrf_delay_us(100000); NRF_GPIO->OUTCLR = 1 << 18; nrf_delay_us(100000); } }
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "radio.h" void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); NRF_GPIO->DIR = 1 << 18; while (1) { packet.data[0] = i++; packet.data[1] = 0x12; radio_send(&packet); NRF_GPIO->OUTSET = 1 << 18; nrf_delay_us(100000); NRF_GPIO->OUTCLR = 1 << 18; nrf_delay_us(100000); } }
Rename the radio event handler.
Rename the radio event handler.
C
bsd-3-clause
hlnd/nrf51-simple-radio,hlnd/nrf51-simple-radio
145d1d2ef55ac62417539d7e7d8adebe90b37808
testsuite/testing-tools/algorithm.h
testsuite/testing-tools/algorithm.h
/* * Copyright (c) 2015-2018 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_TESTSUITE_ALGORITHM_H_ #define CPPSORT_TESTSUITE_ALGORITHM_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <functional> #include <iterator> #include <cpp-sort/utility/as_function.h> #include <cpp-sort/utility/functional.h> namespace helpers { template< typename Iterator, typename Compare = std::less<>, typename Projection = cppsort::utility::identity > auto is_sorted(Iterator first, Iterator last, Compare compare={}, Projection projection={}) -> bool { auto&& comp = cppsort::utility::as_function(compare); auto&& proj = cppsort::utility::as_function(projection); for (auto it = std::next(first) ; it != last ; ++it) { if (comp(proj(*it), proj(*first))) { return false; } } return true; } template< typename ForwardIterator, typename T, typename Projection = cppsort::utility::identity > auto iota(ForwardIterator first, ForwardIterator last, T value, Projection projection={}) -> void { auto&& proj = cppsort::utility::as_function(projection); while (first != last) { proj(*first++) = value; ++value; } } } #endif // CPPSORT_TESTSUITE_ALGORITHM_H_
/* * Copyright (c) 2015-2021 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_TESTSUITE_ALGORITHM_H_ #define CPPSORT_TESTSUITE_ALGORITHM_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <functional> #include <cpp-sort/utility/as_function.h> #include <cpp-sort/utility/functional.h> namespace helpers { template< typename Iterator, typename Compare = std::less<>, typename Projection = cppsort::utility::identity > constexpr auto is_sorted(Iterator first, Iterator last, Compare compare={}, Projection projection={}) -> bool { auto&& comp = cppsort::utility::as_function(compare); auto&& proj = cppsort::utility::as_function(projection); if (first == last) { return true; } auto next = first; while (++next != last) { if (comp(proj(*next), proj(*first))) { return false; } ++first; } return true; } template< typename ForwardIterator, typename T, typename Projection = cppsort::utility::identity > auto iota(ForwardIterator first, ForwardIterator last, T value, Projection projection={}) -> void { auto&& proj = cppsort::utility::as_function(projection); while (first != last) { proj(*first++) = value; ++value; } } } #endif // CPPSORT_TESTSUITE_ALGORITHM_H_
Fix incorrect is_sorted implementation in the test suite
Fix incorrect is_sorted implementation in the test suite I'm not sure how this managed to slip under my radar since 2015, that's a bit embarrassing.
C
mit
Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort
c79713ed09ebd9ac54a52c573b47e86d33a39400
3RVX/Controllers/BrightnessController.h
3RVX/Controllers/BrightnessController.h
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #pragma comment(lib, "Dxva2.lib") #include <Windows.h> #include <HighLevelMonitorConfigurationAPI.h> class Monitor; class BrightnessController { public: BrightnessController(HMONITOR monitor); BrightnessController(Monitor &monitor); float Brightness(); void Brightness(float level); private: bool SupportsBrightnessAPI(PHYSICAL_MONITOR &pm); };
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #pragma comment(lib, "Dxva2.lib") #include <Windows.h> #include <HighLevelMonitorConfigurationAPI.h> class Monitor; class BrightnessController { public: BrightnessController(HMONITOR monitor); BrightnessController(Monitor &monitor); float Brightness(); void Brightness(float level); private: bool _useBrightnessAPI; bool SupportsBrightnessAPI(PHYSICAL_MONITOR &pm); };
Add bool for brightness API usage
Add bool for brightness API usage
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
1654c426db17e35b211fa86cea327c6b38d44317
src/devices/ram.h
src/devices/ram.h
#ifndef RAM_H_ #define RAM_H_ #define RAM_BASE (1ULL << 12) #define RAM_END ((1ULL << 16) - 1) #endif
#ifndef RAM_H_ #define RAM_H_ #define RAM_BASE (1ULL << 12) #define RAM_END ((1ULL << 14) - 1) #endif
Make assembly prologue match new memory map
Make assembly prologue match new memory map
C
mit
kulp/tenyr,kulp/tenyr,kulp/tenyr
6bfa5c586b87a36f742e0525e6c337074b68978d
arch/powerpc/include/asm/abs_addr.h
arch/powerpc/include/asm/abs_addr.h
#ifndef _ASM_POWERPC_ABS_ADDR_H #define _ASM_POWERPC_ABS_ADDR_H #ifdef __KERNEL__ /* * c 2001 PPC 64 Team, IBM Corp * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <linux/memblock.h> #include <asm/types.h> #include <asm/page.h> #include <asm/prom.h> #define phys_to_abs(pa) (pa) /* Convenience macros */ #define virt_to_abs(va) __pa(va) #define abs_to_virt(aa) __va(aa) #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_ABS_ADDR_H */
#ifndef _ASM_POWERPC_ABS_ADDR_H #define _ASM_POWERPC_ABS_ADDR_H #ifdef __KERNEL__ /* * c 2001 PPC 64 Team, IBM Corp * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <linux/memblock.h> #include <asm/types.h> #include <asm/page.h> #include <asm/prom.h> /* Convenience macros */ #define virt_to_abs(va) __pa(va) #define abs_to_virt(aa) __va(aa) #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_ABS_ADDR_H */
Remove phys_to_abs() now all users have been removed
powerpc: Remove phys_to_abs() now all users have been removed Signed-off-by: Michael Ellerman <17b9e1c64588c7fa6419b4d29dc1f4426279ba01@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
596ee1d8c4e7a34020579dfefcf86a8c5a0a1814
src/shlwapi_dll.c
src/shlwapi_dll.c
/** * Win32 UTF-8 wrapper * * ---- * * shlwapi.dll functions. */ #include <Shlwapi.h> #include "win32_utf8.h" BOOL STDAPICALLTYPE PathMatchSpecU( __in LPCSTR pszFile, __in LPCSTR pszSpec ) { BOOL ret; WCHAR_T_DEC(pszFile); WCHAR_T_DEC(pszSpec); WCHAR_T_CONV(pszFile); WCHAR_T_CONV(pszSpec); ret = PathMatchSpecW(pszFile_w, pszSpec_w); VLA_FREE(pszFile_w); VLA_FREE(pszSpec_w); return ret; } BOOL STDAPICALLTYPE PathFileExistsU( __in LPCSTR pszPath ) { BOOL ret; WCHAR_T_DEC(pszPath); WCHAR_T_CONV(pszPath); ret = PathFileExistsW(pszPath_w); VLA_FREE(pszPath_w); return ret; } BOOL STDAPICALLTYPE PathRemoveFileSpecU( __inout LPSTR pszPath ) { // Hey, let's re-write the function to also handle forward slashes // while we're at it! LPSTR newPath = PathFindFileNameA(pszPath); if((newPath) && (newPath != pszPath)) { newPath[0] = TEXT('\0'); return 1; } return 0; }
/** * Win32 UTF-8 wrapper * * ---- * * shlwapi.dll functions. */ #include <Shlwapi.h> #include "win32_utf8.h" BOOL STDAPICALLTYPE PathFileExistsU( __in LPCSTR pszPath ) { BOOL ret; WCHAR_T_DEC(pszPath); WCHAR_T_CONV_VLA(pszPath); ret = PathFileExistsW(pszPath_w); VLA_FREE(pszPath_w); return ret; } BOOL STDAPICALLTYPE PathMatchSpecU( __in LPCSTR pszFile, __in LPCSTR pszSpec ) { BOOL ret; WCHAR_T_DEC(pszFile); WCHAR_T_DEC(pszSpec); WCHAR_T_CONV(pszFile); WCHAR_T_CONV(pszSpec); ret = PathMatchSpecW(pszFile_w, pszSpec_w); VLA_FREE(pszFile_w); VLA_FREE(pszSpec_w); return ret; } BOOL STDAPICALLTYPE PathRemoveFileSpecU( __inout LPSTR pszPath ) { // Hey, let's re-write the function to also handle forward slashes // while we're at it! LPSTR newPath = PathFindFileNameA(pszPath); if((newPath) && (newPath != pszPath)) { newPath[0] = TEXT('\0'); return 1; } return 0; }
Reorder function definitions to match their order in the header file.
Reorder function definitions to match their order in the header file. This is driving me ma~d.
C
unlicense
thpatch/win32_utf8
e4fe1d72e8014e510cb2b308df1e353926f7ceab
src/dict.h
src/dict.h
/* Copyright (c) 2012 Fritz Grimpen * * Permission is hereby granted, unalloc of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define F_DICT_STRUCTS #include <f/dict.h> #define SLOT(h) (((h) * (F_DICT_SLOTS_COUNT - 1)) % F_DICT_SLOTS_COUNT) #define BUCKET(d, h) ((h) % (d)->buckets_cnt)
/* Copyright (c) 2012 Fritz Grimpen * * Permission is hereby granted, unalloc of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define F_DICT_STRUCTS #include <f/dict.h> #define SLOT(h) (((h) * (F_DICT_SLOTS_COUNT - 1)) & (F_DICT_SLOTS_COUNT - 1)) #define BUCKET(d, h) ((h) % (d)->buckets_cnt)
Replace modulo by AND gatter
Replace modulo by AND gatter
C
mit
fritz0705/libf
ddfac6ad96a03c3c6a5a638c4bf50ac00af8a58f
src/scenes/appConstants.h
src/scenes/appConstants.h
#pragma once // assume that visuals and code are the same here.... // and also assuming our screen is square :) #define VISUALS_WIDTH 504 #define VISUALS_HEIGHT 504 #define CODE_WIDTH VISUALS_WIDTH #define CODE_HEIGHT VISUALS_HEIGHT #define CODE_X_POS 520 // via the tech staff //if this is defined, we will wait for type animation #define TYPE_ANIMATION #define USE_MIDI_PARAM_SYNC // if this is defined, we will disable all sound playback inside this app, and instead send // OpenSoundControl messages which can be used to trigger sounds in another program (e.g. Ableton Live) //#define USE_EXTERNAL_SOUNDS
#pragma once // assume that visuals and code are the same here.... // and also assuming our screen is square :) #define VISUALS_WIDTH 504 #define VISUALS_HEIGHT 504 #define CODE_WIDTH VISUALS_WIDTH #define CODE_HEIGHT VISUALS_HEIGHT #define CODE_X_POS 520 // via the tech staff //if this is defined, we will wait for type animation //#define TYPE_ANIMATION #define USE_MIDI_PARAM_SYNC // if this is defined, we will disable all sound playback inside this app, and instead send // OpenSoundControl messages which can be used to trigger sounds in another program (e.g. Ableton Live) //#define USE_EXTERNAL_SOUNDS
Revert accidental uncommenting of TYPE_ANIMATION
Revert accidental uncommenting of TYPE_ANIMATION
C
mit
sh0w/recoded,sh0w/recoded,sh0w/recoded,ofZach/dayForNightSFPC,sh0w/recoded,ofZach/dayForNightSFPC,ofZach/dayForNightSFPC,ofZach/dayForNightSFPC
6ec5fad7e7122413b6e15d07f2ead6a5be8220b9
locks.h
locks.h
// -*- c++ -*- #ifndef LOCKS_H #define LOCKS_H #include <pthread.h> namespace locks { template <typename L> void unlocker(void* lock_ptr) { L* lock = (L*) lock_ptr; lock->unlock(); } template <typename L> void unlocker_checked(void* lock_ptr) { L& lock = *((L*) lock_ptr); if (lock) lock.unlock(); } } #endif /* LOCKS_H */
// -*- c++ -*- #ifndef LOCKS_H #define LOCKS_H #include <cstdio> #include <pthread.h> namespace locks { template <typename L> void unlocker(void* lock_ptr) { L* lock = (L*) lock_ptr; fprintf(stderr, "Releasing lock (unchecked) during cancellation!\n"); lock->unlock(); } template <typename L> void unlocker_checked(void* lock_ptr) { L& lock = *((L*) lock_ptr); if (lock.owns_lock()) { fprintf(stderr, "Releasing lock (checked) during cancellation!\n"); lock.unlock(); } } } #endif /* LOCKS_H */
Add logging etc. to lock release code.
Add logging etc. to lock release code.
C
lgpl-2.1
csw/libraft,csw/libraft
a1b4cdcacd8392ee180de0951263b0d5372fa7ce
src/list.h
src/list.h
#ifndef LIST_H #define LIST_H #define NEXT_NODE(node) node->next #define FINDTAILNODE(x) if(x)while(x->next)x=x->next; #define ADDNODEAFTER(x,t) if(x){t=x->next; x->next=malloc(sizeof(*t)); x->next->next=t;} #endif
#ifndef LIST_H #define LIST_H #define NEXT_NODE(node) node->next #define FINDTAILNODE(x) if(x)while(x->next)x=x->next; #define ADDNODE(x,t) if(x){t=x; x=malloc(sizeof(*x)); x->next=t;} #define ADDNODEAFTER(x,t) if(x){t=x->next; x->next=malloc(sizeof(*t)); x->next->next=t;} #endif
Add missing macro from last commit.
Add missing macro from last commit.
C
isc
heckendorfc/libyaml-dom
b39de78113a9c224df0026ccb9cc629fe3b187e7
src/util.h
src/util.h
#ifndef UTIL_H #define UTIL_H #include <chrono> #include <numeric> #include <iterator> #include <array> #include <algorithm> namespace util { class Timer { public: Timer() = default; Timer(bool start_running); ~Timer() = default; void start(); void stop(); float stop_seconds(); float seconds(); private: std::chrono::high_resolution_clock::time_point start_time; std::chrono::high_resolution_clock::time_point stop_time; }; namespace math { template<typename T> int mean(T collection) { return std::accumulate(std::begin(collection), std::end(collection), 0) / std::size(collection); } } // namespace math } // namespace util #endif // UTIL_H
#ifndef UTIL_H #define UTIL_H #include <chrono> #include <numeric> #include <iterator> #include <array> #include <algorithm> namespace util { class Timer { public: Timer() = default; Timer(bool start_running); ~Timer() = default; void start(); void stop(); float stop_seconds(); float seconds(); private: std::chrono::high_resolution_clock::time_point start_time; std::chrono::high_resolution_clock::time_point stop_time; }; namespace math { template<typename T> int mean(T collection) { if (std::size(collection) == 0) return 0; return std::accumulate(std::begin(collection), std::end(collection), 0) / std::size(collection); } } // namespace math } // namespace util #endif // UTIL_H
Fix possible divide by zero error
Fix possible divide by zero error
C
mit
jwkpeter/tincan
b9b636884725b783c3a33cf762148cbf19e0458d
test/lex.c
test/lex.c
// Copyright 2012 Rui Ueyama <rui314@gmail.com> // This program is free software licensed under the MIT license. #include "test.h" #define stringify(x) #x void digraph(void) { expect_string("[", stringify(<:)); expect_string("]", stringify(:>)); expect_string("{", stringify(<%)); expect_string("}", stringify(%>)); expect_string("#", stringify(%:)); expect_string("% :", stringify(% :)); expect_string("##", stringify(%:%:)); expect_string("#%", stringify(%:%)); } void escape(void) { int value = 10; expect(10, val\ ue); } void whitespace(void) { expect_string("x y", stringify( x y )); } void testmain(void) { print("lexer"); digraph(); escape(); whitespace(); }
// Copyright 2012 Rui Ueyama <rui314@gmail.com> // This program is free software licensed under the MIT license. #include "test.h" #define stringify(x) #x void digraph(void) { expect_string("[", stringify(<:)); expect_string("]", stringify(:>)); expect_string("{", stringify(<%)); expect_string("}", stringify(%>)); expect_string("#", stringify(%:)); expect_string("% :", stringify(% :)); expect_string("##", stringify(%:%:)); expect_string("#%", stringify(%:%)); } void escape(void) { int value = 10; expect(10, val\ ue); } void whitespace(void) { expect_string("x y", stringify( x y )); } void newline(void) { # } void testmain(void) { print("lexer"); digraph(); escape(); whitespace(); newline(); }
Add a test for line separator characters.
Add a test for line separator characters.
C
mit
jtramm/8cc,vastin/8cc,vastin/8cc,8l/8cc,vastin/8cc,nobody1986/8cc,rui314/8cc,cpjreynolds/8cc,abc00/8cc,nobody1986/8cc,gergo-/8cc,rui314/8cc,jtramm/8cc,andrewchambers/8cc,andrewchambers/8cc,nobody1986/8cc,cpjreynolds/8cc,8l/8cc,andrewchambers/8cc,abc00/8cc,andrewchambers/8cc,jtramm/8cc,cpjreynolds/8cc,jtramm/8cc,gergo-/8cc,abc00/8cc,nobody1986/8cc,rui314/8cc,cpjreynolds/8cc,8l/8cc,gergo-/8cc,vastin/8cc,rui314/8cc,8l/8cc,abc00/8cc
ebfe818d2eb3a5c4e27040f139ae3fb349f13865
common/math_defs.h
common/math_defs.h
#ifndef AL_MATH_DEFS_H #define AL_MATH_DEFS_H #include <math.h> #ifndef M_PI #define M_PI (3.14159265358979323846) #endif #define F_PI (3.14159265358979323846f) #define F_PI_2 (1.57079632679489661923f) #define F_TAU (6.28318530717958647692f) #define SQRTF_3 1.73205080756887719318f constexpr inline float Deg2Rad(float x) noexcept { return x * float{M_PI/180.0}; } constexpr inline float Rad2Deg(float x) noexcept { return x * float{180.0/M_PI}; } #endif /* AL_MATH_DEFS_H */
#ifndef AL_MATH_DEFS_H #define AL_MATH_DEFS_H #include <math.h> #ifndef M_PI #define M_PI (3.14159265358979323846) #endif #define F_PI (3.14159265358979323846f) #define F_PI_2 (1.57079632679489661923f) #define F_TAU (6.28318530717958647692f) #define SQRTF_3 1.73205080756887719318f constexpr inline float Deg2Rad(float x) noexcept { return x * static_cast<float>(M_PI/180.0); } constexpr inline float Rad2Deg(float x) noexcept { return x * static_cast<float>(180.0/M_PI); } #endif /* AL_MATH_DEFS_H */
Fix narrowing conversion from double to float
Fix narrowing conversion from double to float
C
lgpl-2.1
aaronmjacobs/openal-soft,aaronmjacobs/openal-soft
f7285e5f08b0b2aca0caf7fe03b897303c9981bd
Firmware/Inc/platform_hw.h
Firmware/Inc/platform_hw.h
#ifndef PLATFORM_HW_H__ #define PLATFORM_HW_H__ #include <stdbool.h> #include "color.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_hal_gpio.h" #define LED_CHAIN_LENGTH 10 #define USER_BUTTON_PORT (GPIOA) #define USER_BUTTON_PIN (GPIO_PIN_0) #define LED_SPI_INSTANCE (SPI1) #pragma pack(push) /* push current alignment to stack */ #pragma pack(1) /* set alignment to 1 byte boundary */ union platformHW_LEDRegister { uint8_t raw[4]; struct { //header/global brightness is 0bAAABBBBB //A = 1 //B = integer brightness divisor from 0x0 -> 0x1F uint8_t const header :3; //3 bits always, 5 bits global brightness, 8B, 8G, 8R //Glob = 0xE1 = min bright //uint8_t const globalHeader :8; uint8_t globalBrightness :5; struct color_ColorRGB color; }; }; #pragma pack(pop) /* restore original alignment from stack */ bool platformHW_Init(void); bool platformHW_SpiInit(SPI_HandleTypeDef * const spi, SPI_TypeDef* spiInstance); void platformHW_UpdateLEDs(SPI_HandleTypeDef* spi); #endif//PLATFORM_HW_H__
#ifndef PLATFORM_HW_H__ #define PLATFORM_HW_H__ #include <stdbool.h> #include "color.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_hal_gpio.h" #define LED_CHAIN_LENGTH 10 #define USER_BUTTON_PORT (GPIOA) #define USER_BUTTON_PIN (GPIO_PIN_0) #define LED_SPI_INSTANCE (SPI1) #pragma pack(push) /* push current alignment to stack */ #pragma pack(1) /* set alignment to 1 byte boundary */ union platformHW_LEDRegister { uint8_t raw[4]; struct { //3 bits always, 5 bits global brightness, 8B, 8G, 8R //Glob = 0xE1 = min bright uint8_t globalBrightness :5; //header/global brightness is 0bAAABBBBB //A = 1 //B = integer brightness divisor from 0x0 -> 0x1F uint8_t const header :3; struct color_ColorRGB color; }; }; #pragma pack(pop) /* restore original alignment from stack */ bool platformHW_Init(void); bool platformHW_SpiInit(SPI_HandleTypeDef * const spi, SPI_TypeDef* spiInstance); void platformHW_UpdateLEDs(SPI_HandleTypeDef* spi); #endif//PLATFORM_HW_H__
Fix incorrect LED header bit order
Fix incorrect LED header bit order
C
mit
borgel/sympetrum-v2,borgel/sympetrum-v2
067133a2658b611718a8b111d6c7824dfbf19f56
jet_string.h
jet_string.h
#ifndef CJET_STRING_H #define CJET_STRING_H #include <stdlib.h> #include <string.h> static inline char *duplicate_string(const char *s) { size_t length = strlen(s); char *new_string = malloc(length + 1); if (unlikely(new_string == NULL)) { return NULL; } strncpy(new_string, s, length + 1); return new_string; } #endif
#ifndef CJET_STRING_H #define CJET_STRING_H #include <stdlib.h> #include <string.h> static inline char *duplicate_string(const char *s) { size_t length = strlen(s); char *new_string = malloc(length + 1); if (unlikely(new_string != NULL)) { strncpy(new_string, s, length + 1); } return new_string; } #endif
Simplify string duplication function a bit.
Simplify string duplication function a bit.
C
mit
gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet
18e68bd789834bc6a044fdfc0f1de437cd16360c
usart0s.h
usart0s.h
/* usart0s.h - C interface to routine written in assembler Compile the corresponding assembler file with #define C_COMPAT_ASM_CODE 1 Copyright (c) 2015 Igor Mikolic-Torreira. All right reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef usart0s_h #define usart0s_h #include <stdint.h> #ifdef __cplusplus extern "C" { #endif void sendUSART0( uint8_t byteToSend ); #ifdef __cplusplus } #endif #endif
/* usart0s.h - C interface to routine written in assembler The MIT License (MIT) Copyright (c) 2015 Igor Mikolic-Torreira Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef usart0s_h #define usart0s_h #include <stdint.h> #ifdef __cplusplus extern "C" { #endif void enableUSART0(); void sendUSART0( uint8_t byteToSend ); #ifdef __cplusplus } #endif #endif
Revise license and add missing prototype
Revise license and add missing prototype
C
mit
igormiktor/ASMUtils
7c74772ff14401da9fde234334add253c8c11010
DungeonsOfNoudar486/include/RasterizerCommon.h
DungeonsOfNoudar486/include/RasterizerCommon.h
// // Created by monty on 27/08/16. // #ifndef BLANKSLATE_COMMON_H #define BLANKSLATE_COMMON_H namespace odb { #ifdef LOWRES using FixP = fixed_point<int16_t, -4>; #else using FixP = fixed_point<int32_t, -16>; #endif class Vec3 { public: FixP mX; FixP mY; FixP mZ; }; Vec3 operator+(const Vec3 &v1, const Vec3 &v2); Vec3 operator-(const Vec3 &v1, const Vec3 &v2); Vec3 &operator+=(Vec3 &v1, const Vec3 &v2); Vec3 &operator-=(Vec3 &v1, const Vec3 &v2); class Vec2 { public: FixP mX; FixP mY; }; } #endif //BLANKSLATE_COMMON_H
// // Created by monty on 27/08/16. // #ifndef BLANKSLATE_COMMON_H #define BLANKSLATE_COMMON_H namespace odb { #ifdef LOWRES using FixP = fixed_point<int16_t, -3>; #else using FixP = fixed_point<int32_t, -16>; #endif class Vec3 { public: FixP mX; FixP mY; FixP mZ; }; Vec3 operator+(const Vec3 &v1, const Vec3 &v2); Vec3 operator-(const Vec3 &v1, const Vec3 &v2); Vec3 &operator+=(Vec3 &v1, const Vec3 &v2); Vec3 &operator-=(Vec3 &v1, const Vec3 &v2); class Vec2 { public: FixP mX; FixP mY; }; } #endif //BLANKSLATE_COMMON_H
Bring the lower resolution version back from the dead
Bring the lower resolution version back from the dead Some textures look warped, but it mostly works.
C
bsd-2-clause
TheFakeMontyOnTheRun/dungeons-of-noudar,TheFakeMontyOnTheRun/dungeons-of-noudar
92429ddd879d22bb4d18e142ef0ff82d455f9be8
test/Analysis/func.c
test/Analysis/func.c
// RUN: clang -checker-simple -verify %s void f(void) { void (*p)(void); p = f; p = &f; p(); (*p)(); }
// RUN: clang -checker-simple -verify %s void f(void) { void (*p)(void); p = f; p = &f; p(); (*p)(); } void g(void (*fp)(void)); void f2() { g(f); }
Add test for SCA region store.
Add test for SCA region store. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@58235 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
4d0e6e5c7405ffa88b925a5b781cfb942da79882
sources/filechecker.h
sources/filechecker.h
#ifndef QTCSVFILECHECKER_H #define QTCSVFILECHECKER_H #include <QString> #include <QFileInfo> namespace QtCSV { // Check if path to csv file is valid // @input: // - filePath - string with absolute path to csv-file // @output: // - bool - True if file is OK, else False inline bool CheckFile(const QString& filePath) { QFileInfo fileInfo(filePath); if ( fileInfo.isAbsolute() && "csv" == fileInfo.suffix() ) { return true; } return false; } } #endif // QTCSVFILECHECKER_H
#ifndef QTCSVFILECHECKER_H #define QTCSVFILECHECKER_H #include <QString> #include <QFileInfo> #include <QDebug> namespace QtCSV { // Check if path to csv file is valid // @input: // - filePath - string with absolute path to csv-file // @output: // - bool - True if file is OK, else False inline bool CheckFile(const QString& filePath) { QFileInfo fileInfo(filePath); if ( fileInfo.isAbsolute() && fileInfo.isFile() ) { if ( "csv" != fileInfo.suffix() ) { qDebug() << __FUNCTION__ << "Warning - file suffix is not .csv"; } return true; } return false; } } #endif // QTCSVFILECHECKER_H
Remove requirement for a .csv suffix. Print warning if working with file that have suffix other than .csv
Remove requirement for a .csv suffix. Print warning if working with file that have suffix other than .csv
C
mit
apollo13/qtcsv,apollo13/qtcsv,iamantony/qtcsv,iamantony/qtcsv
fec3cd28f55fa0d220054c0034d5f55345006721
library/strings_format.h
library/strings_format.h
#pragma once #define TINYFORMAT_USE_VARIADIC_TEMPLATES #include "dependencies/tinyformat/tinyformat.h" #include "library/strings.h" namespace OpenApoc { template <typename... Args> static UString format(const UString &fmt, Args &&... args) { return tfm::format(fmt.cStr(), std::forward<Args>(args)...); } UString tr(const UString &str, const UString domain = "ufo_string"); } // namespace OpenApoc
#pragma once #define TINYFORMAT_USE_VARIADIC_TEMPLATES #ifdef __GNUC__ // Tinyformat has a number of non-annotated switch fallthrough cases #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #endif #include "dependencies/tinyformat/tinyformat.h" #ifdef __GNUC__ #pragma GCC diagnostic pop #endif #include "library/strings.h" namespace OpenApoc { template <typename... Args> static UString format(const UString &fmt, Args &&... args) { return tfm::format(fmt.cStr(), std::forward<Args>(args)...); } UString tr(const UString &str, const UString domain = "ufo_string"); } // namespace OpenApoc
Disable -Wimplicit-fallthrough when including tinyformat
Disable -Wimplicit-fallthrough when including tinyformat We assume anything that defines __GNUC__ also copes with GCC #pragmas
C
mit
pmprog/OpenApoc,steveschnepp/OpenApoc,steveschnepp/OpenApoc,Istrebitel/OpenApoc,Istrebitel/OpenApoc,pmprog/OpenApoc
732d189a86d86f281a8b779dce4e28365624f918
tests/regression/02-base/98-refine-unsigned.c
tests/regression/02-base/98-refine-unsigned.c
// PARAM: --enable ana.int.interval #include <stdlib.h> #include <assert.h> int main() { unsigned long ul; if (ul <= 0UL) { __goblint_check(ul == 0UL); } else { __goblint_check(ul != 0UL); } if (ul > 0UL) { __goblint_check(ul != 0UL); } else { __goblint_check(ul == 0UL); } if (! (ul > 0UL)) { __goblint_check(ul == 0UL); } else { __goblint_check(ul != 0UL); } unsigned int iu; if (iu <= 0UL) { __goblint_check(iu == 0UL); } else { __goblint_check(iu != 0UL); } if (iu > 0UL) { __goblint_check(iu != 0UL); } else { __goblint_check(iu == 0UL); } if (! (iu > 0UL)) { __goblint_check(iu == 0UL); } else { __goblint_check(iu != 0UL); } int i; if (! (i > 0)) { } else { __goblint_check(i != 0); } return 0; }
// PARAM: --enable ana.int.interval #include <stdlib.h> #include <assert.h> int main() { unsigned long ul; if (ul <= 0UL) { __goblint_check(ul == 0UL); } else { __goblint_check(ul != 0UL); } if (ul > 0UL) { __goblint_check(ul != 0UL); } else { __goblint_check(ul == 0UL); } if (! (ul > 0UL)) { __goblint_check(ul == 0UL); } else { __goblint_check(ul != 0UL); } unsigned int iu; if (iu <= 0UL) { __goblint_check(iu == 0UL); } else { __goblint_check(iu != 0UL); } if (iu > 0UL) { __goblint_check(iu != 0UL); } else { __goblint_check(iu == 0UL); } if (! (iu > 0UL)) { __goblint_check(iu == 0UL); } else { __goblint_check(iu != 0UL); } int i; if (! (i > 0)) { } else { __goblint_check(i != 0); } return 0; }
Remove trailing spaces in test case.
Remove trailing spaces in test case.
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
6ebd618ef522838e0478ebacfc60adc7ecc9d8fa
src/server/wsgi_version.h
src/server/wsgi_version.h
#ifndef WSGI_VERSION_H #define WSGI_VERSION_H /* ------------------------------------------------------------------------- */ /* * Copyright 2007-2021 GRAHAM DUMPLETON * * 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. */ /* ------------------------------------------------------------------------- */ /* Module version information. */ #define MOD_WSGI_MAJORVERSION_NUMBER 4 #define MOD_WSGI_MINORVERSION_NUMBER 9 #define MOD_WSGI_MICROVERSION_NUMBER 0 #define MOD_WSGI_VERSION_STRING "4.9.0" /* ------------------------------------------------------------------------- */ #endif /* vi: set sw=4 expandtab : */
#ifndef WSGI_VERSION_H #define WSGI_VERSION_H /* ------------------------------------------------------------------------- */ /* * Copyright 2007-2021 GRAHAM DUMPLETON * * 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. */ /* ------------------------------------------------------------------------- */ /* Module version information. */ #define MOD_WSGI_MAJORVERSION_NUMBER 4 #define MOD_WSGI_MINORVERSION_NUMBER 9 #define MOD_WSGI_MICROVERSION_NUMBER 1 #define MOD_WSGI_VERSION_STRING "4.9.1.dev1" /* ------------------------------------------------------------------------- */ #endif /* vi: set sw=4 expandtab : */
Increment version to 4.9.1 for new development work.
Increment version to 4.9.1 for new development work.
C
apache-2.0
GrahamDumpleton/mod_wsgi,GrahamDumpleton/mod_wsgi,GrahamDumpleton/mod_wsgi
48acc8c91b26cf424086151a6a625b663196b1c7
src/statistic_histogram.h
src/statistic_histogram.h
/* * statistic_histogram.h * */ #ifndef STATISTIC_HISTOGRAM_H_ #define STATISTIC_HISTOGRAM_H_ #include <stdio.h> #include <vector> class Statistic_histogram { public: Statistic_histogram(std::string h_name, const ssize_t domain_start, const ssize_t domain_end, const size_t range_size); void inc_val(uint64_t val); size_t report(char * report_buffer, size_t report_buffer_size); private: std::string name; ssize_t dstart; ssize_t dend; size_t rsize; typedef std::vector<uint64_t>::iterator hv_iterator; std::vector<uint64_t> hval; }; #endif /* STATISTIC_HISTOGRAM_H_ */
/* Copyright (c) 2015, Edward Haas All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of st_histogram nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. statistic_histogram.h */ #ifndef STATISTIC_HISTOGRAM_H_ #define STATISTIC_HISTOGRAM_H_ #include <stdio.h> #include <vector> class Statistic_histogram { public: Statistic_histogram(std::string h_name, const ssize_t domain_start, const ssize_t domain_end, const size_t range_size); void inc_val(uint64_t val); size_t report(char * report_buffer, size_t report_buffer_size); private: std::string name; ssize_t dstart; ssize_t dend; size_t rsize; typedef std::vector<uint64_t>::iterator hv_iterator; std::vector<uint64_t> hval; }; #endif /* STATISTIC_HISTOGRAM_H_ */
Update license in header file
Update license in header file
C
bsd-3-clause
EdDev/st_histogram,EdDev/st_histogram
3654f9926d4015a10d62ab6bb93087974d510daf
framegrab.h
framegrab.h
#ifndef FRAMEGRAB_H_ #define FRAMEGRAB_H_ #include <unistd.h> typedef void *fg_handle; /* fourcc constants */ #define FG_FORMAT_YUYV 0x56595559 #define FG_FORMAT_RGB24 0x33424752 struct fg_image { int width; int height; int format; }; fg_handle fg_init(char *, int); int fg_deinit(fg_handle); int fg_start(fg_handle); int fg_stop(fg_handle); int fg_set_format(fg_handle, struct fg_image *); int fg_get_format(fg_handle, struct fg_image *); int fg_get_frame(fg_handle, void *, size_t len); int fg_write_jpeg(char *, int, struct fg_image *, void *); #endif
#ifndef FRAMEGRAB_H_ #define FRAMEGRAB_H_ #ifdef __cplusplus extern "C" { #endif #include <stdlib.h> #if defined(_WIN32) && !defined(__CYGWIN__) # ifdef BUILDING_DLL # define EXPORT __declspec(dllexport) # else # define EXPORT __declspec(dllimport) # endif #elif __GNUC__ >= 4 || defined(__HP_cc) # define EXPORT __attribute__((visibility ("default"))) #elif defined(__SUNPRO_C) # define EXPORT __global #else # define EXPORT #endif typedef void *fg_handle; /* fourcc constants */ #define FG_FORMAT_YUYV 0x56595559 #define FG_FORMAT_RGB24 0x33424752 struct fg_image { int width; int height; int format; }; EXPORT fg_handle fg_init(char *, int); EXPORT int fg_deinit(fg_handle); EXPORT int fg_start(fg_handle); EXPORT int fg_stop(fg_handle); EXPORT int fg_set_format(fg_handle, struct fg_image *); EXPORT int fg_get_format(fg_handle, struct fg_image *); EXPORT int fg_get_frame(fg_handle, void *, size_t len); EXPORT int fg_write_jpeg(char *, int, struct fg_image *, void *); #ifdef __cplusplus } #endif #endif
Add C++ and shared library stuff to header file
Add C++ and shared library stuff to header file We're not using it yet, but it's a nice thing to have. Signed-off-by: Claudio Matsuoka <ef7f691d9947ca9adbfeb1538a53a661ec9f041b@gmail.com>
C
mit
cmatsuoka/framegrab,cmatsuoka/framegrab
f7faee03e671d7ac088951ed187e6f867e2255a5
test/Driver/sysroot.c
test/Driver/sysroot.c
// Check that --sysroot= also applies to header search paths. // RUN: %clang -ccc-host-triple unknown --sysroot=/FOO -### -E %s 2> %t1 // RUN: FileCheck --check-prefix=CHECK-SYSROOTEQ < %t1 %s // CHECK-SYSROOTEQ: "-cc1"{{.*}} "-isysroot" "/FOO" // Apple Darwin uses -isysroot as the syslib root, too. // RUN: touch %t2.o // RUN: %clang -ccc-host-triple i386-apple-darwin10 \ // RUN: -isysroot /FOO -### %t2.o 2> %t2 // RUN: FileCheck --check-prefix=CHECK-APPLE-ISYSROOT < %t2 %s // CHECK-APPLE-ISYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "/FOO" // Check that honor --sysroot= over -isysroot, for Apple Darwin. // RUN: touch %t3.o // RUN: %clang -ccc-host-triple i386-apple-darwin10 \ // RUN: -isysroot /FOO --sysroot=/BAR -### %t3.o 2> %t3 // RUN: FileCheck --check-prefix=CHECK-APPLE-SYSROOT < %t3 %s // CHECK-APPLE-SYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "/BAR"
// Check that --sysroot= also applies to header search paths. // RUN: %clang -ccc-host-triple i386-unk-unk --sysroot=/FOO -### -E %s 2> %t1 // RUN: FileCheck --check-prefix=CHECK-SYSROOTEQ < %t1 %s // CHECK-SYSROOTEQ: "-cc1"{{.*}} "-isysroot" "/FOO" // Apple Darwin uses -isysroot as the syslib root, too. // RUN: touch %t2.o // RUN: %clang -ccc-host-triple i386-apple-darwin10 \ // RUN: -isysroot /FOO -### %t2.o 2> %t2 // RUN: FileCheck --check-prefix=CHECK-APPLE-ISYSROOT < %t2 %s // CHECK-APPLE-ISYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "/FOO" // Check that honor --sysroot= over -isysroot, for Apple Darwin. // RUN: touch %t3.o // RUN: %clang -ccc-host-triple i386-apple-darwin10 \ // RUN: -isysroot /FOO --sysroot=/BAR -### %t3.o 2> %t3 // RUN: FileCheck --check-prefix=CHECK-APPLE-SYSROOT < %t3 %s // CHECK-APPLE-SYSROOT: "-arch" "i386"{{.*}} "-syslibroot" "/BAR"
Tweak test to at least use a standard arch, to ensure we try to invoke Clang.
tests: Tweak test to at least use a standard arch, to ensure we try to invoke Clang. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@130861 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,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,apple/swift-clang,llvm-mirror/clang
41f2f1829f3227b2d405feb75751ac5debfcc1e8
components/libc/compilers/minilibc/sys/types.h
components/libc/compilers/minilibc/sys/types.h
#ifndef __TYPES_H__ #define __TYPES_H__ typedef long off_t; typedef unsigned long size_t; typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef int mode_t; typedef unsigned long clockid_t; typedef int pid_t; typedef unsigned long clock_t; /* clock() */ #ifndef NULL #define NULL (0) #endif #define __u_char_defined #endif
#ifndef __TYPES_H__ #define __TYPES_H__ typedef long off_t; typedef unsigned long size_t; typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef int mode_t; typedef unsigned long clockid_t; typedef int pid_t; typedef int gid_t; typedef int uid_t; typedef int dev_t; typedef int ino_t; typedef int mode_t; typedef int caddr_t; typedef unsigned int wint_t; typedef unsigned long useconds_t; typedef unsigned long clock_t; /* clock() */ #ifndef NULL #define NULL (0) #endif #define __u_char_defined #endif
Add more typedef in minilibc.
[libc] Add more typedef in minilibc.
C
apache-2.0
geniusgogo/rt-thread,weety/rt-thread,nongxiaoming/rt-thread,weiyuliang/rt-thread,ArdaFu/rt-thread,nongxiaoming/rt-thread,AubrCool/rt-thread,FlyLu/rt-thread,armink/rt-thread,weiyuliang/rt-thread,FlyLu/rt-thread,hezlog/rt-thread,RT-Thread/rt-thread,hezlog/rt-thread,armink/rt-thread,armink/rt-thread,yongli3/rt-thread,hezlog/rt-thread,yongli3/rt-thread,weety/rt-thread,hezlog/rt-thread,zhaojuntao/rt-thread,weety/rt-thread,igou/rt-thread,igou/rt-thread,hezlog/rt-thread,hezlog/rt-thread,weiyuliang/rt-thread,gbcwbz/rt-thread,weety/rt-thread,FlyLu/rt-thread,AubrCool/rt-thread,ArdaFu/rt-thread,FlyLu/rt-thread,nongxiaoming/rt-thread,ArdaFu/rt-thread,weiyuliang/rt-thread,igou/rt-thread,FlyLu/rt-thread,igou/rt-thread,gbcwbz/rt-thread,geniusgogo/rt-thread,weiyuliang/rt-thread,AubrCool/rt-thread,zhaojuntao/rt-thread,zhaojuntao/rt-thread,wolfgangz2013/rt-thread,geniusgogo/rt-thread,igou/rt-thread,wolfgangz2013/rt-thread,AubrCool/rt-thread,gbcwbz/rt-thread,ArdaFu/rt-thread,weety/rt-thread,weety/rt-thread,gbcwbz/rt-thread,armink/rt-thread,RT-Thread/rt-thread,nongxiaoming/rt-thread,zhaojuntao/rt-thread,gbcwbz/rt-thread,gbcwbz/rt-thread,RT-Thread/rt-thread,wolfgangz2013/rt-thread,AubrCool/rt-thread,geniusgogo/rt-thread,geniusgogo/rt-thread,nongxiaoming/rt-thread,nongxiaoming/rt-thread,weiyuliang/rt-thread,AubrCool/rt-thread,RT-Thread/rt-thread,igou/rt-thread,RT-Thread/rt-thread,ArdaFu/rt-thread,yongli3/rt-thread,geniusgogo/rt-thread,armink/rt-thread,yongli3/rt-thread,AubrCool/rt-thread,RT-Thread/rt-thread,zhaojuntao/rt-thread,wolfgangz2013/rt-thread,yongli3/rt-thread,armink/rt-thread,ArdaFu/rt-thread,zhaojuntao/rt-thread,weety/rt-thread,yongli3/rt-thread,yongli3/rt-thread,zhaojuntao/rt-thread,weiyuliang/rt-thread,igou/rt-thread,gbcwbz/rt-thread,wolfgangz2013/rt-thread,nongxiaoming/rt-thread,FlyLu/rt-thread,wolfgangz2013/rt-thread,hezlog/rt-thread,geniusgogo/rt-thread,armink/rt-thread,RT-Thread/rt-thread,ArdaFu/rt-thread,FlyLu/rt-thread,wolfgangz2013/rt-thread
839a6a1504ffd335c43a8ad27043c51aecacecd1
OLEContainerScrollView/OLEContainerScrollView+Swizzling.h
OLEContainerScrollView/OLEContainerScrollView+Swizzling.h
/* OLEContainerScrollView Copyright (c) 2014 Ole Begemann. https://github.com/ole/OLEContainerScrollView */ void swizzleUICollectionViewLayoutFinalizeCollectionViewUpdates(); void swizzleUITableView();
/* OLEContainerScrollView Copyright (c) 2014 Ole Begemann. https://github.com/ole/OLEContainerScrollView */ void swizzleUICollectionViewLayoutFinalizeCollectionViewUpdates(void); void swizzleUITableView(void);
Fix compiler warning in Xcode 9
Fix compiler warning in Xcode 9
C
mit
ole/OLEContainerScrollView
a0bbb6ec64c6a6a74231206368be6af0c3d4d5e9
DominantColor/Shared/INVector3.h
DominantColor/Shared/INVector3.h
// // INVector3.h // DominantColor // // Created by Indragie on 12/21/14. // Copyright (c) 2014 Indragie Karunaratne. All rights reserved. // #import <GLKit/GLKit.h> // Wrapping GLKVector3 values in a struct so that it can be used from Swift. typedef struct { float x; float y; float z; } INVector3; GLKVector3 INVector3ToGLKVector3(INVector3 vector); INVector3 GLKVector3ToINVector3(GLKVector3 vector); INVector3 INVector3Add(INVector3 v1, INVector3 v2); INVector3 INVector3DivideScalar(INVector3 vector, float scalar);
// // INVector3.h // DominantColor // // Created by Indragie on 12/21/14. // Copyright (c) 2014 Indragie Karunaratne. All rights reserved. // #import <GLKit/GLKit.h> // Wrapping GLKVector3 values in a struct so that it can be used from Swift. typedef struct { float x; float y; float z; } INVector3; GLKVector3 INVector3ToGLKVector3(INVector3 vector); INVector3 GLKVector3ToINVector3(GLKVector3 vector);
Remove function declarations from header
Remove function declarations from header
C
mit
objcio/DominantColor,lydonchandra/DominantColor,indragiek/DominantColor,objcio/DominantColor,marinehero/DominantColor,objcio/DominantColor,marinehero/DominantColor,marinehero/DominantColor,lydonchandra/DominantColor,lydonchandra/DominantColor,objcio/DominantColor,indragiek/DominantColor,indragiek/DominantColor,marinehero/DominantColor
baf1cdaeb105781fd457bfd9d2a161e17c272a2d
tests/utils/core-utils.h
tests/utils/core-utils.h
/* * This file is part of meego-im-framework * * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * Contact: Nokia Corporation (directui@nokia.com) * * If you have questions regarding the use of this file, please contact * Nokia at directui@nokia.com. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1 as published by the Free Software Foundation * and appearing in the file LICENSE.LGPL included in the packaging * of this file. */ #ifndef CORE_UTILS_H__ #define CORE_UTILS_H__ #include <QString> #include <QObject> namespace MaliitTestUtils { bool isTestingInSandbox(); QString getTestPluginPath(); QString getTestDataPath(); void waitForSignal(const QObject* object, const char* signal, int timeout); void waitAndProcessEvents(int waitTime); } #endif // CORE_UTILS_H__
/* * This file is part of meego-im-framework * * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * Contact: Nokia Corporation (directui@nokia.com) * * If you have questions regarding the use of this file, please contact * Nokia at directui@nokia.com. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1 as published by the Free Software Foundation * and appearing in the file LICENSE.LGPL included in the packaging * of this file. */ #ifndef CORE_UTILS_H__ #define CORE_UTILS_H__ #include <QString> #include <QObject> #include "abstractsurfacegroup.h" #include "abstractsurfacegroupfactory.h" namespace MaliitTestUtils { bool isTestingInSandbox(); QString getTestPluginPath(); QString getTestDataPath(); void waitForSignal(const QObject* object, const char* signal, int timeout); void waitAndProcessEvents(int waitTime); class TestSurfaceGroup : public Maliit::Server::AbstractSurfaceGroup { public: TestSurfaceGroup() {} Maliit::Plugins::AbstractSurfaceFactory *factory() { return 0; } void activate() {} void deactivate() {} void setRotation(Maliit::OrientationAngle) {} }; class TestSurfaceGroupFactory : public Maliit::Server::AbstractSurfaceGroupFactory { public: TestSurfaceGroupFactory() {} QSharedPointer<Maliit::Server::AbstractSurfaceGroup> createSurfaceGroup() { return QSharedPointer<Maliit::Server::AbstractSurfaceGroup>(new TestSurfaceGroup); } }; } #endif // CORE_UTILS_H__
Add surface server side implementation for tests
Add surface server side implementation for tests Add a TestSurfaceGroup and TestSurfaceGroupFactory class for tests. RevBy: TrustMe. Full, original commit at 4dc9c4567301f2481b12965bdcf02a7281963b61 in maliit-framework
C
lgpl-2.1
maliit/inputcontext-gtk,maliit/inputcontext-gtk
e250aa36cd2bf836fabaa32905e76e800b0fc756
src/qt/qtipcserver.h
src/qt/qtipcserver.h
#ifndef QTIPCSERVER_H #define QTIPCSERVER_H // Define Bitcoin-Qt message queue name #define BITCOINURI_QUEUE_NAME "BitcoinURI" void ipcScanRelay(int argc, char *argv[]); void ipcInit(int argc, char *argv[]); #endif // QTIPCSERVER_H
#ifndef QTIPCSERVER_H #define QTIPCSERVER_H // Define Bitcoin-Qt message queue name #define BITCOINURI_QUEUE_NAME "NovaCoinURI" void ipcScanRelay(int argc, char *argv[]); void ipcInit(int argc, char *argv[]); #endif // QTIPCSERVER_H
Set correct name for boost IPC
Set correct name for boost IPC
C
mit
ALEXIUMCOIN/alexium,landcoin-ldc/landcoin,IOCoin/DIONS,IOCoin/DIONS,Rimbit/Wallets,gades/novacoin,ALEXIUMCOIN/alexium,valorbit/valorbit,nochowderforyou/clams,nochowderforyou/clams,nochowderforyou/clams,rat4/blackcoin,vectorcoindev/Vector,iadix/iadixcoin,thunderrabbit/clams,MOIN/moin,CoinBlack/bitcoin,iadix/iadixcoin,Kefkius/clams,vectorcoindev/Vector,novacoin-project/novacoin,novacoin-project/novacoin,lateminer/DopeCoinGold,byncoin-project/byncoin,elambert2014/novacoin,okcashpro/okcash,AquariusNetwork/ARCO,iadix/iadixcoin,Whitecoin-org/Whitecoin,pinkmagicdev/SwagBucks,Jheguy2/Mercury,shadowproject/shadow,ALEXIUMCOIN/alexium,elambert2014/cbx2,thunderrabbit/clams,iadix/iadixcoin,effectsToCause/vericoin,CoinBlack/blackcoin,fsb4000/novacoin,nochowderforyou/clams,elambert2014/cbx2,Kefkius/clams,robvanmieghem/clams,valorbit/valorbit-oss,shadowproject/shadow,benzhi888/renminbi,LanaCoin/lanacoin,iadix/iadixcoin,shadowproject/shadow,landcoin-ldc/landcoin,greencoin-dev/GreenCoinV2,GeopaymeEE/e-goldcoin,fsb4000/novacoin,som4paul/BolieC,landcoin-ldc/landcoin,Whitecoin-org/Whitecoin,Kefkius/clams,IOCoin/DIONS,thunderrabbit/clams,MOIN/moin,IOCoin/iocoin,robvanmieghem/clams,valorbit/valorbit-oss,okcashpro/okcash,nochowderforyou/clams,benzhi888/renminbi,novacoin-project/novacoin,som4paul/BolieC,VsyncCrypto/Vsync,CoinBlack/blackcoin,jyap808/jumbucks,TheoremCrypto/TheoremCoin,GeopaymeEE/e-goldcoin,blackcoinhelp/blackcoin,jyap808/jumbucks,IOCoin/iocoin,dopecoin-dev/DopeCoinGold,IOCoin/iocoin,Kefkius/clams,pinkmagicdev/SwagBucks,elambert2014/novacoin,gades/novacoin,VsyncCrypto/Vsync,greencoin-dev/GreenCoinV2,xranby/blackcoin,vectorcoindev/Vector,byncoin-project/byncoin,jyap808/jumbucks,elambert2014/novacoin,IOCoin/DIONS,pinkmagicdev/SwagBucks,novacoin-project/novacoin,ghostlander/Orbitcoin,xranby/blackcoin,valorbit/valorbit,iadix/iadixcoin,stamhe/novacoin,penek/novacoin,rat4/blackcoin,xranby/blackcoin,AquariusNetwork/ARCOv2,AquariusNetwork/ARCO,stamhe/novacoin,som4paul/BolieC,valorbit/valorbit-oss,TheoremCrypto/TheoremCoin,landcoin-ldc/landcoin,CoinBlack/bitcoin,LanaCoin/lanacoin,iadix/iadixcoin,dooglus/clams,prodigal-son/blackcoin,elambert2014/cbx2,rat4/blackcoin,blackcoinhelp/blackcoin,penek/novacoin,effectsToCause/vericoin,prodigal-son/blackcoin,IOCoin/iocoin,benzhi888/renminbi,lateminer/DopeCoinGold,CoinBlack/bitcoin,ghostlander/Orbitcoin,gades/novacoin,shadowproject/shadow,stamhe/novacoin,Jheguy2/Mercury,byncoin-project/byncoin,novacoin-project/novacoin,dooglus/clams,Jheguy2/Mercury,GeopaymeEE/e-goldcoin,AquariusNetwork/ARCOv2,shadowproject/shadow,ghostlander/Orbitcoin,robvanmieghem/clams,robvanmieghem/clams,valorbit/valorbit-oss,Whitecoin-org/Whitecoin,VsyncCrypto/Vsync,CoinBlack/blackcoin,robvanmieghem/clams,byncoin-project/byncoin,okcashpro/okcash,lateminer/DopeCoinGold,blackcoinhelp/blackcoin,AquariusNetwork/ARCOv2,elambert2014/cbx2,GeopaymeEE/e-goldcoin,okcashpro/okcash,MOIN/moin,CoinBlack/blackcoin,TheoremCrypto/TheoremCoin,pinkmagicdev/SwagBucks,Rimbit/Wallets,MOIN/moin,LanaCoin/lanacoin,effectsToCause/vericoin,thunderrabbit/clams,CoinBlack/bitcoin,effectsToCause/vericoin,ALEXIUMCOIN/alexium,gades/novacoin,TheoremCrypto/TheoremCoin,MOIN/moin,landcoin-ldc/landcoin,okcashpro/okcash,prodigal-son/blackcoin,byncoin-project/byncoin,iadix/iadixcoin,blackcoinhelp/blackcoin,dopecoin-dev/DopeCoinGold,vectorcoindev/Vector,MOIN/moin,som4paul/BolieC,fsb4000/novacoin,VsyncCrypto/Vsync,jyap808/jumbucks,dooglus/clams,vectorcoindev/Vector,elambert2014/novacoin,iadix/iadixcoin,CoinBlack/bitcoin,AquariusNetwork/ARCOv2,VsyncCrypto/Vsync,effectsToCause/vericoin,GeopaymeEE/e-goldcoin,AquariusNetwork/ARCO,AquariusNetwork/ARCOv2,rat4/blackcoin,valorbit/valorbit-oss,TheoremCrypto/TheoremCoin,Rimbit/Wallets,novacoin-project/novacoin,elambert2014/novacoin,Jheguy2/Mercury,stamhe/novacoin,lateminer/DopeCoinGold,stamhe/novacoin,dopecoin-dev/DopeCoinGold,penek/novacoin,AquariusNetwork/ARCO,iadix/iadixcoin,fsb4000/novacoin,xranby/blackcoin,IOCoin/iocoin,iadix/iadixcoin,dooglus/clams,dopecoin-dev/DopeCoinGold,som4paul/BolieC,jyap808/jumbucks,LanaCoin/lanacoin,gades/novacoin,greencoin-dev/GreenCoinV2,shadowproject/shadow,valorbit/valorbit,Whitecoin-org/Whitecoin,penek/novacoin,dooglus/clams,byncoin-project/byncoin,elambert2014/cbx2,Kefkius/clams,dopecoin-dev/DopeCoinGold,Rimbit/Wallets,okcashpro/okcash,IOCoin/DIONS,CoinBlack/bitcoin,valorbit/valorbit,pinkmagicdev/SwagBucks,greencoin-dev/GreenCoinV2,rat4/blackcoin,ghostlander/Orbitcoin,Jheguy2/Mercury,lateminer/DopeCoinGold,penek/novacoin,IOCoin/DIONS,penek/novacoin,elambert2014/novacoin,fsb4000/novacoin,thunderrabbit/clams,blackcoinhelp/blackcoin,valorbit/valorbit,ghostlander/Orbitcoin,IOCoin/DIONS,prodigal-son/blackcoin,ALEXIUMCOIN/alexium,gades/novacoin,benzhi888/renminbi,benzhi888/renminbi,LanaCoin/lanacoin,Whitecoin-org/Whitecoin,greencoin-dev/GreenCoinV2,IOCoin/DIONS,Rimbit/Wallets,prodigal-son/blackcoin,CoinBlack/blackcoin,fsb4000/novacoin,AquariusNetwork/ARCO
183797ed24d24f6dad3755e37e6053d60916dd5f
projects/sample/tools/sample/main.c
projects/sample/tools/sample/main.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "sample.h" int main (int argc, char ** argv) { printf ("%d\n", compute_sample (5)); exit (0); }
#include "sample.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main (int argc, char ** argv) { printf ("%d\n", compute_sample (5)); exit (0); }
Clean up the sample include orderings, not that it really matters...
Clean up the sample include orderings, not that it really matters... git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@169253 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap
f0d960a2d303d1b7f8ee3bca2d52eee15f4c853e
test/CodeGen/2008-07-31-promotion-of-compound-pointer-arithmetic.c
test/CodeGen/2008-07-31-promotion-of-compound-pointer-arithmetic.c
// RUN: clang -emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis | grep "ret i32 1" | count 3 // <rdr://6115726> int f0() { int x; unsigned short n = 1; int *a = &x; int *b = &x; a = a - n; b -= n; return a == b; } int f1(int *a) { int b = a - (int*) 1; a -= (int*) 1; return b == (int) a; } int f2(int n) { int *b = n + (int*) 1; n += (int*) 1; return b == (int*) n; }
// RUN: clang -emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis | grep "ret i32 1" | count 3 // <rdr://6115726> int f0() { int x; unsigned short n = 1; int *a = &x; int *b = &x; a = a - n; b -= n; return a == b; } int f1(int *a) { long b = a - (int*) 1; a -= (int*) 1; return b == (long) a; } int f2(long n) { int *b = n + (int*) 1; n += (int*) 1; return b == (int*) n; }
Fix testcase for 64-bit systems.
Fix testcase for 64-bit systems. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@59099 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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
f4370ff2104c52e41aa4a01935f22aae342e07f7
src/icalc/icalc/icalc.h
src/icalc/icalc/icalc.h
typedef CI_Config void*; CI_Result CI_submit(char const* input);
/* * C Interface between calcterm and a calculator. * A shared library must implement this interface * to be loadable by calcterm. */ extern "C" { struct CI_Config { int flag; }; struct CI_Result { char* one_line; char** grid; int y; }; void CI_init( CI_Config* config ); CI_Result* CI_submit( char const* input ); void CI_result_release( CI_Result* result ); } /* extern "C" */
Add a basic interface for calcterm
Add a basic interface for calcterm
C
bsd-2-clause
dpacbach/calcterm,dpacbach/calcterm,dpacbach/calcterm,dpacbach/calcterm
3e278c99fdb82b839fafd8972402440e952c2cd4
zephyr/projects/volteer/include/i2c_map.h
zephyr/projects/volteer/include/i2c_map.h
/* Copyright 2020 The Chromium OS 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 __ZEPHYR_CHROME_I2C_MAP_H #define __ZEPHYR_CHROME_I2C_MAP_H #include <devicetree.h> #include "config.h" /* We need registers.h to get the chip specific defines for now */ #include "registers.h" #define I2C_PORT_ACCEL I2C_PORT_SENSOR #define I2C_PORT_SENSOR NPCX_I2C_PORT0_0 #define I2C_PORT_USB_C0 NPCX_I2C_PORT1_0 #define I2C_PORT_USB_C1 NPCX_I2C_PORT2_0 #define I2C_PORT_USB_1_MIX NPCX_I2C_PORT3_0 #define I2C_PORT_POWER NPCX_I2C_PORT5_0 #define I2C_PORT_EEPROM NPCX_I2C_PORT7_0 #define I2C_ADDR_EEPROM_FLAGS 0x50 #endif /* __ZEPHYR_CHROME_I2C_MAP_H */
/* Copyright 2020 The Chromium OS 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 __ZEPHYR_CHROME_I2C_MAP_H #define __ZEPHYR_CHROME_I2C_MAP_H #include <devicetree.h> #include "config.h" /* We need registers.h to get the chip specific defines for now */ #include "i2c/i2c.h" #define I2C_PORT_ACCEL I2C_PORT_SENSOR #define I2C_PORT_SENSOR NAMED_I2C(sensor) #define I2C_PORT_USB_C0 NAMED_I2C(usb_c0) #define I2C_PORT_USB_C1 NAMED_I2C(usb_c1) #define I2C_PORT_USB_1_MIX NAMED_I2C(usb1_mix) #define I2C_PORT_POWER NAMED_I2C(power) #define I2C_PORT_EEPROM NAMED_I2C(eeprom) #define I2C_ADDR_EEPROM_FLAGS 0x50 #endif /* __ZEPHYR_CHROME_I2C_MAP_H */
Remove dependency on npcx specific registers
volteer: Remove dependency on npcx specific registers This change removes the dependency on the npcx specific headers which are normally included via registers.h. It instead transitions to relying on i2c/i2c.h which defines various enums and the NAMED_I2C macro. BUG=b:175249000 TEST=zmake testall Cq-Depend: chromium:2582819 Change-Id: I7d8e98cc4228496b0c7603c0794eb92e0f79c01d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/zephyr-chrome/+/2583272 Tested-by: Jack Rosenthal <d3f605bef1867f59845d4ce6e4f83b8dc9e4e0ae@chromium.org> Reviewed-by: Jack Rosenthal <d3f605bef1867f59845d4ce6e4f83b8dc9e4e0ae@chromium.org> Commit-Queue: Jack Rosenthal <d3f605bef1867f59845d4ce6e4f83b8dc9e4e0ae@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2630155 Reviewed-by: Simon Glass <c00b0378376498bd9cd974c388df8854c0131d27@chromium.org>
C
bsd-3-clause
coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec
ba61ebd978b1f3a7646f220ece3bab09c44c55cd
SSPSolution/SSPSolution/GameStateHandler.h
SSPSolution/SSPSolution/GameStateHandler.h
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> //#define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<GameState*> m_statesToRemove; public: GameStateHandler(); ~GameStateHandler(); int ShutDown(); int Initialize(ComponentHandler* cHandler, Camera* cameraRef); int Update(float dt, InputHandler* inputHandler); //Push a state to the stack int PushStateToStack(GameState* state); private: }; #endif
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> #define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<GameState*> m_statesToRemove; public: GameStateHandler(); ~GameStateHandler(); int ShutDown(); int Initialize(ComponentHandler* cHandler, Camera* cameraRef); int Update(float dt, InputHandler* inputHandler); //Push a state to the stack int PushStateToStack(GameState* state); private: }; #endif
UPDATE defined start without menu
UPDATE defined start without menu
C
apache-2.0
Chringo/SSP,Chringo/SSP
c43332e636fb372919959d58e25554dcb52148ba
src/shared/platform/win/nacl_exit.c
src/shared/platform/win/nacl_exit.c
/* * Copyright 2011 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can * be found in the LICENSE file. */ #include <stdlib.h> #include "native_client/src/include/portability.h" #include "native_client/src/shared/platform/nacl_exit.h" #include "native_client/src/trusted/service_runtime/nacl_signal.h" void NaClAbort(void) { #ifdef COVERAGE /* Give coverage runs a chance to flush coverage data */ exit((-SIGABRT) & 0xFF); #else /* Return an 8 bit value for SIGABRT */ TerminateProcess(GetCurrentProcess(),(-SIGABRT) & 0xFF); #endif } void NaClExit(int err_code) { #ifdef COVERAGE /* Give coverage runs a chance to flush coverage data */ exit(err_code); #else TerminateProcess(GetCurrentProcess(), err_code); #endif }
/* * Copyright 2011 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can * be found in the LICENSE file. */ #include <stdlib.h> #include <stdio.h> #include "native_client/src/include/portability.h" #include "native_client/src/shared/platform/nacl_exit.h" #include "native_client/src/trusted/service_runtime/nacl_signal.h" void NaClAbort(void) { NaClExit(-SIGABRT); } void NaClExit(int err_code) { #ifdef COVERAGE /* Give coverage runs a chance to flush coverage data */ exit(err_code); #else /* If the process is scheduled for termination, wait for it.*/ if (TerminateProcess(GetCurrentProcess(), err_code)) { printf("Terminate passed, but returned.\n"); while(1); } printf("Terminate failed with %d.\n", GetLastError()); /* Otherwise use the standard C process exit to bybass destructors. */ ExitProcess(err_code); #endif }
Fix exit issue on Vista/Win7Atom
Fix exit issue on Vista/Win7Atom TerminateProcess returns causing "exit" to fall through. This is causing the buildbots to go red. To fix this, We must add a check to verify termination was scheduled, then loop. As a seperate CL we should find a way to do this without allowing a return on an untrusted stack. BUG= nacl1618 TEST= buildbot Review URL: http://codereview.chromium.org/6804029 git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@4774 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
C
bsd-3-clause
nacl-webkit/native_client,nacl-webkit/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,nacl-webkit/native_client
e30fef0c0d6097e10595077076df1e2357802c21
INPopoverController/INPopoverControllerDefines.h
INPopoverController/INPopoverControllerDefines.h
// // INPopoverControllerDefines.h // Copyright 2011-2014 Indragie Karunaratne. All rights reserved. // typedef NS_ENUM(NSUInteger, INPopoverArrowDirection) { INPopoverArrowDirectionUndefined = 0, INPopoverArrowDirectionLeft = NSMaxXEdge, INPopoverArrowDirectionRight = NSMinXEdge, INPopoverArrowDirectionUp = NSMaxYEdge, INPopoverArrowDirectionDown = NSMinYEdge }; typedef NS_ENUM(NSInteger, INPopoverAnimationType) { INPopoverAnimationTypePop = 0, // Pop animation similar to NSPopover INPopoverAnimationTypeFadeIn, // Fade in only, no fade out INPopoverAnimationTypeFadeOut, // Fade out only, no fade in INPopoverAnimationTypeFadeInOut // Fade in and out };
// // INPopoverControllerDefines.h // Copyright 2011-2014 Indragie Karunaratne. All rights reserved. // typedef NS_ENUM(NSUInteger, INPopoverArrowDirection) { INPopoverArrowDirectionUndefined = 0, INPopoverArrowDirectionLeft, INPopoverArrowDirectionRight, INPopoverArrowDirectionUp, INPopoverArrowDirectionDown }; typedef NS_ENUM(NSInteger, INPopoverAnimationType) { INPopoverAnimationTypePop = 0, // Pop animation similar to NSPopover INPopoverAnimationTypeFadeIn, // Fade in only, no fade out INPopoverAnimationTypeFadeOut, // Fade out only, no fade in INPopoverAnimationTypeFadeInOut // Fade in and out };
Remove references to NS...Edge in enum
Remove references to NS...Edge in enum
C
bsd-2-clause
dbrisinda/INPopoverController,RobotsAndPencils/INPopoverController,bradjasper/INPopoverController
e6750f301c2a173eedd6d7222034168ce3490a60
Straw/STWServiceCall.h
Straw/STWServiceCall.h
#import <Foundation/Foundation.h> /** STWServiceCall is the domain model class which represents the Straw Service Call from Browser. */ @interface STWServiceCall : NSObject /** Service name to call */ @property (nonatomic, retain) NSString *service; /** Service Method name to call */ @property (nonatomic, retain) NSString *method; /** Service Method paramter to call */ @property (nonatomic, retain) NSDictionary *params; /** id of the Service Method call */ @property (nonatomic, retain) NSNumber *callId; /** Return the selector's name. @return the selector's name */ - (NSString *)selectorName; /** Return the selector corresponding to the method. @return the selector corresponding to the method */ - (SEL)selector; @end
#import <Foundation/Foundation.h> /** STWServiceCall is the domain model class which represents the Straw Service Call from Browser. */ @interface STWServiceCall : NSObject /** Service name to call */ @property (nonatomic, retain) NSString *service; /** Service Method name to call */ @property (nonatomic, retain) NSString *method; /** Service Method paramter to call */ @property (nonatomic, retain) NSDictionary *params; /** id of the Service Method call */ @property (nonatomic, retain) NSString *callId; /** Return the selector's name. @return the selector's name */ - (NSString *)selectorName; /** Return the selector corresponding to the method. @return the selector corresponding to the method */ - (SEL)selector; @end
Change the type of callId property
Change the type of callId property
C
mit
strawjs/straw-ios
a94670bd08cd52a19bf72223d63e2cc808b6b057
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 75 #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 76 #endif
Update Skia milestone to 76
Update Skia milestone to 76 Change-Id: I146f97bd27d17bffd51fc572ecee84552b238e20 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209160 Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com> Commit-Queue: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com> Auto-Submit: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
C
bsd-3-clause
HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,HalCanary/skia-hc,google/skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia
92ba6f31ba91bf1050ea11ba219d4f3dc1fce031
Pod/Classes/BFTaskCenter.h
Pod/Classes/BFTaskCenter.h
// // BFTaskCenter.h // Pods // // Created by Superbil on 2015/8/22. // // #import <Foundation/Foundation.h> #import "Bolts.h" @interface BFTaskCenter : NSObject + (nonnull instancetype)defaultCenter; - (nullable id)addTaskBlockToCallbacks:(nonnull BFContinuationBlock)taskBlock forKey:(nonnull NSString *)key; - (void)removeTaskBlock:(nonnull id)taskBlock forKey:(nonnull NSString *)key; - (void)clearAllCallbacksForKey:(nonnull NSString *)key; - (void)sendToCallbacksWithKey:(nonnull NSString *)key result:(nullable id)result; - (void)sendToCallbacksWithKey:(nonnull NSString *)key error:(nonnull NSError *)error; - (nonnull BFTaskCompletionSource *)sourceOfSendToCallbacksForKey:(nonnull NSString *)key executor:(nonnull BFExecutor *)executor cancellationToken:(nullable BFCancellationToken *)cancellationToken; @end
// // BFTaskCenter.h // Pods // // Created by Superbil on 2015/8/22. // // #import "Bolts.h" @interface BFTaskCenter : NSObject + (nonnull instancetype)defaultCenter; - (nullable id)addTaskBlockToCallbacks:(nonnull BFContinuationBlock)taskBlock forKey:(nonnull NSString *)key; - (void)removeTaskBlock:(nonnull id)taskBlock forKey:(nonnull NSString *)key; - (void)clearAllCallbacksForKey:(nonnull NSString *)key; - (void)sendToCallbacksWithKey:(nonnull NSString *)key result:(nullable id)result; - (void)sendToCallbacksWithKey:(nonnull NSString *)key error:(nonnull NSError *)error; - (nullable BFTaskCompletionSource *)sourceOfSendToCallbacksForKey:(nonnull NSString *)key executor:(nonnull BFExecutor *)executor cancellationToken:(nullable BFCancellationToken *)cancellationToken; @end
Fix wrong header for sourceOfSendToCallbacksForKey
Fix wrong header for sourceOfSendToCallbacksForKey
C
mit
Superbil/BFTaskCenter,Superbil/BFTaskCenter
48658eef3458ee99291bf3c89be06004bf487b13
You-DataStore/datastore.h
You-DataStore/datastore.h
#pragma once #ifndef YOU_DATASTORE_DATASTORE_H_ #define YOU_DATASTORE_DATASTORE_H_ #include <deque> #include <functional> #include "boost/variant.hpp" #include "task_typedefs.h" #include "internal/operation.h" #include "transaction.h" namespace You { namespace DataStore { namespace UnitTests {} class DataStore { public: Transaction&& begin(); // Modifying methods bool post(TaskId, SerializedTask&); bool put(TaskId, SerializedTask&); bool erase(TaskId); std::vector<SerializedTask> getAllTask(); private: static DataStore& get(); bool isServing = false; std::deque<Internal::IOperation> operationsQueue; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_DATASTORE_H_
#pragma once #ifndef YOU_DATASTORE_DATASTORE_H_ #define YOU_DATASTORE_DATASTORE_H_ #include <deque> #include <functional> #include "boost/variant.hpp" #include "task_typedefs.h" #include "internal/operation.h" #include "transaction.h" namespace You { namespace DataStore { namespace UnitTests {} class DataStore { public: Transaction && begin(); // Modifying methods bool post(TaskId, SerializedTask&); bool put(TaskId, SerializedTask&); bool erase(TaskId); std::vector<SerializedTask> getAllTask(); private: static DataStore& get(); bool isServing = false; std::deque<Internal::IOperation> operationsQueue; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_DATASTORE_H_
Fix lint error, whitespace around &&
Fix lint error, whitespace around &&
C
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
ab745f07fa1102090b79a330b94e2bea4c1820e2
lib/types.h
lib/types.h
#pragma once #include <boost/variant.hpp> #include <atomic> #include <vector> namespace grml { enum class BasicType { INT, BOOL, REAL }; struct TypeVariable { int64_t id; TypeVariable() : id(counter++) {} TypeVariable(int64_t i) : id(i) {} friend bool operator==(const TypeVariable& lhs, const TypeVariable& rhs) { return lhs.id == rhs.id; } private: static std::atomic_int64_t counter; }; struct FunctionType; using Type = boost::variant< BasicType, TypeVariable, boost::recursive_wrapper<FunctionType> >; struct FunctionType { using Parameters = std::vector<Type>; Type result; Parameters parameters; FunctionType(Type r, Parameters ps) : result(std::move(r)), parameters(std::move(ps)) {} friend bool operator==(const FunctionType& lhs, const FunctionType& rhs) { return lhs.result == rhs.result && lhs.parameters == rhs.parameters; } }; }
#pragma once #include <boost/variant.hpp> #include <atomic> #include <vector> #include <unordered_map> namespace grml { enum class BasicType { INT, BOOL, REAL }; struct TypeVariable { int64_t id; TypeVariable() : id(counter++) {} TypeVariable(int64_t i) : id(i) {} friend bool operator==(const TypeVariable& lhs, const TypeVariable& rhs) { return lhs.id == rhs.id; } private: static std::atomic_int64_t counter; }; struct FunctionType; using Type = boost::variant< BasicType, TypeVariable, boost::recursive_wrapper<FunctionType> >; struct FunctionType { using Parameters = std::vector<Type>; Type result; Parameters parameters; FunctionType(Type r, Parameters ps) : result(std::move(r)), parameters(std::move(ps)) {} friend bool operator==(const FunctionType& lhs, const FunctionType& rhs) { return lhs.result == rhs.result && lhs.parameters == rhs.parameters; } }; struct TypeVariableHasher { std::size_t operator()(const TypeVariable& tv) const { return tv.id; } }; using Substitution = std::unordered_map<TypeVariable, Type, TypeVariableHasher>; Substitution unify(const Type& lhs, const Type& rhs); Substitution combine(const Substitution& lhs, const Substitution& rhs); Type substitute(const Type& type, const Substitution& substitution); }
Add unify combine substitute stubs
Add unify combine substitute stubs
C
unlicense
v0lat1le/grml
7508c0b8948668b45c38cfc3dd4e2a9c4709dd3e
kernel/core/test.c
kernel/core/test.c
#include <arch/x64/port.h> #include <truth/panic.h> #define TEST_RESULT_PORT_NUMBER 0xf4 void test_shutdown_status(enum status status) { logf(Log_Debug, "Test shutting down with status %s (%d)\n", status_message(status), status); write_port(status, TEST_RESULT_PORT_NUMBER); halt(); assert(Not_Reached); }
#include <arch/x64/port.h> #include <truth/panic.h> #define Test_Result_Port_Number 0xf4 void test_shutdown_status(enum status status) { logf(Log_Debug, "Test shutting down with status %s (%d)\n", status_message(status), status); write_port(status, Test_Result_Port_Number); }
Exit with a code in debug builds
Exit with a code in debug builds
C
mit
iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth
1581fbd86b5beb465b07d575fc74e61073ec8893
hab/td-p210/td-radio-read.c
hab/td-p210/td-radio-read.c
#include <errno.h> #include <signal.h> #include <string.h> #include <unistd.h> #include <stdbool.h> #include <arpa/inet.h> #include <netinet/in.h> #include <sys/socket.h> #include <sys/types.h> #include <glib.h> #include "td-radio.h" #include "td-radio-scan.h" /* * Send the RESPONDER message to the radio. */ int radio_read(int fd, char* buffer) { bool debug = true; int bytes = 0; memset(buffer, '\0', BUFFER_SZ); if (debug) { g_message("radio_read(): enter"); g_message("\ts_addr = %d", radio_address.sin_addr.s_addr); g_message("\tsin_port = %d", radio_address.sin_port); } socklen_t socklen = sizeof(radio_address); bytes = recvfrom(fd, buffer, BUFFER_SZ, 0, (struct sockaddr *) &radio_address, &socklen); if (debug) { g_message("bytes = %d", bytes); } if (bytes < 0) { g_warning("\tradio_read(): recvfrom failed, %s", strerror(errno)); g_message("\tradio_read(): exit"); } if (debug) { g_message("radio_read(): exit"); } return bytes; }
#include <errno.h> #include <signal.h> #include <string.h> #include <unistd.h> #include <stdbool.h> #include <arpa/inet.h> #include <netinet/in.h> #include <sys/socket.h> #include <sys/types.h> #include <glib.h> #include "td-radio.h" #include "td-radio-scan.h" /* * Send the RESPONDER message to the radio. */ int radio_read(int fd, char* buffer) { bool debug = false; int bytes = 0; memset(buffer, '\0', BUFFER_SZ); socklen_t socklen = sizeof(radio_address); bytes = recvfrom(fd, buffer, BUFFER_SZ, 0, 0, 0); if (bytes < 0) { g_warning("\tradio_read(): recvfrom failed, %s", strerror(errno)); g_error("\tradio_read(): exiting..."); } return bytes; }
Clean up some debugging cruft.
Clean up some debugging cruft.
C
lgpl-2.1
ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead,ldm5180/hammerhead
ca1bf2d0ae025b77910a2e2f8dc91e1cbd802f76
test/test.h
test/test.h
#define ASSERT(x) \ do{ \ if(!(x)){ \ printf("failed assert (%d): %s\n", __LINE__, #x); \ exit(1); \ }\ }while(0) #define INIT_SOCKETS_FOR_WINDOWS \ { \ WSADATA out; \ WSAStartup(MAKEWORD(2,2), &out); \ }
#include <stdlib.h> #define ASSERT(x) \ do{ \ if(!(x)){ \ printf("failed assert (%d): %s\n", __LINE__, #x); \ exit(1); \ }\ }while(0) #ifdef _WIN32 #define INIT_SOCKETS_FOR_WINDOWS \ do{ \ WSADATA out; \ WSAStartup(MAKEWORD(2,2), &out); \ } while(0) #else #define INIT_SOCKETS_FOR_WINDOWS do {} while(0) #endif
Make everything work on linux again
Make everything work on linux again
C
apache-2.0
HeliumProject/mongo-c,mongodb/mongo-c-driver-legacy,Elastica/mongo-c-driver-legacy,mongodb/mongo-c-driver-legacy,mongodb/mongo-c-driver-legacy,Elastica/mongo-c-driver-legacy,Elastica/mongo-c-driver-legacy,HeliumProject/mongo-c,Elastica/mongo-c-driver-legacy,mongodb/mongo-c-driver-legacy,HeliumProject/mongo-c,HeliumProject/mongo-c
61e49bf492c99d95ce46a57a54a7589ee5e184cb
inc/random_hao.h
inc/random_hao.h
#ifndef RANDOM_HAO #define RANDOM_HAO #define SIMPLE_SPRNG #ifdef MPI_HAO #include <mpi.h> #define USE_MPI #endif #include "sprng.h" void random_hao_init(int seed=985456376, int gtype=1); double uniform_hao(); double gaussian_hao(); #endif
#ifndef RANDOM_HAO_H #define RANDOM_HAO_H #define SIMPLE_SPRNG #ifdef MPI_HAO #include <mpi.h> #define USE_MPI #endif #include "sprng.h" void random_hao_init(int seed=985456376, int gtype=1); double uniform_hao(); double gaussian_hao(); #endif
Set the header protection to end with _H.
Set the header protection to end with _H.
C
mit
hshi/random_lib_hao,hshi/random_lib_hao
53ef02baf80130a81d019e85c528fdc13af9db33
providers/implementations/ciphers/cipher_rc5.h
providers/implementations/ciphers/cipher_rc5.h
/* * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <openssl/rc5.h> #include "prov/ciphercommon.h" typedef struct prov_blowfish_ctx_st { PROV_CIPHER_CTX base; /* Must be first */ union { OSSL_UNION_ALIGN; RC5_32_KEY ks; /* key schedule */ } ks; unsigned int rounds; /* number of rounds */ } PROV_RC5_CTX; const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_cbc(size_t keybits); const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_ecb(size_t keybits); const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_ofb64(size_t keybits); const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_cfb64(size_t keybits);
/* * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <openssl/rc5.h> #include "prov/ciphercommon.h" typedef struct prov_rc5_ctx_st { PROV_CIPHER_CTX base; /* Must be first */ union { OSSL_UNION_ALIGN; RC5_32_KEY ks; /* key schedule */ } ks; unsigned int rounds; /* number of rounds */ } PROV_RC5_CTX; const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_cbc(size_t keybits); const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_ecb(size_t keybits); const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_ofb64(size_t keybits); const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_cfb64(size_t keybits);
Fix PROV_RC5_CTX's original structure name
Fix PROV_RC5_CTX's original structure name It looks like a typo when copy & pasting the structure from blowfish. Reviewed-by: Shane Lontis <452ce16516ceed26291fe7de3f8b53540d83864e@oracle.com> Reviewed-by: Richard Levitte <5fb523282dd7956571c80524edc2dccfa0bd8234@openssl.org> Reviewed-by: Tomas Mraz <2bc6038c3dfca09b2da23c8b6da8ba884dc2dcc2@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19186)
C
apache-2.0
openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl
e01f9a4f0f658c37b10eba1058204c85a0ed79f3
windows/include/config.h
windows/include/config.h
/* liblouis Braille Translation and Back-Translation Library Copyright (C) 2014 ViewPlus Technologies, Inc. www.viewplus.com and the liblouis team. http://liblouis.org All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define PACKAGE_VERSION "liblouis-2.5.2"
/* liblouis Braille Translation and Back-Translation Library Copyright (C) 2014 ViewPlus Technologies, Inc. www.viewplus.com and the liblouis team. http://liblouis.org All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define PACKAGE_VERSION "liblouis-2.6.3"
Update the version number in the windows directory
Update the version number in the windows directory
C
lgpl-2.1
BueVest/liblouis,liblouis/liblouis,IndexBraille/liblouis,liblouis/liblouis,hammera/liblouis,vsmontalvao/liblouis,vsmontalvao/liblouis,hammera/liblouis,IndexBraille/liblouis,liblouis/liblouis,IndexBraille/liblouis,vsmontalvao/liblouis,liblouis/liblouis,hammera/liblouis,vsmontalvao/liblouis,hammera/liblouis,vsmontalvao/liblouis,BueVest/liblouis,BueVest/liblouis,hammera/liblouis,IndexBraille/liblouis,BueVest/liblouis,IndexBraille/liblouis,hammera/liblouis,liblouis/liblouis,BueVest/liblouis,BueVest/liblouis,liblouis/liblouis
cb5b3d5fa6244b0d20258203bd9df7e3148af57b
json-glib/tests/node-test.c
json-glib/tests/node-test.c
#include <glib/gtestutils.h> #include <json-glib/json-types.h> #include <string.h> static void test_null (void) { JsonNode *node = json_node_new (JSON_NODE_NULL); g_assert_cmpint (node->type, ==, JSON_NODE_NULL); g_assert_cmpint (json_node_get_value_type (node), ==, G_TYPE_INVALID); g_assert_cmpstr (json_node_type_name (node), ==, "NULL"); json_node_free (node); } int main (int argc, char *argv[]) { g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/nodes/null-node", test_null); return g_test_run (); }
#include <glib/gtestutils.h> #include <json-glib/json-types.h> #include <string.h> static void test_copy (void) { JsonNode *node = json_node_new (JSON_NODE_NULL); JsonNode *copy = json_node_copy (node); g_assert_cmpint (node->type, ==, copy->type); g_assert_cmpint (json_node_get_value_type (node), ==, json_node_get_value_type (copy)); g_assert_cmpstr (json_node_type_name (node), ==, json_node_type_name (copy)); json_node_free (copy); json_node_free (node); } static void test_null (void) { JsonNode *node = json_node_new (JSON_NODE_NULL); g_assert_cmpint (node->type, ==, JSON_NODE_NULL); g_assert_cmpint (json_node_get_value_type (node), ==, G_TYPE_INVALID); g_assert_cmpstr (json_node_type_name (node), ==, "NULL"); json_node_free (node); } int main (int argc, char *argv[]) { g_type_init (); g_test_init (&argc, &argv, NULL); g_test_add_func ("/nodes/null-node", test_null); g_test_add_func ("/nodes/copy-node", test_copy); return g_test_run (); }
Add a JsonNode copy test unit
Add a JsonNode copy test unit The test unit copies a NULL JsonNode and checks that the copy and the original nodes are equivalent.
C
lgpl-2.1
Distrotech/json-glib,GNOME/json-glib,robtaylor/json-glib-gvariant,robtaylor/json-glib-gvariant,ebassi/json-glib,ebassi/json-glib,brauliobo/json-glib,oerdnj/json-glib,frida/json-glib,oerdnj/json-glib,ebassi/json-glib,oerdnj/json-glib,brauliobo/json-glib,frida/json-glib,brauliobo/json-glib,Distrotech/json-glib,GNOME/json-glib,oerdnj/json-glib,Distrotech/json-glib
d62ff6ee49fcd6b033a01d5a0b067d865c4c4fc8
lib/libc/locale/nomacros.c
lib/libc/locale/nomacros.c
#include <sys/cdefs.h> __FBSDID("$FreeBSD$"); /* * Tell <ctype.h> to generate extern versions of all its inline * functions. The extern versions get called if the system doesn't * support inlines or the user defines _DONT_USE_CTYPE_INLINE_ * before including <ctype.h>. */ #define _EXTERNALIZE_CTYPE_INLINES_ #include <ctype.h>
#include <sys/cdefs.h> __FBSDID("$FreeBSD$"); /* * Tell <ctype.h> to generate extern versions of all its inline * functions. The extern versions get called if the system doesn't * support inlines or the user defines _DONT_USE_CTYPE_INLINE_ * before including <ctype.h>. */ #define _EXTERNALIZE_CTYPE_INLINES_ /* * Also make sure <runetype.h> does not generate an inline definition * of __getCurrentRuneLocale(). */ #define __RUNETYPE_INTERNAL #include <ctype.h>
Fix build of libc.so after r232620. This caused a duplicate definition of __getCurrentRuneLocale().
Fix build of libc.so after r232620. This caused a duplicate definition of __getCurrentRuneLocale(). Pointy hat to: me
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
f47fb07147844b0f12e36137d3c65b97b5a59f99
src/json_utils.h
src/json_utils.h
/* * GeeXboX Valhalla: tiny media scanner API. * Copyright (C) 2016 Mathieu Schroeter <mathieu@schroetersa.ch> * * This file is part of libvalhalla. * * libvalhalla is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * libvalhalla is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with libvalhalla; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef VALHALLA_JSON_UTILS_H #define VALHALLA_JSON_UTILS_H #include <json-c/json_tokener.h> char *vh_json_get_str (json_object *json, const char *path); int vh_json_get_int (json_object *json, const char *path); #endif /* VALHALLA_JSON_UTILS_H */
/* * GeeXboX Valhalla: tiny media scanner API. * Copyright (C) 2016 Mathieu Schroeter <mathieu@schroetersa.ch> * * This file is part of libvalhalla. * * libvalhalla is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * libvalhalla is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with libvalhalla; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef VALHALLA_JSON_UTILS_H #define VALHALLA_JSON_UTILS_H #include <json-c/json_tokener.h> json_object *vh_json_get (json_object *json, const char *path); char *vh_json_get_str (json_object *json, const char *path); int vh_json_get_int (json_object *json, const char *path); #endif /* VALHALLA_JSON_UTILS_H */
Add vh_json_get in the API
Add vh_json_get in the API
C
lgpl-2.1
GeeXboX/libvalhalla,GeeXboX/libvalhalla,GeeXboX/libvalhalla,GeeXboX/libvalhalla,GeeXboX/libvalhalla
0cb191b07c9bae9123655267c50f1210da07a48f
AdjustIo/AIResponseData.h
AdjustIo/AIResponseData.h
// // AIResponseData.h // AdjustIo // // Created by Christian Wellenbrock on 07.02.14. // Copyright (c) 2014 adeven. All rights reserved. // typedef enum { AIActivityKindUnknown = 0, AIActivityKindSession = 1, AIActivityKindEvent = 2, AIActivityKindRevenue = 3, // only possible when server could be reached because the SDK can't know // whether or not a session might be an install or reattribution AIActivityKindInstall = 4, AIActivityKindReattribution = 5, } AIActivityKind; @interface AIResponseData : NSObject @property (nonatomic, assign) AIActivityKind activityKind; @property (nonatomic, copy) NSString *trackerToken; @property (nonatomic, copy) NSString *trackerName; @property (nonatomic, copy) NSString *error; + (AIResponseData *)dataWithJsonString:(NSString *)string; - (id)initWithJsonString:(NSString *)string; @end
// // AIResponseData.h // AdjustIo // // Created by Christian Wellenbrock on 07.02.14. // Copyright (c) 2014 adeven. All rights reserved. // typedef enum { AIActivityKindUnknown = 0, AIActivityKindSession = 1, AIActivityKindEvent = 2, AIActivityKindRevenue = 3, // only possible when server could be reached because the SDK can't know // whether or not a session might be an install or reattribution AIActivityKindInstall = 4, AIActivityKindReattribution = 5, } AIActivityKind; @class AIActivityPackage; /* * Information about the result of a tracking attempt * * Will be passed to the delegate function adjustIoTrackedActivityWithResponse */ @interface AIResponseData : NSObject // the kind of activity (install, session, event, etc.) // see the AIActivity definition above @property (nonatomic, assign) AIActivityKind activityKind; // true when the activity was tracked successfully // might be true even if response could not be parsed @property (nonatomic, assign) BOOL success; // true if the server was not reachable and the request will be tried again later @property (nonatomic, assign) BOOL willRetry; // nil if activity was tracked successfully and response could be parsed // might be not nil even when activity was tracked successfully @property (nonatomic, copy) NSString *error; // the following attributes are only set when error is nil // (when activity was tracked successfully and response could be parsed) // tracker token of current device @property (nonatomic, copy) NSString *trackerToken; // tracker name of current device @property (nonatomic, copy) NSString *trackerName; + (AIResponseData *)dataWithJsonString:(NSString *)string; + (AIResponseData *)dataWithError:(NSString *)error; - (id)initWithJsonString:(NSString *)string; - (id)initWithError:(NSString *)error; @end
Add flags success and willRetry to ResponseData
Add flags success and willRetry to ResponseData
C
mit
akolov/adjust,dannycxh/ios_sdk,Threadflip/adjust_ios_sdk,BlueCrystalLabs/ios_sdk,nicolas-brugneaux-sociomantic/ios_sdk,trademob/ios_sdk,pitchtarget/adjust-ios-sdk,mseegers/ios_sdk,yutmr/ios_sdk
ebe94114b14418c11e829e952c2ee92ea42585cb
test/CodeGen/tentative-decls.c
test/CodeGen/tentative-decls.c
// RUN: clang-cc -emit-llvm -o %t %s && // RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t && int r[]; int (*a)[] = &r; struct s0; struct s0 x; // RUN: grep '@x = common global .struct.s0 zeroinitializer' %t && struct s0 y; // RUN: grep '@y = common global .struct.s0 zeroinitializer' %t && struct s0 *f0() { return &y; } struct s0 { int x; }; // RUN: grep '@b = common global \[1 x .*\] zeroinitializer' %t && int b[]; int *f1() { return b; } // Check that the most recent tentative definition wins. // RUN: grep '@c = common global \[4 x .*\] zeroinitializer' %t && int c[]; int c[4]; // RUN: true
// RUN: clang-cc -emit-llvm -o %t %s && // RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t && int r[]; int (*a)[] = &r; struct s0; struct s0 x; // RUN: grep '@x = common global .struct.s0 zeroinitializer' %t && struct s0 y; // RUN: grep '@y = common global .struct.s0 zeroinitializer' %t && struct s0 *f0() { return &y; } struct s0 { int x; }; // RUN: grep '@b = common global \[1 x .*\] zeroinitializer' %t && int b[]; int *f1() { return b; } // Check that the most recent tentative definition wins. // RUN: grep '@c = common global \[4 x .*\] zeroinitializer' %t && int c[]; int c[4]; // Check that we emit static tentative definitions // RUN: grep '@c5 = internal global \[1 x .*\] zeroinitializer' %t && static int c5[]; static int func() { return c5[0]; } int callfunc() { return func(); } // RUN: true
Add testcase that illustrates the problem from r69699 regarding tentative definitions of statics
Add testcase that illustrates the problem from r69699 regarding tentative definitions of statics git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@70543 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/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,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
5856e5d8890058e383f53dc94e1f0f96645ebbe3
knode/resource.h
knode/resource.h
/* resource.h KNode, the KDE newsreader Copyright (c) 1999-2005 the KNode authors. See file AUTHORS for details This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US */ #ifndef RESSOURCE_H #define RESSOURCE_H #ifdef HAVE_CONFIG_H #include <config.h> #endif //========= KNode Version Information ============ #define KNODE_VERSION "0.9.91" //================= StatusBar ==================== #define SB_MAIN 4000005 #define SB_GROUP 4000010 #define SB_FILTER 4000030 //================== Folders ===================== #define FOLD_DRAFTS 200010 #define FOLD_SENT 200020 #define FOLD_OUTB 200030 #endif // RESOURCE_H
/* resource.h KNode, the KDE newsreader Copyright (c) 1999-2005 the KNode authors. See file AUTHORS for details This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US */ #ifndef RESSOURCE_H #define RESSOURCE_H #ifdef HAVE_CONFIG_H #include <config.h> #endif //========= KNode Version Information ============ #define KNODE_VERSION "0.9.92" //================= StatusBar ==================== #define SB_MAIN 4000005 #define SB_GROUP 4000010 #define SB_FILTER 4000030 //================== Folders ===================== #define FOLD_DRAFTS 200010 #define FOLD_SENT 200020 #define FOLD_OUTB 200030 #endif // RESOURCE_H
Increment version number for 3.5 beta2.
Increment version number for 3.5 beta2. svn path=/branches/KDE/3.5/kdepim/; revision=466310
C
lgpl-2.1
lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi
e0eaf53867defbf7549ac18520fed3f9ded45396
FastEasyMapping/Source/Utility/FEMTypes.h
FastEasyMapping/Source/Utility/FEMTypes.h
// For License please refer to LICENSE file in the root of FastEasyMapping project #import <Foundation/Foundation.h> typedef __nullable id (^FEMMapBlock)(id value __nonnull);
// For License please refer to LICENSE file in the root of FastEasyMapping project #import <Foundation/Foundation.h> typedef __nullable id (^FEMMapBlock)(__nonnull id value);
Add nullability specifiers to FEMMapBlock
Add nullability specifiers to FEMMapBlock
C
mit
langziguilai/FastEasyMapping,pomozoff/FastEasyMapping,k06a/FastEasyMapping
e8ca05d549a6768b697255f42125e940912c7163
Realm/RLMObject_Private.h
Realm/RLMObject_Private.h
//////////////////////////////////////////////////////////////////////////// // // TIGHTDB CONFIDENTIAL // __________________ // // [2011] - [2014] TightDB Inc // All Rights Reserved. // // NOTICE: All information contained herein is, and remains // the property of TightDB Incorporated and its suppliers, // if any. The intellectual and technical concepts contained // herein are proprietary to TightDB Incorporated // and its suppliers and may be covered by U.S. and Foreign Patents, // patents in process, and are protected by trade secret or copyright law. // Dissemination of this information or reproduction of this material // is strictly forbidden unless prior written permission is obtained // from TightDB Incorporated. // //////////////////////////////////////////////////////////////////////////// #import "RLMObject.h" #import "RLMAccessor.h" #import "RLMObjectSchema.h" // RLMObject accessor and read/write realm @interface RLMObject () <RLMAccessor> @property (nonatomic, readwrite) RLMRealm *realm; @property (nonatomic) RLMObjectSchema *schema; @end
//////////////////////////////////////////////////////////////////////////// // // TIGHTDB CONFIDENTIAL // __________________ // // [2011] - [2014] TightDB Inc // All Rights Reserved. // // NOTICE: All information contained herein is, and remains // the property of TightDB Incorporated and its suppliers, // if any. The intellectual and technical concepts contained // herein are proprietary to TightDB Incorporated // and its suppliers and may be covered by U.S. and Foreign Patents, // patents in process, and are protected by trade secret or copyright law. // Dissemination of this information or reproduction of this material // is strictly forbidden unless prior written permission is obtained // from TightDB Incorporated. // //////////////////////////////////////////////////////////////////////////// #import "RLMObject.h" #import "RLMAccessor.h" #import "RLMObjectSchema.h" // RLMObject accessor and read/write realm @interface RLMObject () <RLMAccessor> -(instancetype)initWithDefaultValues:(BOOL)useDefaults; @property (nonatomic, readwrite) RLMRealm *realm; @property (nonatomic) RLMObjectSchema *schema; @end
Declare initWithDefaultValues in private category
Declare initWithDefaultValues in private category
C
apache-2.0
AlexanderMazaletskiy/realm-cocoa,codyDu/realm-cocoa,Palleas/realm-cocoa,sunzeboy/realm-cocoa,duk42111/realm-cocoa,isaacroldan/realm-cocoa,Palleas/realm-cocoa,hejunbinlan/realm-cocoa,nathankot/realm-cocoa,brasbug/realm-cocoa,kevinmlong/realm-cocoa,lumoslabs/realm-cocoa,ChenJian345/realm-cocoa,bestwpw/realm-cocoa,kylebshr/realm-cocoa,iOS--wsl--victor/realm-cocoa,lumoslabs/realm-cocoa,HuylensHu/realm-cocoa,duk42111/realm-cocoa,kevinmlong/realm-cocoa,amuramoto/realm-objc,lumoslabs/realm-cocoa,hejunbinlan/realm-cocoa,amuramoto/realm-objc,sunfei/realm-cocoa,codyDu/realm-cocoa,zilaiyedaren/realm-cocoa,tenebreux/realm-cocoa,iOS--wsl--victor/realm-cocoa,dilizarov/realm-cocoa,zilaiyedaren/realm-cocoa,isaacroldan/realm-cocoa,imjerrybao/realm-cocoa,sunfei/realm-cocoa,amuramoto/realm-objc,yuuki1224/realm-cocoa,tenebreux/realm-cocoa,yuuki1224/realm-cocoa,ul7290/realm-cocoa,kylebshr/realm-cocoa,lumoslabs/realm-cocoa,codyDu/realm-cocoa,nathankot/realm-cocoa,hejunbinlan/realm-cocoa,isaacroldan/realm-cocoa,nathankot/realm-cocoa,AlexanderMazaletskiy/realm-cocoa,duk42111/realm-cocoa,brasbug/realm-cocoa,ul7290/realm-cocoa,imjerrybao/realm-cocoa,isaacroldan/realm-cocoa,neonichu/realm-cocoa,nathankot/realm-cocoa,dilizarov/realm-cocoa,sunfei/realm-cocoa,iOSCowboy/realm-cocoa,bugix/realm-cocoa,ChenJian345/realm-cocoa,Palleas/realm-cocoa,bestwpw/realm-cocoa,hejunbinlan/realm-cocoa,iOSCowboy/realm-cocoa,iOSCowboy/realm-cocoa,lumoslabs/realm-cocoa,neonichu/realm-cocoa,kylebshr/realm-cocoa,amuramoto/realm-objc,ChenJian345/realm-cocoa,xmartlabs/realm-cocoa,thdtjsdn/realm-cocoa,kevinmlong/realm-cocoa,iOS--wsl--victor/realm-cocoa,xmartlabs/realm-cocoa,tenebreux/realm-cocoa,AlexanderMazaletskiy/realm-cocoa,vuchau/realm-cocoa,AlexanderMazaletskiy/realm-cocoa,bestwpw/realm-cocoa,codyDu/realm-cocoa,brasbug/realm-cocoa,kevinmlong/realm-cocoa,kylebshr/realm-cocoa,xmartlabs/realm-cocoa,imjerrybao/realm-cocoa,dilizarov/realm-cocoa,iOSCowboy/realm-cocoa,codyDu/realm-cocoa,dilizarov/realm-cocoa,xmartlabs/realm-cocoa,nathankot/realm-cocoa,vuchau/realm-cocoa,dilizarov/realm-cocoa,hejunbinlan/realm-cocoa,bugix/realm-cocoa,neonichu/realm-cocoa,duk42111/realm-cocoa,sunzeboy/realm-cocoa,tenebreux/realm-cocoa,sunzeboy/realm-cocoa,ul7290/realm-cocoa,Havi4/realm-cocoa,neonichu/realm-cocoa,yuuki1224/realm-cocoa,imjerrybao/realm-cocoa,ul7290/realm-cocoa,vuchau/realm-cocoa,HuylensHu/realm-cocoa,amuramoto/realm-objc,sunfei/realm-cocoa,HuylensHu/realm-cocoa,yuuki1224/realm-cocoa,neonichu/realm-cocoa,Havi4/realm-cocoa,brasbug/realm-cocoa,zilaiyedaren/realm-cocoa,isaacroldan/realm-cocoa,AlexanderMazaletskiy/realm-cocoa,ChenJian345/realm-cocoa,Havi4/realm-cocoa,vuchau/realm-cocoa,brasbug/realm-cocoa,Palleas/realm-cocoa,thdtjsdn/realm-cocoa,thdtjsdn/realm-cocoa,Havi4/realm-cocoa,bugix/realm-cocoa,bugix/realm-cocoa,thdtjsdn/realm-cocoa,bestwpw/realm-cocoa,tenebreux/realm-cocoa,HuylensHu/realm-cocoa,sunfei/realm-cocoa,xmartlabs/realm-cocoa,kylebshr/realm-cocoa,duk42111/realm-cocoa,iOSCowboy/realm-cocoa,sunzeboy/realm-cocoa,sunzeboy/realm-cocoa,iOS--wsl--victor/realm-cocoa,ChenJian345/realm-cocoa,thdtjsdn/realm-cocoa,bugix/realm-cocoa,iOS--wsl--victor/realm-cocoa,HuylensHu/realm-cocoa,bestwpw/realm-cocoa,imjerrybao/realm-cocoa,zilaiyedaren/realm-cocoa,kevinmlong/realm-cocoa,Havi4/realm-cocoa,Palleas/realm-cocoa,zilaiyedaren/realm-cocoa,ul7290/realm-cocoa,vuchau/realm-cocoa,yuuki1224/realm-cocoa
6e1c270aefe2b1387fabd533c8a48cd1a37bdfe7
exec/cnex/support.h
exec/cnex/support.h
#ifndef SUPPORT_H #define SUPPORT_H #include <stdio.h> struct tagTModule; typedef struct tagTExtensionModule { char *module; void *handle; } TExtensionModule; typedef struct tagTExtensions { TExtensionModule *modules; size_t size; } TExtenstions; void path_initPaths(const char *source_path); void path_freePaths(); void path_readModule(struct tagTModule *m); void path_dumpPaths(); FILE *path_findModule(const char *name, char *modulePath); char *path_getFileNameOnly(char *path); char *path_getPathOnly(char *path); TExtensionModule *ext_findModule(const char *moduleName); void ext_insertModule(const char *name, void *handle); void ext_cleanup(void); #endif
#ifndef SUPPORT_H #define SUPPORT_H #include <stdio.h> struct tagTModule; typedef struct tagTExtensionModule { char *module; void *handle; } TExtensionModule; typedef struct tagTExtensions { TExtensionModule *modules; size_t size; } TExtenstions; void path_initPaths(const char *source_path); void path_freePaths(); void path_readModule(struct tagTModule *m); void path_dumpPaths(); FILE *path_findModule(const char *name, char *modulePath); char *path_getFileNameOnly(char *path); char *path_getPathOnly(char *path); TExtensionModule *ext_findModule(const char *moduleName); void ext_insertModule(const char *name, void *handle); void ext_cleanup(void); #endif
Fix incorrect indentation in TExtensionModule struct
Fix incorrect indentation in TExtensionModule struct
C
mit
gitlarryf/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,gitlarryf/neon-lang,gitlarryf/neon-lang,gitlarryf/neon-lang
568b603030b89d01f4914c1d9196440337bab3e7
ext/pycall/thread.c
ext/pycall/thread.c
#include "pycall_internal.h" #if defined(PYCALL_THREAD_WIN32) int pycall_tls_create(pycall_tls_key *tls_key) { *tls_key = TlsAlloc(); return *tls_key == TLS_OUT_OF_INDEXES; } void *pycall_tls_get(pycall_tls_key tls_key) { return TlsGetValue(tls_key); } int pycall_tls_set(pycall_tls_key tls_key, void *ptr) { return TlsSetValue(tls_key, th) == 0; } #endif #if defined(PYCALL_THREAD_PTHREAD) int pycall_tls_create(pycall_tls_key *tls_key) { return pthread_key_create(tls_key, NULL); } void *pycall_tls_get(pycall_tls_key tls_key) { return pthread_getspecific(tls_key); } int pycall_tls_set(pycall_tls_key tls_key, void *ptr) { return pthread_setspecific(tls_key, ptr); } #endif
#include "pycall_internal.h" #if defined(PYCALL_THREAD_WIN32) int pycall_tls_create(pycall_tls_key *tls_key) { *tls_key = TlsAlloc(); return *tls_key == TLS_OUT_OF_INDEXES; } void *pycall_tls_get(pycall_tls_key tls_key) { return TlsGetValue(tls_key); } int pycall_tls_set(pycall_tls_key tls_key, void *ptr) { return 0 == TlsSetValue(tls_key, ptr); } #endif #if defined(PYCALL_THREAD_PTHREAD) int pycall_tls_create(pycall_tls_key *tls_key) { return pthread_key_create(tls_key, NULL); } void *pycall_tls_get(pycall_tls_key tls_key) { return pthread_getspecific(tls_key); } int pycall_tls_set(pycall_tls_key tls_key, void *ptr) { return pthread_setspecific(tls_key, ptr); } #endif
Fix compile error on Windows
Fix compile error on Windows
C
mit
mrkn/pycall,mrkn/pycall,mrkn/pycall.rb,mrkn/pycall,mrkn/pycall.rb,mrkn/pycall,mrkn/pycall.rb,mrkn/pycall.rb
9a6d7f4f5c4e29d69a151b6218ff6e8cc9582e7f
timing-test.c
timing-test.c
#include "lib/timing.h" task main() { writeDebugStreamLine("Waiting 1 second"); resetTimeDelta(); getTimeDelta(); wait1Msec(1000); writeDebugStreamLine("delta: %d", getTimeDelta()); writeDebugStreamLine("Waiting 5 seconds"); resetTimeDelta(); getTimeDelta(); wait1Msec(5000); writeDebugStreamLine("delta: %d", getTimeDelta()); writeDebugStreamLine("Waiting 10 seconds"); resetTimeDelta(); getTimeDelta(); wait1Msec(10000); writeDebugStreamLine("delta: %d", getTimeDelta()); }
#include "lib/timing.h" task main() { // getTimeDelta() writeDebugStreamLine("Testing getTimeDelta()"); writeDebugStreamLine("Waiting 1 second"); resetTimeDelta(); getTimeDelta(); wait1Msec(1000); writeDebugStreamLine("delta: %d", getTimeDelta()); writeDebugStreamLine("Waiting 5 seconds"); resetTimeDelta(); getTimeDelta(); wait1Msec(5000); writeDebugStreamLine("delta: %d", getTimeDelta()); writeDebugStreamLine("Waiting 10 seconds"); resetTimeDelta(); getTimeDelta(); wait1Msec(10000); writeDebugStreamLine("delta: %d", getTimeDelta()); writeDebugStreamLine("Testing getTimeDeltaTimer() (using default timer)"); writeDebugStreamLine("Waiting 1 second"); resetTimeDeltaTimer(); getTimeDeltaTimer(); wait1Msec(1000); writeDebugStreamLine("delta: %d", getTimeDeltaTimer()); writeDebugStreamLine("Waiting 5 seconds"); resetTimeDeltaTimer(); getTimeDeltaTimer(); wait1Msec(5000); writeDebugStreamLine("delta: %d", getTimeDeltaTimer()); writeDebugStreamLine("Waiting 10 seconds"); resetTimeDeltaTimer(); getTimeDeltaTimer(); wait1Msec(10000); writeDebugStreamLine("delta: %d", getTimeDeltaTimer()); }
Add tests for alternative timing method
Add tests for alternative timing method
C
mit
patrickmess/ftc-2013,patrickmess/ftc-2013
b933e0fbb8c85434bf54f772dd07b57e52440089
cocoa/BugsnagReactNative.h
cocoa/BugsnagReactNative.h
#import <Foundation/Foundation.h> #import <React/RCTBridgeModule.h> #if __has_include(<React/RCTBridge.h>) // React Native >= 0.40 #import <React/RCTBridge.h> #else // React Native <= 0.39 #import "RCTBridge.h" #endif @class BugsnagConfiguration; @interface BugsnagReactNative: NSObject <RCTBridgeModule> /** * Initializes the crash handler with the default options and using the API key * stored in the Info.plist using the key "BugsnagAPIKey" */ + (void)start; /** * Initializes the crash handler with the default options * @param APIKey the API key to use when sending error reports */ + (void)startWithAPIKey:(NSString *)APIKey; /** * Initializes the crash handler with custom options * @param config the configuration options to use */ + (void)startWithConfiguration:(BugsnagConfiguration *)config; - (void)startWithOptions:(NSDictionary *)options; - (void)leaveBreadcrumb:(NSDictionary *)options; - (void)notify:(NSDictionary *)payload; - (void)setUser:(NSDictionary *)userInfo; - (void)clearUser; - (void)startSession; @end
#import <Foundation/Foundation.h> #import <React/RCTBridgeModule.h> #if __has_include(<React/RCTBridge.h>) // React Native >= 0.40 #import <React/RCTBridge.h> #else // React Native <= 0.39 #import "RCTBridge.h" #endif @class BugsnagConfiguration; @interface BugsnagReactNative: NSObject <RCTBridgeModule> /** * Initializes the crash handler with the default options and using the API key * stored in the Info.plist using the key "BugsnagAPIKey" */ + (void)start; /** * Initializes the crash handler with the default options * @param APIKey the API key to use when sending error reports */ + (void)startWithAPIKey:(NSString *)APIKey; /** * Initializes the crash handler with custom options * @param config the configuration options to use */ + (void)startWithConfiguration:(BugsnagConfiguration *)config; - (void)startWithOptions:(NSDictionary *)options; - (void)leaveBreadcrumb:(NSDictionary *)options; - (void)notify:(NSDictionary *)payload resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject; - (void)setUser:(NSDictionary *)userInfo; - (void)clearUser; - (void)startSession; @end
Synchronize decl and impl of notify(…)
fix: Synchronize decl and impl of notify(…)
C
mit
bugsnag/bugsnag-react-native,bugsnag/bugsnag-react-native,bugsnag/bugsnag-react-native,bugsnag/bugsnag-react-native,bugsnag/bugsnag-react-native
322b07ff24932fb0e59114e30620e47501a84191
core/imt/inc/LinkDef.h
core/imt/inc/LinkDef.h
#ifdef __CLING__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; // Only for the autoload, autoparse. No IO of these classes is foreseen! #pragma link C++ class ROOT::Internal::TPoolManager-; #pragma link C++ class ROOT::TThreadExecutor-; #pragma link C++ class ROOT::Experimental::TTaskGroup-; #endif
#ifdef __CLING__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; // Only for the autoload, autoparse. No IO of these classes is foreseen! // Exclude in case ROOT does not have IMT support #ifdef R__USE_IMT #pragma link C++ class ROOT::Internal::TPoolManager-; #pragma link C++ class ROOT::TThreadExecutor-; #pragma link C++ class ROOT::Experimental::TTaskGroup-; #endif #endif
Fix warning during dictionary generation in no-imt builds
[IMT] Fix warning during dictionary generation in no-imt builds
C
lgpl-2.1
karies/root,olifre/root,olifre/root,karies/root,karies/root,olifre/root,olifre/root,olifre/root,olifre/root,root-mirror/root,root-mirror/root,root-mirror/root,olifre/root,root-mirror/root,root-mirror/root,olifre/root,karies/root,karies/root,karies/root,root-mirror/root,root-mirror/root,olifre/root,karies/root,karies/root,karies/root,root-mirror/root,olifre/root,karies/root,olifre/root,root-mirror/root,root-mirror/root,root-mirror/root,karies/root
b858676194b9e384789bc9d506136c37e5da015a
src/validation.h
src/validation.h
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VALIDATION_H #define BITCOIN_VALIDATION_H #include <stdint.h> #include <string> static const int64_t DEFAULT_MAX_TIP_AGE = 6 * 60 * 60; // ~144 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin extern int64_t nMaxTipAge; FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb"); FILE* AppendBlockFile(unsigned int& nFileRet); bool IsInitialBlockDownload(); #endif // BITCOIN_VALIDATION_H
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VALIDATION_H #define BITCOIN_VALIDATION_H #include <stdint.h> #include <string> static const int64_t DEFAULT_MAX_TIP_AGE = 1 * 60 * 60; // ~45 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin extern int64_t nMaxTipAge; FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb"); FILE* AppendBlockFile(unsigned int& nFileRet); bool IsInitialBlockDownload(); #endif // BITCOIN_VALIDATION_H
Adjust default max tip age
Adjust default max tip age
C
mit
neutroncoin/neutron,neutroncoin/neutron,neutroncoin/neutron,neutroncoin/neutron
40e67dea90605c430fae7e010090886f137d5107
searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.h
searchlib/src/vespa/searchlib/common/sequencedtaskexecutor.h
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "isequencedtaskexecutor.h" #include <vector> namespace vespalib { struct ExecutorStats; class SyncableThreadExecutor; } namespace search { /** * Class to run multiple tasks in parallel, but tasks with same * id has to be run in sequence. */ class SequencedTaskExecutor final : public ISequencedTaskExecutor { using Stats = vespalib::ExecutorStats; std::unique_ptr<std::vector<std::unique_ptr<vespalib::SyncableThreadExecutor>>> _executors; SequencedTaskExecutor(std::unique_ptr<std::vector<std::unique_ptr<vespalib::SyncableThreadExecutor>>> executor); public: enum class Optimize {LATENCY, THROUGHPUT}; using ISequencedTaskExecutor::getExecutorId; ~SequencedTaskExecutor(); void setTaskLimit(uint32_t taskLimit) override; void executeTask(ExecutorId id, vespalib::Executor::Task::UP task) override; void sync() override; Stats getStats() override; static std::unique_ptr<ISequencedTaskExecutor> create(uint32_t threads, uint32_t taskLimit = 1000, Optimize optimize = Optimize::THROUGHPUT); }; } // namespace search
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "isequencedtaskexecutor.h" #include <vector> namespace vespalib { struct ExecutorStats; class SyncableThreadExecutor; } namespace search { /** * Class to run multiple tasks in parallel, but tasks with same * id has to be run in sequence. */ class SequencedTaskExecutor final : public ISequencedTaskExecutor { using Stats = vespalib::ExecutorStats; std::unique_ptr<std::vector<std::unique_ptr<vespalib::SyncableThreadExecutor>>> _executors; SequencedTaskExecutor(std::unique_ptr<std::vector<std::unique_ptr<vespalib::SyncableThreadExecutor>>> executor); public: enum class Optimize {LATENCY, THROUGHPUT}; using ISequencedTaskExecutor::getExecutorId; ~SequencedTaskExecutor(); void setTaskLimit(uint32_t taskLimit) override; void executeTask(ExecutorId id, vespalib::Executor::Task::UP task) override; void sync() override; Stats getStats() override; /* * Note that if you choose Optimize::THROUGHPUT, you must ensure only a single producer, or synchronize on the outside. */ static std::unique_ptr<ISequencedTaskExecutor> create(uint32_t threads, uint32_t taskLimit = 1000, Optimize optimize = Optimize::LATENCY); }; } // namespace search
Add comment about thread safety.
Add comment about thread safety.
C
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
b640cc489b65153efcb519feb9038d658b4bf005
components/run_command.c
components/run_command.c
/* See LICENSE file for copyright and license details. */ #include <errno.h> #include <stdio.h> #include <string.h> #include "../util.h" const char * run_command(const char *cmd) { char *p; FILE *fp; if (!(fp = popen(cmd, "r"))) { warn("popen '%s':", cmd); return NULL; } p = fgets(buf, sizeof(buf) - 1, fp); pclose(fp); if (!p) { return NULL; } if ((p = strrchr(buf, '\n'))) { p[0] = '\0'; } return buf[0] ? buf : NULL; }
/* See LICENSE file for copyright and license details. */ #include <errno.h> #include <stdio.h> #include <string.h> #include "../util.h" const char * run_command(const char *cmd) { char *p; FILE *fp; if (!(fp = popen(cmd, "r"))) { warn("popen '%s':", cmd); return NULL; } p = fgets(buf, sizeof(buf) - 1, fp); if (pclose(fp) < 0) { warn("pclose '%s':", cmd); return NULL; } if (!p) { return NULL; } if ((p = strrchr(buf, '\n'))) { p[0] = '\0'; } return buf[0] ? buf : NULL; }
Check return value of pclose()
Check return value of pclose()
C
isc
drkh5h/slstatus,drkhsh/slstatus
355f66f9f5de18497e7a3bb364d266cdd4e91cda
mud/home/Verb/initd.c
mud/home/Verb/initd.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2018 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths/system.h> #include <kotaka/privilege.h> inherit LIB_INITD; inherit UTILITY_COMPILE; private void load() { load_dir("sys"); } private void set_limits() { reset_limits(); } static void create() { load(); set_limits(); } void upgrade() { ACCESS_CHECK(previous_program() == OBJECTD); set_limits(); }
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2018 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths/system.h> #include <kotaka/privilege.h> inherit LIB_INITD; inherit UTILITY_COMPILE; private void load() { load_dir("sys"); } private void set_limits() { reset_limits(); } static void create() { set_limits(); load(); } void upgrade() { ACCESS_CHECK(previous_program() == OBJECTD); set_limits(); }
Set resource limits before loading
Set resource limits before loading
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
3dd39e7abbe813ad63fe0137e6a1e17fcaa506c1
tests/regression/29-svcomp/31-dd-address-meet.c
tests/regression/29-svcomp/31-dd-address-meet.c
// PARAM: --enable annotation.int.enabled #include <stdlib.h> #include <goblint.h> struct slotvec { size_t size ; char *val ; }; static char slot0[256] ; static struct slotvec slotvec0 = {sizeof(slot0), slot0}; static void install_signal_handlers(void) { { if(!(slotvec0.val == & slot0[0LL])) { reach_error(); abort(); } }; } int main(int argc , char **argv ) { // Goblint used to consider both branches in this condition to be dead, because the meet on addresses with different active int domains was broken { if(!(slotvec0.val == & slot0[0LL])) { reach_error(); abort(); } }; install_signal_handlers(); // Should be reachable __goblint_check(1); return 0; }
// PARAM: --enable annotation.int.enabled // This option enables ALL int domains for globals #include <stdlib.h> #include <goblint.h> struct slotvec { size_t size ; char *val ; }; static char slot0[256] ; static struct slotvec slotvec0 = {sizeof(slot0), slot0}; static void install_signal_handlers(void) { { if(!(slotvec0.val == & slot0[0LL])) { reach_error(); abort(); } }; } int main(int argc , char **argv ) { // Goblint used to consider both branches in this condition to be dead, because the meet on addresses with different active int domains was broken { if(!(slotvec0.val == & slot0[0LL])) { reach_error(); abort(); } }; install_signal_handlers(); // Should be reachable __goblint_check(1); return 0; }
Add comment explaining impact of option in test case
Add comment explaining impact of option in test case Co-authored-by: Michael Schwarz <002afe8b64400fa3cb5439d4dd87a0dc9a516d5f@gmail.com>
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
85dc3a8945fca037d130134cb687e6e6b188b596
src/math/p_ln.c
src/math/p_ln.c
#include <pal.h> /** * * Calculates the natural logarithm of 'a', (where the base is 'e'=2.71828) * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @param p Number of processor to use (task parallelism) * * @param team Team to work with * * @return None * */ #include <math.h> void p_ln_f32(const float *a, float *c, int n, int p, p_team_t team) { int i; for (i = 0; i < n; i++) { *(c + i) = logf(*(a + i)); } }
#include <pal.h> /** * * Calculates the natural logarithm of 'a', (where the base is 'e'=2.71828) * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @param p Number of processor to use (task parallelism) * * @param team Team to work with * * @return None * */ void p_ln_f32(const float *a, float *c, int n, int p, p_team_t team) { int i; for (i = 0; i < n; i++) { union { float f; uint32_t i; } u = { *(a + i) }; // Calculate the exponent (which is the floor of the logarithm) minus one int e = ((u.i >> 23) & 0xff) - 0x80; // Mask off the exponent, leaving just the mantissa u.i = (u.i & 0x7fffff) + 0x3f800000; // Interpolate using a cubic minimax polynomial derived with // the Remez exchange algorithm. Coefficients courtesy of Alex Kan. // This approximates 1 + log2 of the mantissa. float r = ((0.15824870f * u.f - 1.05187502f) * u.f + 3.04788415f) * u.f - 1.15360271f; // The log2 of the complete value is then the sum // of the previous quantities (the 1's cancel), and // we find the natural log by scaling by log2(e). *(c + i) = (e + r) * 0.69314718f; } }
Implement faster natural log function
Implement faster natural log function Signed-off-by: Warren Moore <4fdbf0932cf8fc9903ee31afa97cf723d35eb3f3@warrenmoore.net>
C
apache-2.0
eliteraspberries/pal,parallella/pal,olajep/pal,aolofsson/pal,debug-de-su-ka/pal,debug-de-su-ka/pal,olajep/pal,parallella/pal,aolofsson/pal,eliteraspberries/pal,8l/pal,8l/pal,RafaelRMA/pal,aolofsson/pal,olajep/pal,parallella/pal,8l/pal,Adamszk/pal3,8l/pal,eliteraspberries/pal,mateunho/pal,Adamszk/pal3,mateunho/pal,parallella/pal,eliteraspberries/pal,eliteraspberries/pal,RafaelRMA/pal,debug-de-su-ka/pal,aolofsson/pal,Adamszk/pal3,RafaelRMA/pal,Adamszk/pal3,mateunho/pal,mateunho/pal,mateunho/pal,RafaelRMA/pal,debug-de-su-ka/pal,parallella/pal,olajep/pal,debug-de-su-ka/pal
e836bae30c73e4d63e1126c3308dccba350a4154
include/llvm/CodeGen/SSARegMap.h
include/llvm/CodeGen/SSARegMap.h
//===-- llvm/CodeGen/SSARegMap.h --------------------------------*- C++ -*-===// // // Map register numbers to register classes that are correctly sized (typed) to // hold the information. Assists register allocation. Contained by // MachineFunction, should be deleted by register allocator when it is no // longer needed. // //===----------------------------------------------------------------------===// #ifndef LLVM_CODEGEN_SSAREGMAP_H #define LLVM_CODEGEN_SSAREGMAP_H #include "llvm/Target/MRegisterInfo.h" class TargetRegisterClass; class SSARegMap { std::vector<const TargetRegisterClass*> RegClassMap; unsigned rescale(unsigned Reg) { return Reg - MRegisterInfo::FirstVirtualRegister; } public: const TargetRegisterClass* getRegClass(unsigned Reg) { unsigned actualReg = rescale(Reg); assert(actualReg < RegClassMap.size() && "Register out of bounds"); return RegClassMap[actualReg]; } void addRegMap(unsigned Reg, const TargetRegisterClass* RegClass) { assert(rescale(Reg) == RegClassMap.size() && "Register mapping not added in sequential order!"); RegClassMap.push_back(RegClass); } }; #endif
//===-- llvm/CodeGen/SSARegMap.h --------------------------------*- C++ -*-===// // // Map register numbers to register classes that are correctly sized (typed) to // hold the information. Assists register allocation. Contained by // MachineFunction, should be deleted by register allocator when it is no // longer needed. // //===----------------------------------------------------------------------===// #ifndef LLVM_CODEGEN_SSAREGMAP_H #define LLVM_CODEGEN_SSAREGMAP_H #include "llvm/Target/MRegisterInfo.h" class TargetRegisterClass; class SSARegMap { std::vector<const TargetRegisterClass*> RegClassMap; unsigned rescale(unsigned Reg) { return Reg - MRegisterInfo::FirstVirtualRegister; } public: const TargetRegisterClass* getRegClass(unsigned Reg) { unsigned actualReg = rescale(Reg); assert(actualReg < RegClassMap.size() && "Register out of bounds"); return RegClassMap[actualReg]; } /// createVirtualRegister - Create and return a new virtual register in the /// function with the specified register class. /// unsigned createVirtualRegister(const TargetRegisterClass *RegClass) { RegClassMap.push_back(RegClass); return RegClassMap.size()+MRegisterInfo::FirstVirtualRegister-1; } }; #endif
Simplify interface to creating a register
Simplify interface to creating a register git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@5211 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm
c0d2000ad1a76b23efb1773cf8db0c45cef560d0
Source/UnrealCV/Private/libs/cnpy.h
Source/UnrealCV/Private/libs/cnpy.h
// Copyright (C) 2011 Carl Rogers // Released under MIT License // Simplied by Weichao Qiu (qiuwch@gmail.com) from https://github.com/rogersce/cnpy #pragma once #include <vector> namespace cnpy { template<typename T> std::vector<char> create_npy_header(const T* data, const std::vector<int> shape); template<typename T> std::vector<char>& operator+=(std::vector<char>& lhs, const T rhs) { //write in little endian for (char byte = 0; byte < sizeof(T); byte++) { char val = *((char*)&rhs + byte); lhs.push_back(val); } return lhs; } template<> std::vector<char>& operator+=(std::vector<char>& lhs, const std::string rhs); template<> std::vector<char>& operator+=(std::vector<char>& lhs, const char* rhs); }
// Copyright (C) 2011 Carl Rogers // Released under MIT License // Simplied by Weichao Qiu (qiuwch@gmail.com) from https://github.com/rogersce/cnpy #pragma once #include <vector> #include <string> namespace cnpy { template<typename T> std::vector<char> create_npy_header(const T* data, const std::vector<int> shape); template<typename T> std::vector<char>& operator+=(std::vector<char>& lhs, const T rhs) { //write in little endian for (char byte = 0; byte < sizeof(T); byte++) { char val = *((char*)&rhs + byte); lhs.push_back(val); } return lhs; } template<> std::vector<char>& operator+=(std::vector<char>& lhs, const std::string rhs); template<> std::vector<char>& operator+=(std::vector<char>& lhs, const char* rhs); }
Fix a compilation error for UE4.12.
Fix a compilation error for UE4.12.
C
mit
unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv
8597a0bd12c09d88dc5a41072446af219055b1ae
messagebox.c
messagebox.c
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <windows.h> #define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\ (v=vs.85).aspx" #define VERSION "0.1.0" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine, int nShowCmd) { LPWSTR *szArgList; int argCount; szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount); if (szArgList == NULL) { fprintf(stderr, "Unable to parse the command line.\n"); return 255; } if (argCount < 3 || argCount > 4) { fprintf(stderr, "Batch MessageBox v" VERSION "\n", szArgList[0]); fprintf(stderr, "Usage: %ls message title [type]\n\n", szArgList[0]); fprintf(stderr, "Calls MessageBoxW() with the given arguments. See\n" URL "\nfor the possible values of \"type\". " "ERRORLEVEL is the return value or 255 on\nerror.\n"); return 255; } int type = _wtoi(szArgList[3]); int button = MessageBoxW(NULL, szArgList[1], szArgList[2], type); LocalFree(szArgList); return button; }
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <windows.h> #define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\ (v=vs.85).aspx" #define VERSION "0.1.0" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine, int nShowCmd) { LPWSTR *szArgList; int argCount; szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount); if (szArgList == NULL) { fprintf(stderr, "Unable to parse the command line.\n"); return 255; } if (argCount < 3 || argCount > 4) { fprintf(stderr, "Batch MessageBox v" VERSION "\n"); fprintf(stderr, "Usage: %ls message title [type]\n\n", szArgList[0]); fprintf(stderr, "Calls MessageBoxW() with the given arguments. See\n" URL "\nfor the possible values of \"type\". " "ERRORLEVEL is the return value or 255 on\nerror.\n"); return 255; } /* Ignore _wtoi errors. */ int type = _wtoi(szArgList[3]); int button = MessageBoxW(NULL, szArgList[1], szArgList[2], type); LocalFree(szArgList); return button; }
Remove unused fprintf arg; add comment on _wtoi
Remove unused fprintf arg; add comment on _wtoi
C
mit
dbohdan/messagebox,dbohdan/messagebox