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
2cd50fa07e9364b98c99643a006fdea5e079ff31
hittop/parser/parser.h
hittop/parser/parser.h
// Defines the generic Parser interface for the Casper parser generator library. // #ifndef HITTOP_PARSER_PARSER_H #define HITTOP_PARSER_PARSER_H #include "hittop/parser/parse_error.h" #include "hittop/util/fallible.h" namespace hittop { namespace parser { using util::Fallible; /// The form of a Parser class. There is no generic implementation of Parser, /// only partial and full specializations that define how to parse specific /// grammars. template <typename Grammar> class Parser; /// Convenience wrapper around defining a new Parser object and invoking it on /// the given input range. Allows the invocation operator defined on /// Parser<Grammer> to be non-const, as the parser instance created within this /// function is itself non-const. template <typename Grammar, typename Range> auto Parse(const Range &input) -> decltype(std::declval<Parser<Grammar>>()(input)) { Parser<Grammar> parser; return parser(input); } } // namespace parser } // namespace hittop #endif // HITTOP_PARSER_PARSER_H
// Defines the generic Parser interface for the Casper parser generator library. // #ifndef HITTOP_PARSER_PARSER_H #define HITTOP_PARSER_PARSER_H #include "boost/range/as_literal.hpp" #include "hittop/parser/parse_error.h" #include "hittop/util/fallible.h" namespace hittop { namespace parser { using util::Fallible; /// The form of a Parser class. There is no generic implementation of Parser, /// only partial and full specializations that define how to parse specific /// grammars. template <typename Grammar> class Parser; /// Convenience wrapper around defining a new Parser object and invoking it on /// the given input range. Allows the invocation operator defined on /// Parser<Grammer> to be non-const, as the parser instance created within this /// function is itself non-const. template <typename Grammar, typename Range> auto Parse(const Range &input) -> decltype(std::declval<Parser<Grammar>>()(input)) { Parser<Grammar> parser; return parser(input); } /// Convenience function that parsers a C string as a literal character range. template <typename Grammar> auto Parse(const char *input) -> decltype(Parse<Grammar>(boost::as_literal(input))) { return Parse<Grammar>(boost::as_literal(input)); } } // namespace parser } // namespace hittop #endif // HITTOP_PARSER_PARSER_H
Add convenience overload of Parse that accepts c-string literals
Add convenience overload of Parse that accepts c-string literals
C
apache-2.0
hittop/hittop,hittop/hittop
76f394247acc79e003beeb06fa286f246ea7685a
test2/code_gen/dead_code_elim.c
test2/code_gen/dead_code_elim.c
// RUN: %ocheck 3 %s g() { return 3; } main() { if(0){ f(); // shouldn't hit a linker error here - dead code a: return g(); } goto a; }
// RUN: %ocheck 3 %s -g // test debug emission too g() { return 3; } main() { if(0){ int i; f(); // shouldn't hit a linker error here - dead code a: i = 2; return g(i); } goto a; }
Test debug label emission with local variables
Test debug label emission with local variables
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
80867bf2320444893e7248bead8b63aec23993a4
core/base/inc/RVersion.h
core/base/inc/RVersion.h
#ifndef ROOT_RVersion #define ROOT_RVersion /* Version information automatically generated by installer. */ /* * These macros can be used in the following way: * * #if ROOT_VERSION_CODE >= ROOT_VERSION(2,23,4) * #include <newheader.h> * #else * #include <oldheader.h> * #endif * */ #define ROOT_RELEASE "5.34/22" #define ROOT_RELEASE_DATE "Oct 10 2014" #define ROOT_RELEASE_TIME "15:29:14" #define ROOT_SVN_REVISION 49361 #define ROOT_GIT_COMMIT "v5-34-21-104-gf821c17" #define ROOT_GIT_BRANCH "heads/v5-34-00-patches" #define ROOT_VERSION_CODE 336406 #define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #endif
#ifndef ROOT_RVersion #define ROOT_RVersion /* Version information automatically generated by installer. */ /* * These macros can be used in the following way: * * #if ROOT_VERSION_CODE >= ROOT_VERSION(2,23,4) * #include <newheader.h> * #else * #include <oldheader.h> * #endif * */ #define ROOT_RELEASE "5.34/23" #define ROOT_RELEASE_DATE "Nov 7 2014" #define ROOT_RELEASE_TIME "15:06:58" #define ROOT_SVN_REVISION 49361 #define ROOT_GIT_COMMIT "v5-34-22-106-g4a0dea3" #define ROOT_GIT_BRANCH "heads/v5-34-00-patches" #define ROOT_VERSION_CODE 336407 #define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #endif
Update ROOT version files to v5.34/23.
Update ROOT version files to v5.34/23.
C
lgpl-2.1
tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot,tc3t/qoot
cd24cba0c92904ec7ee0a521d7074b3e232261ca
src/modules/conf_theme/e_int_config_theme.h
src/modules/conf_theme/e_int_config_theme.h
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_INT_CONFIG_THEME_H #define E_INT_CONFIG_THEME_H EAPI E_Config_Dialog *e_int_config_theme(E_Container *con, const char *params __UNUSED__); EAPI void e_int_config_theme_import_done(E_Config_Dialog *dia); EAPI void e_int_config_theme_update(E_Config_Dialog *dia, char *file); #endif #endif
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_INT_CONFIG_THEME_H #define E_INT_CONFIG_THEME_H EAPI E_Config_Dialog *e_int_config_theme(E_Container *con, const char *params __UNUSED__); EAPI void e_int_config_theme_import_done(E_Config_Dialog *dia); EAPI void e_int_config_theme_update(E_Config_Dialog *dia, char *file); EAPI void e_int_config_theme_web_done(E_Config_Dialog *dia); #endif #endif
Declare public function in header.
Declare public function in header. SVN revision: 35475
C
bsd-2-clause
rvandegrift/e,FlorentRevest/Enlightenment,tasn/enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment
ba796b0f15918634fdab02132879016a50183ba4
include/libk/physical_allocator.h
include/libk/physical_allocator.h
#ifndef PHYSICAL_ALLOCATOR_H #define PHYSICAL_ALLOCATOR_H typedef uint32_t page_frame_t; #define PAGE_FRAME_CACHE_SIZE 32 #define PAGE_FRAME_MAP_SIZE (PHYS_MEMORY_SIZE/8/PAGE_SIZE) // Linear search of page frame bitmap page_frame_t alloc_frame_helper(); void free_frame(page_frame_t frame); page_frame_t alloc_frame(); void use_frame(page_frame_t frame); #endif
#ifndef PHYSICAL_ALLOCATOR_H #define PHYSICAL_ALLOCATOR_H #include <stdint.h> #include <stddef.h> #include <libk/kabort.h> #include <libk/kassert.h> #include <libk/kputs.h> #ifdef ARCH_X86 #include <arch/x86/memlayout.h> #endif #ifdef ARCH_USERLAND #include "tests/memlayout.h" #endif typedef uint32_t page_frame_t; #define BIT_INDEX(x) (1 << ((x) % 8)) #define BYTE_INDEX(x) ((x)/8) #define PAGE_FRAME_CACHE_SIZE 32 #define PAGE_FRAME_MAP_SIZE (PHYS_MEMORY_SIZE/8/PAGE_SIZE) // Linear search of page frame bitmap page_frame_t alloc_frame_helper(); void free_frame(page_frame_t frame); page_frame_t alloc_frame(); void use_frame(page_frame_t frame); #endif
Create macros for certain repetitive shifts
Create macros for certain repetitive shifts
C
mit
awensaunders/kernel-of-truth,Herbstein/kernel-of-truth,awensaunders/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,Herbstein/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,Herbstein/kernel-of-truth,awensaunders/kernel-of-truth
12a7262f437f301f6004fb06a4634543685e532e
tests/apps/seh.c
tests/apps/seh.c
/************************************************************************** * * Copyright 2015 Jose Fonseca * All Rights Reserved. * * 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, sub license, 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 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 NON-INFRINGEMENT. NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OF OR CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS THE SOFTWARE. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * **************************************************************************/ #include <windows.h> int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { RaiseException(100, EXCEPTION_NONCONTINUABLE, 0, NULL); return 0; }
/************************************************************************** * * Copyright 2015 Jose Fonseca * All Rights Reserved. * * 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, sub license, 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 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 NON-INFRINGEMENT. NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OF OR CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS THE SOFTWARE. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * **************************************************************************/ #include <windows.h> int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { RaiseException(0xE0000001, EXCEPTION_NONCONTINUABLE, 0, NULL); return 0; }
Use a better custom exception code.
test/apps: Use a better custom exception code.
C
lgpl-2.1
jrfonseca/drmingw,jrfonseca/drmingw,jrfonseca/drmingw,jrfonseca/drmingw
fd94904f4bffbcd8eec0ce025e7123fcb7569c03
tests/regression/06-symbeq/24-escape_rc.c
tests/regression/06-symbeq/24-escape_rc.c
// PARAM: --set ana.activated[+] "'var_eq'" // Copy of 04/45 with var_eq enabled // octApron needs to be included again and fixed #include <pthread.h> #include <stdio.h> pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int *p = (int *) arg; pthread_mutex_lock(&mutex1); (*p)++; pthread_mutex_unlock(&mutex1); return NULL; } int main(void) { pthread_t id; int i = 0; pthread_create(&id, NULL, t_fun, (void *) &i); pthread_mutex_lock(&mutex2); assert(i == 0); // UNKNOWN! pthread_mutex_unlock(&mutex2); pthread_join (id, NULL); return 0; }
// PARAM: --set ana.activated[+] "'var_eq'" // Copy of 04/45 with var_eq enabled #include <pthread.h> #include <stdio.h> pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int *p = (int *) arg; pthread_mutex_lock(&mutex1); (*p)++; pthread_mutex_unlock(&mutex1); return NULL; } int main(void) { pthread_t id; int i = 0; pthread_create(&id, NULL, t_fun, (void *) &i); pthread_mutex_lock(&mutex2); assert(i == 0); // UNKNOWN! pthread_mutex_unlock(&mutex2); pthread_join (id, NULL); return 0; }
Remove outdated octApron comment from 06/24
Remove outdated octApron comment from 06/24
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
9ad7e0d7b5652d3279d227a1537c3b39b8cad1d0
test/Sema/crash-invalid-array.c
test/Sema/crash-invalid-array.c
// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -verify %s // PR6913 #include <stdio.h> int main() { int x[10][10]; int (*p)[] = x; int i; for(i = 0; i < 10; ++i) { p[i][i] = i; // expected-error {{subscript of pointer to incomplete type 'int []'}} } } // rdar://13705391 void foo(int a[*][2]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo1(int a[2][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo2(int a[*][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo3(int a[2][*][2]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}} void foo4(int a[2][*][*]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}}
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s // PR6913 int main() { int x[10][10]; int (*p)[] = x; int i; for(i = 0; i < 10; ++i) { p[i][i] = i; // expected-error {{subscript of pointer to incomplete type 'int []'}} } } // rdar://13705391 void foo(int a[*][2]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo1(int a[2][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo2(int a[*][*]) {(void)a[0][1]; } // expected-error {{variable length array must be bound in function definition}} void foo3(int a[2][*][2]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}} void foo4(int a[2][*][*]) {(void)a[0][1][1]; } // expected-error {{variable length array must be bound in function definition}}
Remove an old stdio.h include from the invalid-array test
Remove an old stdio.h include from the invalid-array test This should get it up and running on win and other builders without system headers. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@196738 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/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
d3464b2f5f46a6db68f66a62e9d130b744cc6594
src/executeStage.h
src/executeStage.h
/* * File: executeStage.h * Author: Alex Savarda */ #define INSTR_COUNT 16 // Possible size of the instruction set #ifndef EXECUTESTAGE_H #define EXECUTESTAGE_H typedef struct { unsigned int stat; unsigned int icode; unsigned int ifun; unsigned int valC; unsigned int valA; unsigned int valB; unsigned int dstE; unsigned int dstM; unsigned int srcA; unsigned int srcB; } eregister; struct E { unsigned int stat; unsigned int icode; unsigned int ifun; unsigned int valC; unsigned int valA; unsigned int valB; unsigned int dstE; unsigned int dstM; unsigned int srcA; unsigned int srcB; }; // Function prototypes eregister getEregister(void); void clearEregister(void); void executeStage(); void initFuncPtrArray(void); void updateEregister(unsigned int stat, unsigned int icode, unsigned int ifun, unsigned int valC, unsigned int valA, unsigned int valB, unsigned int dstE, unsigned int dstM, unsigned int srcA, unsigned int srcB); #endif /* EXECUTESTAGE_H */
/* * File: executeStage.h * Author: Alex Savarda */ #define INSTR_COUNT 16 // Possible size of the instruction set #ifndef EXECUTESTAGE_H #define EXECUTESTAGE_H typedef struct { unsigned int stat; unsigned int icode; unsigned int ifun; unsigned int valC; unsigned int valA; unsigned int valB; unsigned int dstE; unsigned int dstM; unsigned int srcA; unsigned int srcB; } eregister; struct E { unsigned int stat; unsigned int icode; unsigned int ifun; unsigned int valC; unsigned int valA; unsigned int valB; unsigned int dstE; unsigned int dstM; unsigned int srcA; unsigned int srcB; }; // Function prototypes eregister getEregister(void); void clearEregister(void); void executeStage(); void initFuncPtrArray(void); void updateEregister(unsigned int stat, unsigned int icode, unsigned int ifun, unsigned int valC, unsigned int valA, unsigned int valB, unsigned int dstE, unsigned int dstM, unsigned int srcA, unsigned int srcB); #endif /* EXECUTESTAGE_H */
Convert a tab into a space
Convert a tab into a space
C
isc
sbennett1990/YESS,sbennett1990/YESS,sbennett1990/YESS
c0355a5eb3d8787fbd9bcac928e649b3381f73a3
modlib.h
modlib.h
/* This is main header file that is ought to be included as library */ //Include proper header files #include <string.h> #include <stdlib.h> #include <inttypes.h> #include "parser.h" //Function prototypes extern uint16_t MODBUSSwapEndian( uint16_t ); extern uint16_t MODBUSCRC16( uint16_t *, uint16_t );
/* This is main header file that is ought to be included as library */ //Include proper header files #include <string.h> #include <stdlib.h> #include <inttypes.h> //Function prototypes extern uint16_t MODBUSSwapEndian( uint16_t ); extern uint16_t MODBUSCRC16( uint8_t *, uint16_t );
Remove inclusion of 'parser.h' and fix pointer type
Remove inclusion of 'parser.h' and fix pointer type
C
mit
Jacajack/modlib
d7a05b9d921d191923ded5e9770339a0bebca33b
ComponentImplementationInclude.h
ComponentImplementationInclude.h
#include "Components.h" class HealthComponent : public HealthComponentBase { public: HealthComponent(Entity* entity, int maxHealth, int startHealth, const int& Health): HealthComponentBase(entity, maxHealth, startHealth, Health) { } void OnHeal(int amount) { } void OnDamage(int amount) { } void AttribHealth(int health) { } }; class MonsterDieComponent : public MonsterDieComponentBase { public: MonsterDieComponent(Entity* entity): MonsterDieComponentBase(entity) { } void OnDie() { } };
#include "Components.h" class HealthComponent : public HealthComponentBase { public: HealthComponent(Entity* entity, int maxHealth, int startHealth, const int& Health): HealthComponentBase(entity, maxHealth, startHealth, Health) { } void HandleHeal(int amount) { } void HandleDamage(int amount) { } void AttribHealth(int health) { } }; class MonsterDieComponent : public MonsterDieComponentBase { public: MonsterDieComponent(Entity* entity): MonsterDieComponentBase(entity) { } void HandleDie() { } };
Fix the small test to use Handle instead of On
Fix the small test to use Handle instead of On
C
bsd-3-clause
DaemonDevelopers/CBSE-Toolchain,DaemonDevelopers/CBSE-Toolchain,DaemonDevelopers/CBSE-Toolchain
4bb3e5fe554bc5d9e54924456a8711c3e40e6191
hard_way/ex15.c
hard_way/ex15.c
#include <stdio.h> int main(int argc, char *argv[]){ //create two arrays we care about int ages[] = {23,55,15,34,78,12}; char *names[] = { "Feinb", "Fhilp", "Wastan", "Wustak","Henris","Abkar" }; //safely get the size of ages int count = sizeof(ages) / sizeof(int); int i = 0; //first way using indexing for(i = 0; i < count; i++){ printf("%s had lived for %d years.\n", names[i], ages[i]); } printf("---\n"); return 0; }
#include <stdio.h> int main(int argc, char *argv[]){ //create two arrays we care about int ages[] = {23,55,15,34,78,12}; char *names[] = { "Feinb", "Fhilp", "Wastan", "Wustak","Henris","Abkar" }; //safely get the size of ages int count = sizeof(ages) / sizeof(int); int i = 0; //first way using indexing for(i = 0; i < count; i++){ printf("%s has lived for %d years.\n", names[i], ages[i]); } printf("---\n"); //setup pointers to the start of the arrays int *cur_age = ages; char **cur_name = names; // second way using pointers for(i = 0; i < count; i++){ printf("%s is %d years old.\n", *(cur_name+i), *(cur_age+i)); } printf("---\n"); return 0; }
Use pointers to start of arrays
Use pointers to start of arrays
C
mit
thewazir/learning_c
93802e24742842db185ead1cf18db9827a3d8664
include/IFile.h
include/IFile.h
#ifndef IFILE_H #define IFILE_H #include <vector> #include <memory> #include "IMediaLibrary.h" #include "ITrackInformation.h" class IAlbumTrack; class IShowEpisode; class ITrackInformation; class IFile { public: enum Type { VideoType, // Any video file, not being a tv show episode AudioType, // Any kind of audio file, not being an album track ShowEpisodeType, AlbumTrackType, UnknownType, }; virtual ~IFile() {} virtual unsigned int id() const = 0; virtual AlbumTrackPtr albumTrack() = 0; virtual bool setAlbumTrack(AlbumTrackPtr albumTrack ) = 0; virtual unsigned int duration() const = 0; virtual std::shared_ptr<IShowEpisode> showEpisode() = 0; virtual bool setShowEpisode( ShowEpisodePtr showEpisode ) = 0; virtual int playCount() const = 0; virtual const std::string& mrl() const = 0; virtual bool addLabel( LabelPtr label ) = 0; virtual bool removeLabel( LabelPtr label ) = 0; virtual MoviePtr movie() = 0; virtual bool setMovie( MoviePtr movie ) = 0; virtual std::vector<std::shared_ptr<ILabel> > labels() = 0; }; #endif // IFILE_H
#ifndef IFILE_H #define IFILE_H #include <vector> #include <memory> #include "IMediaLibrary.h" #include "ITrackInformation.h" class IAlbumTrack; class IShowEpisode; class ITrackInformation; class IFile { public: enum Type { VideoType, // Any video file, not being a tv show episode AudioType, // Any kind of audio file, not being an album track ShowEpisodeType, AlbumTrackType, UnknownType }; virtual ~IFile() {} virtual unsigned int id() const = 0; virtual AlbumTrackPtr albumTrack() = 0; virtual bool setAlbumTrack(AlbumTrackPtr albumTrack ) = 0; virtual unsigned int duration() const = 0; virtual std::shared_ptr<IShowEpisode> showEpisode() = 0; virtual bool setShowEpisode( ShowEpisodePtr showEpisode ) = 0; virtual int playCount() const = 0; virtual const std::string& mrl() const = 0; virtual bool addLabel( LabelPtr label ) = 0; virtual bool removeLabel( LabelPtr label ) = 0; virtual MoviePtr movie() = 0; virtual bool setMovie( MoviePtr movie ) = 0; virtual std::vector<std::shared_ptr<ILabel> > labels() = 0; }; #endif // IFILE_H
Fix a warning with -pedantic on some old gcc versions
Fix a warning with -pedantic on some old gcc versions
C
lgpl-2.1
chouquette/medialibrary,chouquette/medialibrary,chouquette/medialibrary,chouquette/medialibrary
2803a40fe335a29f9584911d1a52856bdb302df7
webrtc/modules/audio_coding/codecs/ilbc/nearest_neighbor.c
webrtc/modules/audio_coding/codecs/ilbc/nearest_neighbor.c
/* * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ /****************************************************************** iLBC Speech Coder ANSI-C Source Code WebRtcIlbcfix_NearestNeighbor.c ******************************************************************/ #include "defines.h" void WebRtcIlbcfix_NearestNeighbor(size_t* index, const size_t* array, size_t value, size_t arlength) { size_t min_diff = (size_t)-1; for (size_t i = 0; i < arlength; i++) { const size_t diff = (array[i] < value) ? (value - array[i]) : (array[i] - value); if (diff < min_diff) { *index = i; min_diff = diff; } } }
/* * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ /****************************************************************** iLBC Speech Coder ANSI-C Source Code WebRtcIlbcfix_NearestNeighbor.c ******************************************************************/ #include "defines.h" void WebRtcIlbcfix_NearestNeighbor(size_t* index, const size_t* array, size_t value, size_t arlength) { size_t i; size_t min_diff = (size_t)-1; for (i = 0; i < arlength; i++) { const size_t diff = (array[i] < value) ? (value - array[i]) : (array[i] - value); if (diff < min_diff) { *index = i; min_diff = diff; } } }
Fix ChromeOS build (C99 break)
Fix ChromeOS build (C99 break) BUG=5016 TBR=henrik.lundin@webrtc.org Review URL: https://codereview.webrtc.org/1354163002 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#9992}
C
bsd-3-clause
TimothyGu/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc
405107c556390b65fecb7b20c8d7c33d53c34b9e
include/chewing-compat.h
include/chewing-compat.h
/* * chewing-compat.h * * Copyright (c) 2014 * libchewing Core Team. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ #ifndef _CHEWING_COMPAT_ #define _CHEWING_COMPAT_ /** @brief indicate the internal encoding of data processing. * @since 0.3.0 */ #define LIBCHEWING_ENCODING "UTF-8" /* deprecated function. for API compatibility */ CHEWING_API int chewing_zuin_Check(ChewingContext *ctx) DEPRECATED_FOR(chewing_bopomofo_Check); CHEWING_API char *chewing_zuin_String(ChewingContext *, int *zuin_count) DEPRECATED_FOR(chewing_bopomofo_String_static); CHEWING_API int chewing_Init(const char *dataPath, const char *hashPath) DEPRECATED; CHEWING_API void chewing_Terminate() DEPRECATED; CHEWING_API int chewing_Configure(ChewingContext *ctx, ChewingConfigData * pcd) DEPRECATED_FOR(chewing_set_*); CHEWING_API void chewing_set_hsuSelKeyType(ChewingContext *ctx, int mode) DEPRECATED_FOR(chewing_set_selKey); CHEWING_API int chewing_get_hsuSelKeyType(ChewingContext *ctx) DEPRECATED_FOR(chewing_get_selKey); #endif
/* * chewing-compat.h * * Copyright (c) 2014 * libchewing Core Team. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ /* *INDENT-OFF* */ #ifndef _CHEWING_COMPAT_ #define _CHEWING_COMPAT_ /* *INDENT-ON* */ /** @brief indicate the internal encoding of data processing. * @since 0.3.0 */ #define LIBCHEWING_ENCODING "UTF-8" /* deprecated function. for API compatibility */ CHEWING_API int chewing_zuin_Check(ChewingContext *ctx) DEPRECATED_FOR(chewing_bopomofo_Check); CHEWING_API char *chewing_zuin_String(ChewingContext *, int *zuin_count) DEPRECATED_FOR(chewing_bopomofo_String_static); CHEWING_API int chewing_Init(const char *dataPath, const char *hashPath) DEPRECATED; CHEWING_API void chewing_Terminate() DEPRECATED; CHEWING_API int chewing_Configure(ChewingContext *ctx, ChewingConfigData * pcd) DEPRECATED_FOR(chewing_set_*); CHEWING_API void chewing_set_hsuSelKeyType(ChewingContext *ctx, int mode) DEPRECATED_FOR(chewing_set_selKey); CHEWING_API int chewing_get_hsuSelKeyType(ChewingContext *ctx) DEPRECATED_FOR(chewing_get_selKey); /* *INDENT-OFF* */ #endif /* *INDENT-ON* */
Add indent comment for header guard
Add indent comment for header guard
C
lgpl-2.1
chewing/libchewing,bbyykk/libtaigi,PingNote/libchewing,czchen/libchewing,cwlin/libchewing,PeterDaveHello/libchewing,simonfork/libchewing,PingNote/libchewing,yan12125/libchewing,yan12125/libchewing,bbyykk/libtaigi,ShengYenPeng/libchewing,Chocobo1/libchewing,mangokingTW/libchewing,cwlin/libchewing,hiunnhue/libchewing,bbyykk/libtaigi,cwlin/libchewing,PeterDaveHello/libchewing,PeterDaveHello/libchewing,yan12125/libchewing,simonfork/libchewing,yan12125/libchewing,chewing/libchewing,kito-cheng/libchewing,mangokingTW/libchewing,PingNote/libchewing,hiunnhue/libchewing,hiunnhue/libchewing,kito-cheng/libchewing,robert501128/libchewing,czchen/libchewing,chewing/libchewing,kito-cheng/libchewing,chewing/libchewing,dimotsai/libchewing,PingNote/libchewing,PeterDaveHello/libchewing,mangokingTW/libchewing,cwlin/libchewing,bbyykk/libtaigi,Chocobo1/libchewing,hiunnhue/libchewing,robert501128/libchewing,czchen/libchewing,czchen/libchewing,Chocobo1/libchewing,ShengYenPeng/libchewing,Chocobo1/libchewing,simonfork/libchewing,hiunnhue/libchewing,dimotsai/libchewing,dimotsai/libchewing,dimotsai/libchewing,Chocobo1/libchewing,simonfork/libchewing,cwlin/libchewing,robert501128/libchewing,kito-cheng/libchewing,robert501128/libchewing,bbyykk/libtaigi,ShengYenPeng/libchewing,ShengYenPeng/libchewing,mangokingTW/libchewing
1fad3482bb25c2d77ac5ceb8b48b6985d91f7f48
sticks.c
sticks.c
#include <stdio.h> typedef struct { int hands[2][2]; int turn; } Sticks; void sticks_create(Sticks *sticks) { sticks->hands[0][0] = 1; sticks->hands[0][1] = 1; sticks->hands[1][0] = 1; sticks->hands[1][1] = 1; sticks->turn = 0; } void sticks_play(Sticks *sticks, int actor, int target) { sticks->hands[!sticks->turn][target] += sticks->hands[sticks->turn][actor]; sticks->turn = !sticks->turn; } int main(void) { Sticks sticks; sticks_create(&sticks); printf("%d\n", sticks.hands[0][0]); printf("%d\n", sticks.turn); sticks_play(&sticks, 0, 1); printf("%d\n", sticks.hands[1][1]); printf("%d\n", sticks.turn); }
#include <stdio.h> typedef struct { int hands[2][2]; int turn; } Sticks; void sticks_create(Sticks *sticks) { sticks->hands[0][0] = 1; sticks->hands[0][1] = 1; sticks->hands[1][0] = 1; sticks->hands[1][1] = 1; sticks->turn = 0; } void sticks_play(Sticks *sticks, int actor, int target) { sticks->hands[!sticks->turn][target] += sticks->hands[sticks->turn][actor]; if (sticks->hands[!sticks->turn][target] >= 5) { sticks->hands[!sticks->turn][target] = 0; } sticks->turn = !sticks->turn; } int main(void) { Sticks sticks; sticks_create(&sticks); printf("%d\n", sticks.hands[0][0]); printf("%d\n", sticks.turn); sticks_play(&sticks, 0, 1); printf("%d\n", sticks.hands[1][1]); printf("%d\n", sticks.turn); }
Kill hands that reach five fingers
Kill hands that reach five fingers
C
mit
tysonzero/c-ann
e838c93903d30eb03b606b9932a2072df0061060
3RVX/Controllers/Volume/VolumeController.h
3RVX/Controllers/Volume/VolumeController.h
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once class VolumeTransformation; class VolumeController { public: struct DeviceInfo { std::wstring name; std::wstring id; }; /// <summary> /// Retrieves the current volume level as a float, ranging from 0.0 - 1.0 /// </summary> virtual float Volume() = 0; /// <summary>Sets the volume level. Valid range: 0.0 - 1.0</summary> virtual void Volume(float vol) = 0; virtual bool Muted() = 0; virtual void Muted(bool mute) = 0; virtual void ToggleMute() { (Muted() == true) ? Muted(false) : Muted(true); } virtual void AddTransformation(VolumeTransformation *transform) = 0; virtual void RemoveTransformation(VolumeTransformation *transform) = 0; public: static const int MSG_VOL_CHNG = WM_APP + 1080; static const int MSG_VOL_DEVCHNG = WM_APP + 1081; };
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once class VolumeTransformation; class VolumeController { public: struct DeviceInfo { std::wstring name; std::wstring id; }; /// <summary> /// Retrieves the current volume level as a float, ranging from 0.0 - 1.0 /// </summary> virtual float Volume() = 0; /// <summary>Sets the volume level. Valid range: 0.0 - 1.0</summary> virtual void Volume(float vol) = 0; virtual bool Muted() = 0; virtual void Muted(bool mute) = 0; virtual void ToggleMute() { (Muted() == true) ? Muted(false) : Muted(true); } virtual void Enabled() = 0; virtual void AddTransformation(VolumeTransformation *transform) = 0; virtual void RemoveTransformation(VolumeTransformation *transform) = 0; public: static const int MSG_VOL_CHNG = WM_APP + 1080; static const int MSG_VOL_DEVCHNG = WM_APP + 1081; };
Add method to check audio device state
Add method to check audio device state
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
de9495f69321629067ec16ec41e271eeecca5a22
Source/Headers/InTimeShouldSyntax.h
Source/Headers/InTimeShouldSyntax.h
#import "AsyncActualValue.h" namespace CedarAsync { template<typename T> struct InTimeMarker { T(^actualExpression)(void); const char *fileName; int lineNumber; }; template<typename T> const AsyncActualValue<T> operator,(const InTimeMarker<T> & marker, const Cedar::Matchers::ActualValueMarker & _) { return AsyncActualValue<T>(marker.fileName, marker.lineNumber, marker.actualExpression); } template<typename T> const AsyncActualValueMatchProxy<T> operator,(const AsyncActualValue<T> & actualValue, bool negate) { return negate ? actualValue.to_not : actualValue.to; } template<typename T, typename MatcherType> void operator,(const AsyncActualValueMatchProxy<T> & matchProxy, const MatcherType & matcher) { matchProxy(matcher); } } #ifndef CEDAR_ASYNC_DISALLOW_IN_TIME #define in_time(x) (InTimeMarker<typeof(x)>){^{return x;}, __FILE__, __LINE__} #endif
#import "AsyncActualValue.h" namespace CedarAsync { template<typename T> struct InTimeMarker { T(^actualExpression)(void); const char *fileName; int lineNumber; }; template<typename T> const AsyncActualValue<T> operator,(const InTimeMarker<T> & marker, const Cedar::Matchers::ActualValueMarker & _) { return AsyncActualValue<T>(marker.fileName, marker.lineNumber, marker.actualExpression); } template<typename T> const AsyncActualValueMatchProxy<T> operator,(const AsyncActualValue<T> & actualValue, bool negate) { return negate ? actualValue.to_not : actualValue.to; } template<typename T, typename MatcherType> void operator,(const AsyncActualValueMatchProxy<T> & matchProxy, const MatcherType & matcher) { matchProxy(matcher); } } #ifndef CEDAR_ASYNC_DISALLOW_IN_TIME #define in_time(x) (InTimeMarker<__typeof__(x)>){^{return x;}, __FILE__, __LINE__} #endif
Use __typeof__ since typeof is unavailable in our build
Use __typeof__ since typeof is unavailable in our build
C
mit
cppforlife/CedarAsync,cppforlife/CedarAsync
12f1e5c3a3b2948359da2f87937214ee413db567
native/include/ssl_private.h
native/include/ssl_private.h
/* Copyright 2000-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SSL_PRIVATE_H #define SSL_PRIVATE_H /* OpenSSL headers */ #include <openssl/ssl.h> #include <openssl/err.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/crypto.h> #include <openssl/evp.h> #include <openssl/rand.h> #include <openssl/x509v3.h> /* Avoid tripping over an engine build installed globally and detected * when the user points at an explicit non-engine flavor of OpenSSL */ #if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT) #include <openssl/engine.h> #endif #endif /* SSL_PRIVATE_H */
/* Copyright 2000-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SSL_PRIVATE_H #define SSL_PRIVATE_H /* OpenSSL headers */ #include <openssl/ssl.h> #include <openssl/err.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/crypto.h> #include <openssl/evp.h> #include <openssl/rand.h> #include <openssl/x509v3.h> /* Avoid tripping over an engine build installed globally and detected * when the user points at an explicit non-engine flavor of OpenSSL */ #ifndef OPENSSL_NO_ENGINE #include <openssl/engine.h> #endif #endif /* SSL_PRIVATE_H */
Use OpenSSL engine by default.
Use OpenSSL engine by default. git-svn-id: b819289d3a0e8888cd070d2ae628b7cf730b797f@300663 13f79535-47bb-0310-9956-ffa450edef68
C
apache-2.0
apache/tomcat-native,andreydomas/tomcat-native,rmaucher/tomcat-native-openssl,rmaucher/tomcat-native-openssl,rmaucher/tomcat-native-openssl,apache/tomcat-native,apache/tomcat-native,apache/tomcat-native,andreydomas/tomcat-native,andreydomas/tomcat-native,rmaucher/tomcat-native-openssl,andreydomas/tomcat-native,andreydomas/tomcat-native,apache/tomcat-native,rmaucher/tomcat-native-openssl
dd15514211cdcdc037368e6b584dfe79e58f3535
onnx/optimizer/passes/optimize_pass.h
onnx/optimizer/passes/optimize_pass.h
#pragma once #include "onnx/onnx_pb.h" #include "onnx/ir.h" namespace onnx { namespace optimization { enum class API_TYPE { PROTO, IR }; struct OptimizePass { std::string name; API_TYPE type; explicit OptimizePass(const std::string name, API_TYPE type) : name(name), type(type) { } virtual void optimize(onnx::ModelProto& mp) {} virtual void optimize(Graph& graph) {} }; }} // namespace onnx::optimization
#pragma once #include "onnx/onnx_pb.h" #include "onnx/ir.h" namespace onnx { namespace optimization { enum class API_TYPE { PROTO, IR }; struct OptimizePass { std::string name; API_TYPE type; explicit OptimizePass(const std::string& name, API_TYPE type) : name(name), type(type) { } virtual void optimize(onnx::ModelProto& mp) {} virtual void optimize(Graph& graph) {} }; }} // namespace onnx::optimization
Fix the constructor of OptimizePass
Fix the constructor of OptimizePass
C
apache-2.0
onnx/onnx,onnx/onnx,onnx/onnx,onnx/onnx
4f75fcb3b8847d900a1f45b16e97c80d4e53ddbf
src/automaton.h
src/automaton.h
#ifndef _AUTOMATON_H_ #define _AUTOMATON_H_ /* * type and function definitions for an automaton */ #include "event.h" #include "srpc/srpc.h" typedef struct automaton Automaton; void au_init(void); Automaton *au_create(char *program, RpcConnection rpc, char *ebuf); int au_destroy(unsigned long id); void au_publish(unsigned long id, Event *event); unsigned long au_id(Automaton *au); Automaton *au_au(unsigned long id); RpcConnection au_rpc(Automaton *au); #endif /* _AUTOMATON_H_ */
#ifndef _AUTOMATON_H_ #define _AUTOMATON_H_ /* * Copyright (c) 2013, Court of the University of Glasgow * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of the University of Glasgow nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * type and function definitions for an automaton */ #include "event.h" #include "srpc/srpc.h" typedef struct automaton Automaton; void au_init(void); Automaton *au_create(char *program, RpcConnection rpc, char *ebuf); int au_destroy(unsigned long id); void au_publish(unsigned long id, Event *event); unsigned long au_id(Automaton *au); Automaton *au_au(unsigned long id); RpcConnection au_rpc(Automaton *au); #endif /* _AUTOMATON_H_ */
Add BSD 3-clause open source header
Add BSD 3-clause open source header
C
bsd-3-clause
fergul/Cache,jsventek/Cache,fergul/Cache,fergul/Cache,jsventek/Cache,jsventek/Cache
4d8786007aab2ffe8dddc5b9ca440e484f8b9b9e
AudioEndPointLibrary/AudioEndPointLibrary.h
AudioEndPointLibrary/AudioEndPointLibrary.h
#include "DefSoundDeviceState.h" #include "AudioEndPointLibraryImpl.h" // This class is exported from the AudioEndPointLibrary.dll namespace AudioEndPoint { class AUDIOENDPOINTLIBRARY_API CAudioEndPointLibrary { public: ~CAudioEndPointLibrary(); HRESULT OnDeviceStateChanged(LPCWSTR pwstr_device_id, DWORD dw_new_state) const; HRESULT OnDeviceAdded(LPCWSTR pwstr_device_id) const; HRESULT OnDeviceRemoved(LPCWSTR pwstr_device_id) const; HRESULT OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstr_default_device_id) const; static CAudioEndPointLibrary& GetInstance(); AudioDeviceList GetPlaybackDevices(DefSound::EDeviceState state) const; AudioDeviceList GetRecordingDevices(DefSound::EDeviceState state) const; HRESULT RegisterNotificationClient() const; HRESULT UnRegisterNotificationClient() const; AudioEndPointLibrarySignals* m_signals1() const { return m_signals; } __declspec(property(get = m_signals1)) AudioEndPointLibrarySignals* Signals; private: CAudioEndPointLibrary(void); CAudioEndPointLibrary(CAudioEndPointLibrary const&) = delete; void operator=(CAudioEndPointLibrary const&) = delete; void Refresh() const; struct AudioEndPointLibraryImpl; struct AudioEndPointLibraryDevicesImpl; AudioEndPointLibraryImpl* m_container; AudioEndPointLibrarySignals* m_signals; AudioEndPointLibraryDevicesImpl* m_devices_lists; }; }
#include "DefSoundDeviceState.h" #include "AudioEndPointLibraryImpl.h" // This class is exported from the AudioEndPointLibrary.dll namespace AudioEndPoint { class AUDIOENDPOINTLIBRARY_API CAudioEndPointLibrary { public: ~CAudioEndPointLibrary(); HRESULT OnDeviceStateChanged(LPCWSTR pwstr_device_id, DWORD dw_new_state) const; HRESULT OnDeviceAdded(LPCWSTR pwstr_device_id) const; HRESULT OnDeviceRemoved(LPCWSTR pwstr_device_id) const; HRESULT OnDefaultDeviceChanged(EDataFlow flow, ERole role, LPCWSTR pwstr_default_device_id) const; static CAudioEndPointLibrary& GetInstance(); AudioDeviceList GetPlaybackDevices(DefSound::EDeviceState state) const; AudioDeviceList GetRecordingDevices(DefSound::EDeviceState state) const; AudioEndPointLibrarySignals* m_signals1() const { return m_signals; } __declspec(property(get = m_signals1)) AudioEndPointLibrarySignals* Signals; private: CAudioEndPointLibrary(void); CAudioEndPointLibrary(CAudioEndPointLibrary const&) = delete; void operator=(CAudioEndPointLibrary const&) = delete; void Refresh() const; HRESULT RegisterNotificationClient() const; HRESULT UnRegisterNotificationClient() const; struct AudioEndPointLibraryImpl; struct AudioEndPointLibraryDevicesImpl; AudioEndPointLibraryImpl* m_container; AudioEndPointLibrarySignals* m_signals; AudioEndPointLibraryDevicesImpl* m_devices_lists; }; }
Make the registering and unregistering of the Notification private
Make the registering and unregistering of the Notification private
C
mit
Belphemur/AudioEndPointLibrary,Belphemur/AudioEndPointLibrary
6cc425e21330a5fa456077def0fc727b92e6ecde
test/Sema/attr-availability-ios.c
test/Sema/attr-availability-ios.c
// RUN: %clang_cc1 "-triple" "x86_64-apple-darwin3.0.0-iphoneos" -fsyntax-only -verify %s void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); void f1(int) __attribute__((availability(ios,introduced=2.1))); void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); void f3(int) __attribute__((availability(ios,introduced=3.0))); void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=2.1,obsoleted=3.0))); // expected-note{{explicitly marked unavailable}} void test() { f0(0); // expected-warning{{'f0' is deprecated: first deprecated in iOS 2.1}} f1(0); f2(0); // expected-warning{{'f2' is deprecated: first deprecated in iOS 3.0}} f3(0); f4(0); // expected-error{{f4' is unavailable: obsoleted in iOS 3.0}} }
// RUN: %clang_cc1 "-triple" "x86_64-apple-darwin3.0.0-iphoneos" -fsyntax-only -verify %s void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); void f1(int) __attribute__((availability(ios,introduced=2.1))); void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); void f3(int) __attribute__((availability(ios,introduced=3.0))); void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=2.1,obsoleted=3.0))); // expected-note{{explicitly marked unavailable}} void f5(int) __attribute__((availability(ios,introduced=2.0))) __attribute__((availability(ios,deprecated=3.0))); void f6(int) __attribute__((availability(ios,deprecated=3.0))); void f6(int) __attribute__((availability(ios,introduced=2.0))); void test() { f0(0); // expected-warning{{'f0' is deprecated: first deprecated in iOS 2.1}} f1(0); f2(0); // expected-warning{{'f2' is deprecated: first deprecated in iOS 3.0}} f3(0); f4(0); // expected-error{{f4' is unavailable: obsoleted in iOS 3.0}} f5(0); // expected-warning{{'f5' is deprecated: first deprecated in iOS 3.0}} f6(0); // expected-warning{{'f6' is deprecated: first deprecated in iOS 3.0}} }
Test attribute merging for the availability attribute.
Test attribute merging for the availability attribute. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@128334 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
fe23dd2429da4b8e71b110d517370358256df785
You-DataStore/internal/operation.h
You-DataStore/internal/operation.h
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../ds_task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// The constructor /// \param stask the serialized task the operation need to work with explicit IOperation(SerializedTask& stask); virtual ~IOperation(); /// Executes the operation virtual void run() = 0; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../ds_task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// The constructor /// \param stask the serialized task the operation need to work with explicit IOperation(SerializedTask& stask); virtual ~IOperation(); /// Executes the operation virtual bool run() = 0; protected: TaskId taskId; SerializedTask task; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
Change return value of run to bool
Change return value of run to bool Conflicts: You-DataStore/internal/operation.h You-DataStore/internal/operations/post_operation.h
C
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
f3b877cba4ab0ffdfc553f65547305698ef16391
src/BLEDeviceLimits.h
src/BLEDeviceLimits.h
// Copyright (c) Sandeep Mistry. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef _BLE_LIMITS_H_ #define _BLE_LIMITS_H_ #include <stdlib.h> #ifndef __AVR__ #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif #if defined(NRF51) || defined(__RFduino__) #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 26 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 29 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 29 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #else #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 20 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 20 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 20 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #endif #endif
// Copyright (c) Sandeep Mistry. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef _BLE_LIMITS_H_ #define _BLE_LIMITS_H_ #include <stdlib.h> #ifndef __AVR__ #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif #endif #if defined(NRF51) || defined(NRF52) || defined(__RFduino__) #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 26 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 29 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 29 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #else #define BLE_ADVERTISEMENT_DATA_MAX_VALUE_LENGTH 20 #define BLE_SCAN_DATA_MAX_VALUE_LENGTH 20 #define BLE_EIR_DATA_MAX_VALUE_LENGTH 20 #define BLE_ATTRIBUTE_MAX_VALUE_LENGTH 20 #define BLE_REMOTE_ATTRIBUTE_MAX_VALUE_LENGTH 22 #endif #endif
Fix length issues with nRF52
Fix length issues with nRF52
C
mit
sandeepmistry/arduino-BLEPeripheral,sandeepmistry/arduino-BLEPeripheral,sandeepmistry/arduino-BLEPeripheral
79dca367dc10e9598973895f6e22350b2d2f32b4
util.h
util.h
/* This file is part of ethash. ethash 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. ethash 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 ethash. If not, see <http://www.gnu.org/licenses/>. */ /** @file util.h * @author Tim Hughes <tim@twistedfury.com> * @date 2015 */ #pragma once #include <stdint.h> #include "compiler.h" #ifdef __cplusplus extern "C" { #endif #ifdef _MSC_VER void debugf(char const* str, ...); #else #define debugf printf #endif static inline uint32_t min_u32(uint32_t a, uint32_t b) { return a < b ? a : b; } static inline uint32_t clamp_u32(uint32_t x, uint32_t min_, uint32_t max_) { return x < min_ ? min_ : (x > max_ ? max_ : x); } #ifdef __cplusplus } #endif
/* This file is part of ethash. ethash 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. ethash 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 ethash. If not, see <http://www.gnu.org/licenses/>. */ /** @file util.h * @author Tim Hughes <tim@twistedfury.com> * @date 2015 */ #pragma once #include <stdint.h> #include "compiler.h" #ifdef __cplusplus extern "C" { #endif //#ifdef _MSC_VER void debugf(char const* str, ...); //#else //#define debugf printf //#endif static inline uint32_t min_u32(uint32_t a, uint32_t b) { return a < b ? a : b; } static inline uint32_t clamp_u32(uint32_t x, uint32_t min_, uint32_t max_) { return x < min_ ? min_ : (x > max_ ? max_ : x); } #ifdef __cplusplus } #endif
Comment out conflicting debug macro
Comment out conflicting debug macro
C
mit
LefterisJP/webthree-umbrella,programonauta/webthree-umbrella,joeldo/cpp-ethereum,gluk256/cpp-ethereum,yann300/cpp-ethereum,eco/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,yann300/cpp-ethereum,karek314/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,vaporry/cpp-ethereum,eco/cpp-ethereum,expanse-project/cpp-expanse,Sorceror32/go-get--u-github.com-tools-godep,ethers/cpp-ethereum,vaporry/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,joeldo/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,karek314/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,expanse-org/cpp-expanse,PaulGrey30/go-get--u-github.com-tools-godep,programonauta/webthree-umbrella,ethers/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,smartbitcoin/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,eco/cpp-ethereum,smartbitcoin/cpp-ethereum,d-das/cpp-ethereum,ethers/cpp-ethereum,xeddmc/cpp-ethereum,karek314/cpp-ethereum,expanse-project/cpp-expanse,d-das/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,xeddmc/cpp-ethereum,LefterisJP/cpp-ethereum,gluk256/cpp-ethereum,expanse-project/cpp-expanse,joeldo/cpp-ethereum,vaporry/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,PaulGrey30/go-get--u-github.com-tools-godep,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,vaporry/cpp-ethereum,LefterisJP/webthree-umbrella,yann300/cpp-ethereum,anthony-cros/cpp-ethereum,johnpeter66/ethminer,expanse-project/cpp-expanse,smartbitcoin/cpp-ethereum,expanse-org/cpp-expanse,expanse-project/cpp-expanse,d-das/cpp-ethereum,LefterisJP/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,anthony-cros/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,smartbitcoin/cpp-ethereum,eco/cpp-ethereum,xeddmc/cpp-ethereum,joeldo/cpp-ethereum,eco/cpp-ethereum,yann300/cpp-ethereum,anthony-cros/cpp-ethereum,anthony-cros/cpp-ethereum,d-das/cpp-ethereum,LefterisJP/cpp-ethereum,xeddmc/cpp-ethereum,yann300/cpp-ethereum,LefterisJP/cpp-ethereum,expanse-org/cpp-expanse,Sorceror32/go-get--u-github.com-tools-godep,ethers/cpp-ethereum,gluk256/cpp-ethereum,vaporry/webthree-umbrella,gluk256/cpp-ethereum,LefterisJP/cpp-ethereum,eco/cpp-ethereum,johnpeter66/ethminer,gluk256/cpp-ethereum,ethers/cpp-ethereum,karek314/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,joeldo/cpp-ethereum,arkpar/webthree-umbrella,xeddmc/cpp-ethereum,karek314/cpp-ethereum,LefterisJP/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,smartbitcoin/cpp-ethereum,chfast/webthree-umbrella,vaporry/cpp-ethereum,d-das/cpp-ethereum,vaporry/cpp-ethereum,expanse-project/cpp-expanse,smartbitcoin/cpp-ethereum,xeddmc/cpp-ethereum,expanse-org/cpp-expanse,yann300/cpp-ethereum,anthony-cros/cpp-ethereum,gluk256/cpp-ethereum,expanse-org/cpp-expanse,karek314/cpp-ethereum,d-das/cpp-ethereum,expanse-org/cpp-expanse,joeldo/cpp-ethereum,johnpeter66/ethminer,ethers/cpp-ethereum,anthony-cros/cpp-ethereum
20669c2fbecaa850c3c5a2035fd068ef968f8b25
coursework/assignment2/integral_c.c
coursework/assignment2/integral_c.c
#include <stdio.h> #include <math.h> float f(float x) { return 1/x; } int main(int argc, char *argv[]) { // Integral (1 to 6) of 1/x float integral; float a = 1, b = 6; int n = 2000; float h; float x; h = (b-a)/n; integral = (f(a) + f(b)) / 2.0; x = a; for (int i = 1; i <= n - 1; i++) { x = x + h; integral = integral + f(x); } integral = integral * h; float expected = 1.79175946923; printf("Integral (%.0f to %.0f) of 1/x \n\n", a, b); printf("Expected result = %.11f\n", expected); printf("Estimated result = %.11f\n", integral); printf(" -------------\n"); float difference = expected - integral; difference = fabsf(difference); // absolute value (no minus sign) printf("Difference = %.11f\n", difference); return 0; }
#include <stdio.h> #include <math.h> double f(double x) { return 1 / x; } int main(int argc, char *argv[]) { // Integral (1 to 6) of 1/x double integral; int a = 1, b = 6; int n = 2000; double h; double x; h = (double)(b-a)/n; integral = (f(a) + f(b)) / 2.0; x = a; for (int i = 1; i < n; i++) { x = x + h; integral = integral + f(x); } integral = integral * h; double expected = 1.79175946923; printf("Integral (%d to %d) of 1/x \n\n", a, b); printf("Expected result = %.11f\n", expected); printf("Estimated result = %.11f\n", integral); printf(" -------------\n"); double difference = expected - integral; difference = fabsf(difference); // absolute value (no minus sign) printf("Difference = %.11f\n", difference); return 0; }
Use double instead of float
Use double instead of float Float was not able to maintain data precision
C
mit
arthurazs/uff-lpp,arthurazs/uff-lpp,arthurazs/uff-lpp
aa22b1c3df494da25286a787c9c5bfa6fa37c468
cpp/cpp_odbc/Library/cpp_odbc/level2/u16string_buffer.h
cpp/cpp_odbc/Library/cpp_odbc/level2/u16string_buffer.h
#pragma once #include <string> #include <vector> #include <sqltypes.h> namespace cpp_odbc { namespace level2 { /** * @brief This class represents a buffer for u16strings for use with the unixodbc C API. */ class u16string_buffer { public: /** * @brief Constructs a new string buffer with the given capacity, i.e., maximum size * @param capacity Capacity of the buffer */ u16string_buffer(signed short int capacity); /** * @brief Retrieve the capacity of the buffer (in characters) in a format suitable for passing * to unixodbc API functions. */ signed short int capacity() const; /** * @brief Retrieve a pointer to the internal buffer suitable for passing to unixodbc API functions. * This buffer contains the actual string data. Do not exceed the allocated capacity! */ SQLWCHAR * data_pointer(); /** * @brief Retrieve a pointer to a size buffer suitable for passing to unixodbc API functions. * This buffer contains the number of significant bytes in the buffer returned by * data_pointer(). */ signed short int * size_pointer(); /** * @brief Conversion operator. Retrieve the buffered data as a string. Bad things will happen if * the value of size_pointer is larger than the capacity! */ operator std::u16string() const; private: std::vector<SQLWCHAR> data_; signed short int used_size_; }; } }
#pragma once #include <string> #include <vector> #include <sql.h> namespace cpp_odbc { namespace level2 { /** * @brief This class represents a buffer for u16strings for use with the unixodbc C API. */ class u16string_buffer { public: /** * @brief Constructs a new string buffer with the given capacity, i.e., maximum size * @param capacity Capacity of the buffer */ u16string_buffer(signed short int capacity); /** * @brief Retrieve the capacity of the buffer (in characters) in a format suitable for passing * to unixodbc API functions. */ signed short int capacity() const; /** * @brief Retrieve a pointer to the internal buffer suitable for passing to unixodbc API functions. * This buffer contains the actual string data. Do not exceed the allocated capacity! */ SQLWCHAR * data_pointer(); /** * @brief Retrieve a pointer to a size buffer suitable for passing to unixodbc API functions. * This buffer contains the number of significant bytes in the buffer returned by * data_pointer(). */ signed short int * size_pointer(); /** * @brief Conversion operator. Retrieve the buffered data as a string. Bad things will happen if * the value of size_pointer is larger than the capacity! */ operator std::u16string() const; private: std::vector<SQLWCHAR> data_; signed short int used_size_; }; } }
Use different header to be yet more compatible with Windows
Use different header to be yet more compatible with Windows
C
mit
blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc,blue-yonder/turbodbc
627ea4fcaa54b2f49f92d60684f73654fee99129
include/arch/x86/arch/shutdown.h
include/arch/x86/arch/shutdown.h
#ifndef SHUTDOWN_I6F54URD #define SHUTDOWN_I6F54URD void ArchShutdown(void); #endif /* end of include guard: SHUTDOWN_I6F54URD */
#ifndef SHUTDOWN_I6F54URD #define SHUTDOWN_I6F54URD void ArchBreak(void); void ArchShutdown(void); #endif /* end of include guard: SHUTDOWN_I6F54URD */
Add ArchBreak to the header.
Add ArchBreak to the header.
C
mit
duckinator/dux,duckinator/dux,duckinator/dux
d86e2fe23f2ee6889c56f3d1426a46be7cb03d33
SurgSim/Framework/Convert.h
SurgSim/Framework/Convert.h
// This file is a part of the OpenSurgSim project. // Copyright 2013, SimQuest Solutions Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef SURGSIM_FRAMEWORK_CONVERT_H #define SURGSIM_FRAMEWORK_CONVERT_H #include "SurgSim/Framework/Log.h" /// \note HS-2013-dec-23 The gcc and msvc compilers seem to have different requirements when a template class /// needs to be passed template parameters in a specialization, that extend the original template interface /// gcc needs the template<> statement before the new template parameters, msvc does not like it at all. #ifdef _GNUC_ #define SURGSIM_DOUBLE_SPECIALIZATION template<> #else #define SURGSIM_DOUBLE_SPECIALIZATION #endif namespace SurgSim { namespace Serialize { /// Logger name for Serialization const std::string serializeLogger = "Serialization"; }; }; #endif // SURGSIM_FRAMEWORK_CONVERT_H
// This file is a part of the OpenSurgSim project. // Copyright 2013, SimQuest Solutions Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef SURGSIM_FRAMEWORK_CONVERT_H #define SURGSIM_FRAMEWORK_CONVERT_H #include "SurgSim/Framework/Log.h" #include <yaml-cpp/yaml.h> /// \note HS-2013-dec-23 The gcc and msvc compilers seem to have different requirements when a template class /// needs to be passed template parameters in a specialization, that extend the original template interface /// gcc needs the template<> statement before the new template parameters, msvc does not like it at all. #ifdef _GNUC_ #define SURGSIM_DOUBLE_SPECIALIZATION template<> #else #define SURGSIM_DOUBLE_SPECIALIZATION #endif namespace SurgSim { namespace Serialize { /// Logger name for Serialization const std::string serializeLogger = "Serialization"; }; }; #endif // SURGSIM_FRAMEWORK_CONVERT_H
Add back yaml-cpp/yaml.h header file for convert<> class template.
Add back yaml-cpp/yaml.h header file for convert<> class template.
C
apache-2.0
simquest/opensurgsim,simquest/opensurgsim,simquest/opensurgsim,simquest/opensurgsim
2091920484dc3108704da860d7631dc52292af89
src/drivers/sensors/gy_30/gy_30.c
src/drivers/sensors/gy_30/gy_30.c
/** * @file * @brief * * @date 29.03.2017 * @author Alex Kalmuk */ #include <unistd.h> #include <util/log.h> #include <drivers/i2c/i2c.h> #include "gy_30.h" #define GY30_ADDR 0x46 uint16_t gy_30_read_light_level(unsigned char id) { uint16_t level = 0; /* It would be better do not hang here but return error code */ while (0 > i2c_bus_read(id, GY30_ADDR, (uint8_t *) &level, 2)) ; /* The actual value in lx is level / 1.2 */ return (((uint32_t) level) * 5) / 6; } void gy_30_setup_mode(unsigned char id, uint8_t mode) { while (0 > i2c_bus_write(id, GY30_ADDR, &mode, 1)) ; /* Documentation says that we need to wait approximately 180 ms here.*/ usleep(180000); log_debug("%s\n", "gy_30_setup_mode OK!\n"); }
/** * @file * @brief * * @date 29.03.2017 * @author Alex Kalmuk */ #include <unistd.h> #include <util/log.h> #include <drivers/i2c/i2c.h> #include "gy_30.h" /* http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf */ #define GY30_ADDR 0x23 uint16_t gy_30_read_light_level(unsigned char id) { uint16_t level = 0; /* It would be better do not hang here but return error code */ while (0 > i2c_bus_read(id, GY30_ADDR, (uint8_t *) &level, 2)) ; /* The actual value in lx is level / 1.2 */ return (((uint32_t) level) * 5) / 6; } void gy_30_setup_mode(unsigned char id, uint8_t mode) { while (0 > i2c_bus_write(id, GY30_ADDR, &mode, 1)) ; /* Documentation says that we need to wait approximately 180 ms here.*/ usleep(180000); log_debug("%s\n", "gy_30_setup_mode OK!\n"); }
Fix gy-30 light sensor i2c address
drivers: Fix gy-30 light sensor i2c address
C
bsd-2-clause
embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox
b3a3beb56fb56e812cd0308eb184c79a0fa97e5a
include/HubFramework.h
include/HubFramework.h
/// Umbrella header for the Hub Framework #import "HUBManager.h" #import "HUBComponent.h" #import "HUBComponentModel.h" #import "HUBComponentRegistry.h" #import "HUBComponentFallbackHandler.h"
/// Umbrella header for the Hub Framework #import "HUBManager.h" #import "HUBComponent.h" #import "HUBComponentModel.h" #import "HUBComponentModelBuilder.h" #import "HUBComponentImageData.h" #import "HUBComponentImageDataBuilder.h" #import "HUBComponentRegistry.h" #import "HUBComponentFallbackHandler.h"
Add new API files to umbrella header
Add new API files to umbrella header
C
apache-2.0
spotify/HubFramework,spotify/HubFramework,spotify/HubFramework,spotify/HubFramework
a5843e1928d338a19c91f6c83b8a4ffec8ad60be
src/os/Win32/plugin.h
src/os/Win32/plugin.h
#ifndef PLUGIN_H_ #define PLUGIN_H_ #include "plugin_portable.h" #include <windows.h> // TODO use __stdcall #define EXPORT_CALLING __cdecl #define EXPORT __declspec(dllexport) EXPORT_CALLING #include "common.h" // just defined to make compilation work ; ignored #define RTLD_DEFAULT NULL #define RTLD_LOCAL -1 #define RTLD_LAZY -1 static inline void *dlopen(const char *name, int flags) { // TODO use LoadLibraryEx() and flags ? return LoadLibrary(name); } static inline void *dlsym(void *handle, const char *name) { FARPROC g = GetProcAddress(handle, name); void *h; *(FARPROC*)&h = g; return h; } static inline char *dlerror(void) { static __thread char buf[1024]; FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buf, sizeof buf, NULL); return buf; } static inline int dlclose(void *handle) { return !FreeLibrary(handle); } #endif
#ifndef PLUGIN_H_ #define PLUGIN_H_ #include "plugin_portable.h" #include <windows.h> // TODO use __stdcall #define EXPORT_CALLING __cdecl #define EXPORT __declspec(dllexport) EXPORT_CALLING #include "common.h" // just defined to make compilation work ; ignored #define RTLD_DEFAULT NULL #define RTLD_LOCAL -1 #define RTLD_LAZY -1 #define RTLD_NOW -1 static inline void *dlopen(const char *name, int flags) { (void)flags; // TODO use LoadLibraryEx() and flags ? return LoadLibrary(name); } static inline void *dlsym(void *handle, const char *name) { FARPROC g = GetProcAddress(handle, name); void *h; *(FARPROC*)&h = g; return h; } static inline char *dlerror(void) { static __thread char buf[1024]; FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buf, sizeof buf, NULL); return buf; } static inline int dlclose(void *handle) { return !FreeLibrary(handle); } #endif
Mend Win32 build broken by 8e1c4386
Mend Win32 build broken by 8e1c4386
C
mit
kulp/tenyr,kulp/tenyr,kulp/tenyr
d1f23840550c800d5d382abf3aadf1e92a9e20b1
src/plugins/crypto/gpg_shutdown.c
src/plugins/crypto/gpg_shutdown.c
/** * @file * * @brief module for shutting down the gpg-agent * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) * */ #include "gpg_shutdown.h" #include <stdio.h> #include <stdlib.h> /** * @brief shutdown the gpg-agent * @retval 0 on success. * @retval -1 on error. */ int ELEKTRA_PLUGIN_FUNCTION (gpgQuitAgent) (void) { // check if the gpg-connect-agent command is available int cmdAvailable = system ("command -v gpg-connect-agent"); if (cmdAvailable != 0) { // nothing to do here return 0; } // try to gracefully shut down the gpg-agent int status = system ("gpg-connect-agent --quiet KILLAGENT /bye"); if (status != 0) { // use the hammer int killStatus = system ("/bin/sh -c \"pgrep \'gpg-agent\' | xargs -d \'\\n\' \'kill\'\""); if (killStatus != 0) { return -1; } } return 0; }
/** * @file * * @brief module for shutting down the gpg-agent * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) * */ #include "gpg_shutdown.h" #include <stdio.h> #include <stdlib.h> /** * @brief shutdown the gpg-agent * @retval 0 on success. * @retval -1 on error. */ int ELEKTRA_PLUGIN_FUNCTION (gpgQuitAgent) (void) { // try to gracefully shut down the gpg-agent int status = system ("gpg-connect-agent --quiet KILLAGENT /bye"); if (status != 0) { // use the hammer int killStatus = system ("/bin/sh -c \"pgrep \'gpg-agent\' | xargs -d \'\\n\' \'kill\'\""); if (killStatus != 0) { return -1; } } return 0; }
Revert "tests: check if gpg-agent command exists in shutdown code"
Revert "tests: check if gpg-agent command exists in shutdown code" This reverts commit 7e0ef169c36712bb49b291a227ebd1b0036e5c75.
C
bsd-3-clause
petermax2/libelektra,mpranj/libelektra,mpranj/libelektra,mpranj/libelektra,petermax2/libelektra,petermax2/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,petermax2/libelektra,mpranj/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,ElektraInitiative/libelektra
e5be6c05567bab2c6d13fc3e8b3cb869a387327c
hal1.h
hal1.h
// Configurable constants int const MAIN_MOTOR_PWM_TOP = 255; int const MAIN_MOTOR_BRAKE_SPEED = 120; int const MAIN_MOTOR_MIN_SPEED = 150; int const MAIN_MOTOR_MED_SPEED = 254; int const MAIN_MOTOR_MAX_SPEED = 255; int const MAGNET_OPEN_WAIT = 5; // 10ths of a second void init(void);
#ifndef HAL1_H #define HAL1_H // Configurable constants int const MAIN_MOTOR_PWM_TOP = 255; int const MAIN_MOTOR_BRAKE_SPEED = 120; int const MAIN_MOTOR_MIN_SPEED = 150; int const MAIN_MOTOR_MED_SPEED = 254; int const MAIN_MOTOR_MAX_SPEED = 255; int const MAGNET_OPEN_WAIT = 5; // 10ths of a second void init(void); void main_motor_stop(); void main_motor_cw_open(uint8_t speed); void main_motor_ccw_close(uint8_t speed); void set_main_motor_speed(int speed); int get_main_motor_speed(); void aux_motor_stop(); void aux_motor_cw_close(); void aux_motor_ccw_open(); void magnet_off(); void magnet_on(); bool door_nearly_open(); bool door_fully_open(); bool door_fully_closed(); bool sensor_proximity(); bool button_openclose(); bool button_stop(); bool main_encoder(); bool aux_outdoor_limit(); bool aux_indoor_limit(); bool door_nearly_closed(); bool aux_encoder(); #endif
Add function prototypes and ifndef wrapper
Add function prototypes and ifndef wrapper
C
unlicense
plzz/ovisysteemi,plzz/ovisysteemi
00d1d12be797e41c5f89e905f438f85c1003d0db
objc/MX3Snapshot.h
objc/MX3Snapshot.h
#import <Foundation/Foundation.h> #ifdef __cplusplus #include <memory> #include <mx3/mx3.hpp> #endif @interface MX3Snapshot : NSObject // adding this here allows you to include this file from non-objc++ files // since it is using c++ types #ifdef __cplusplus - (instancetype)initWithSnapshot:(std::unique_ptr<mx3::SqlSnapshot>)snapshot; #endif - (NSString *) rowAtIndex:(NSUInteger)index; - (NSUInteger) count; - (void) dealloc; @end
#import <Foundation/Foundation.h> #ifdef __cplusplus #include <memory> #include <mx3/mx3.hpp> #endif @interface MX3Snapshot : NSObject // adding this here allows you to include this file from non-objc++ files // since it is using c++ types #ifdef __cplusplus - (instancetype)initWithSnapshot:(std::unique_ptr<mx3::SqlSnapshot>)snapshot; #endif - (NSString *) rowAtIndex:(NSUInteger)index; - (NSUInteger) count; @end
Remove dealloc from header as it is declared in NSObject
Remove dealloc from header as it is declared in NSObject
C
mit
wesselj1/mx3playground,wesselj1/mx3playground,libmx3/mx3,duydb2/mx3,libmx3/mx3,duydb2/mx3,duydb2/mx3,libmx3/mx3,wesselj1/mx3playground
b843d479c9f75400a57e23b63f19050359c6fb62
menpo/feature/cpp/WindowFeature.h
menpo/feature/cpp/WindowFeature.h
#pragma once #if defined(_MSC_VER) #define round(x) (x >= 0 ? (x + 0.5) : (x - 0.5)) #endif class WindowFeature { public: WindowFeature(); virtual ~WindowFeature(); virtual void apply(double *windowImage, double *descriptorVector) = 0; unsigned int descriptorLengthPerWindow; };
#pragma once #if _MSC_VER < 1900 #define round(x) (x >= 0 ? (x + 0.5) : (x - 0.5)) #endif class WindowFeature { public: WindowFeature(); virtual ~WindowFeature(); virtual void apply(double *windowImage, double *descriptorVector) = 0; unsigned int descriptorLengthPerWindow; };
Fix a build error (Python 3.5)
Fix a build error (Python 3.5) Thanks to karel.palecek@tul.cz for supplying the fix to this bug.
C
bsd-3-clause
grigorisg9gr/menpo,patricksnape/menpo,menpo/menpo,grigorisg9gr/menpo,menpo/menpo,patricksnape/menpo,grigorisg9gr/menpo,yuxiang-zhou/menpo,yuxiang-zhou/menpo,menpo/menpo,patricksnape/menpo,yuxiang-zhou/menpo
830bb7a42d2804830a57dfe8bc469fac1317c46a
port/riot/abort.c
port/riot/abort.c
#include "port/oc_assert.h" // TODO: void abort_impl() { }
#include "port/oc_assert.h" // TODO: void abort_impl(void) { }
Declare void parameter for RIOT
Declare void parameter for RIOT This is partially reverting: "Bring RIOT OS port up-to-date with RIOT OS upstream" This reverts commit 0ed0f4425cffdd84317998efa8fe19eef561c2fa. Without this change RIOT will fail to build: port/riot/abort.c:5:1:\ error: old-style function definition [-Werror=old-style-definition] Change-Id: Ie6b838452412c844503a004656b7aac7b20e5d55 Signed-off-by: Philippe Coval <ff46fec9739d31cce915aabcc3a7a2c00eee4d6c@osg.samsung.com> Reviewed-on: https://gerrit.iotivity.org/gerrit/16497 Reviewed-by: Kishen Maloor <c62ddea3cd661a9268bff15f07fc2229cdc9ac02@intel.com> Tested-by: Kishen Maloor <c62ddea3cd661a9268bff15f07fc2229cdc9ac02@intel.com>
C
apache-2.0
iotivity/iotivity-constrained,iotivity/iotivity-constrained,iotivity/iotivity-constrained,iotivity/iotivity-constrained
b0f17a3780c5cb70b4bd8fa4633e60acd6ff98f5
src/vast/option.h
src/vast/option.h
#ifndef VAST_OPTION_HPP #define VAST_OPTION_HPP #include <cppa/option.hpp> namespace vast { /// An optional value of `T` with similar semantics as `std::optional`. template <typename T> class option : public cppa::option<T> { typedef cppa::option<T> super; public: #ifdef VAST_HAVE_INHERTING_CONSTRUCTORS using super::option; #else option() = default; option(T x) : super(std::move(x)) { } template <typename T0, typename T1, typename... Ts> option(T0&& x0, T1&& x1, Ts&&... args) : super(std::forward<T0>(x0), std::forward<T1>(x1), std::forward<Ts>(args)...) { } option(const option&) = default; option(option&&) = default; option& operator=(option const&) = default; option& operator=(option&&) = default; #endif T* operator->() const { CPPA_REQUIRE(valid()); return &cppa::option<T>::get(); } }; } // namespace vast #endif
#ifndef VAST_OPTION_HPP #define VAST_OPTION_HPP #include <cppa/option.hpp> namespace vast { /// An optional value of `T` with similar semantics as `std::optional`. template <typename T> class option : public cppa::option<T> { typedef cppa::option<T> super; public: #ifdef VAST_HAVE_INHERTING_CONSTRUCTORS using super::option; #else option() = default; option(T x) : super(std::move(x)) { } template <typename T0, typename T1, typename... Ts> option(T0&& x0, T1&& x1, Ts&&... args) : super(std::forward<T0>(x0), std::forward<T1>(x1), std::forward<Ts>(args)...) { } option(const option&) = default; option(option&&) = default; option& operator=(option const&) = default; option& operator=(option&&) = default; #endif constexpr T const* operator->() const { return &cppa::option<T>::get(); } }; } // namespace vast #endif
Make operator-> constexpr and return a T const*.
Make operator-> constexpr and return a T const*.
C
bsd-3-clause
mavam/vast,pmos69/vast,vast-io/vast,vast-io/vast,mavam/vast,mavam/vast,pmos69/vast,pmos69/vast,vast-io/vast,vast-io/vast,pmos69/vast,vast-io/vast,mavam/vast
dde3ee5113fd0ae40cfb6788e4bd0a2a8c60eb72
t/version_t.c
t/version_t.c
#include "MMDB.h" #include "tap.h" #include <sys/stat.h> #include <string.h> #if HAVE_CONFIG_H # include <config.h> #endif int main(void) { const char *version = MMDB_lib_version(); ok(version != NULL, "MMDB_lib_version exists"); ok(strcmp(version, PACKAGE_VERSION) == 0, "version is " PACKAGE_VERSION); done_testing(); }
#include "MMDB.h" #include "tap.h" #include <sys/stat.h> #include <string.h> #if HAVE_CONFIG_H # include <config.h> #endif int main(void) { const char *version = MMDB_lib_version(); ok(version != NULL, "MMDB_lib_version exists"); if ( version ) ok(strcmp(version, PACKAGE_VERSION) == 0, "version is " PACKAGE_VERSION); done_testing(); }
Check version string only if MMDB_lib_version != NULL
Check version string only if MMDB_lib_version != NULL
C
apache-2.0
maxmind/libmaxminddb,maxmind/libmaxminddb,maxmind/libmaxminddb
e412c7c88f74bd962509e1c24b1611b909b58b99
MdePkg/Include/Guid/HardwareErrorVariable.h
MdePkg/Include/Guid/HardwareErrorVariable.h
/** @file GUID for hardware error record variables. Copyright (c) 2007 - 2009, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: HardwareErrorVariable.h @par Revision Reference: GUID defined in UEFI 2.1. **/ #ifndef _HARDWARE_ERROR_VARIABLE_GUID_H_ #define _HARDWARE_ERROR_VARIABLE_GUID_H_ #define EFI_HARDWARE_ERROR_VARIABLE \ { \ 0x414E6BDD, 0xE47B, 0x47cc, {0xB2, 0x44, 0xBB, 0x61, 0x02, 0x0C, 0xF5, 0x16} \ } extern EFI_GUID gEfiHardwareErrorVariableGuid; #endif
/** @file GUID for hardware error record variables. Copyright (c) 2007 - 2009, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. @par Revision Reference: GUID defined in UEFI 2.1. **/ #ifndef _HARDWARE_ERROR_VARIABLE_GUID_H_ #define _HARDWARE_ERROR_VARIABLE_GUID_H_ #define EFI_HARDWARE_ERROR_VARIABLE \ { \ 0x414E6BDD, 0xE47B, 0x47cc, {0xB2, 0x44, 0xBB, 0x61, 0x02, 0x0C, 0xF5, 0x16} \ } extern EFI_GUID gEfiHardwareErrorVariableGuid; #endif
Remove "Module Name:" from include file headers.
Remove "Module Name:" from include file headers. git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@8895 6f19259b-4bc3-4df7-8a09-765794883524
C
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
27737aa3a9f65012b3656b71e0ff230a4811da4d
include/net/dcbevent.h
include/net/dcbevent.h
/* * Copyright (c) 2010, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope 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, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307 USA. * * Author: John Fastabend <john.r.fastabend@intel.com> */ #ifndef _DCB_EVENT_H #define _DCB_EVENT_H enum dcbevent_notif_type { DCB_APP_EVENT = 1, }; extern int register_dcbevent_notifier(struct notifier_block *nb); extern int unregister_dcbevent_notifier(struct notifier_block *nb); extern int call_dcbevent_notifiers(unsigned long val, void *v); #endif
/* * Copyright (c) 2010, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope 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, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307 USA. * * Author: John Fastabend <john.r.fastabend@intel.com> */ #ifndef _DCB_EVENT_H #define _DCB_EVENT_H enum dcbevent_notif_type { DCB_APP_EVENT = 1, }; #ifdef CONFIG_DCB extern int register_dcbevent_notifier(struct notifier_block *nb); extern int unregister_dcbevent_notifier(struct notifier_block *nb); extern int call_dcbevent_notifiers(unsigned long val, void *v); #else static inline int register_dcbevent_notifier(struct notifier_block *nb) { return 0; } static inline int unregister_dcbevent_notifier(struct notifier_block *nb) { return 0; } static inline int call_dcbevent_notifiers(unsigned long val, void *v) { return 0; } #endif /* CONFIG_DCB */ #endif
Add stub routines for !CONFIG_DCB
dcb: Add stub routines for !CONFIG_DCB To avoid ifdefs in the other code that supports DCB notifiers add stub routines. This method seems popular in other net code for example 8021Q. Signed-off-by: John Fastabend <06228589568acf528fa1984e09626513a30b66ed@intel.com> Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
de73b8bcb0ae34f913711f31b3d4d4ed3c826cfa
src/core/common.h
src/core/common.h
#ifndef OSSL_CORE_COMMON_H_INCLUDE #define OSSL_CORE_COMMON_H_INCLUDE #include <nan.h> #include "logger.h" #include "scoped_ssl.h" #include "excep.h" #include "key_exp.h" #include "digest.h" #include "bn.h" #include <openssl/bn.h> #endif // OSSL_CORE_COMMON_H_INCLUDE
#ifndef OSSL_CORE_COMMON_H_INCLUDE #define OSSL_CORE_COMMON_H_INCLUDE #ifdef _WIN32 #define __WINCRYPT_H__ #endif #include <nan.h> #include "logger.h" #include "scoped_ssl.h" #include "excep.h" #include "key_exp.h" #include "digest.h" #include "bn.h" #include <openssl/bn.h> #endif // OSSL_CORE_COMMON_H_INCLUDE
Disable __WINCRYPT_H__ headers for Windows
Disable __WINCRYPT_H__ headers for Windows
C
mit
PeculiarVentures/node-webcrypto-ossl,PeculiarVentures/node-webcrypto-ossl,PeculiarVentures/node-webcrypto-ossl,PeculiarVentures/node-webcrypto-ossl,PeculiarVentures/node-webcrypto-ossl,PeculiarVentures/node-webcrypto-ossl
c5f13a2a9c451f0e50854db2305158b287a68b72
util/getarg.h
util/getarg.h
/*************************************************************************** getarg.h - Support routines for the giflib utilities **************************************************************************/ #ifndef _GETARG_H #define _GETARG_H #include <stdbool.h> #define VERSION_COOKIE " Version %d.%d, " /*************************************************************************** * Error numbers as returned by GAGetArg routine: **************************************************************************/ #define CMD_ERR_NotAnOpt 1 /* None Option found. */ #define CMD_ERR_NoSuchOpt 2 /* Undefined Option Found. */ #define CMD_ERR_WildEmpty 3 /* Empty input for !*? seq. */ #define CMD_ERR_NumRead 4 /* Failed on reading number. */ #define CMD_ERR_AllSatis 5 /* Fail to satisfy (must-'!') option. */ bool GAGetArgs(int argc, char **argv, char *CtrlStr, ...); void GAPrintErrMsg(int Error); void GAPrintHowTo(char *CtrlStr); /****************************************************************************** * O.K., here are the routines from QPRINTF.C. ******************************************************************************/ extern bool GifNoisyPrint; extern void GifQprintf(char *Format, ...); /****************************************************************************** * O.K., here are the routines from GIF_ERR.C. ******************************************************************************/ extern void PrintGifError(void); extern int GifLastError(void); /* These used to live in the library header */ #define GIF_MESSAGE(Msg) fprintf(stderr, "\n%s: %s\n", PROGRAM_NAME, Msg) #define GIF_EXIT(Msg) { GIF_MESSAGE(Msg); exit(-3); } #endif /* _GETARG_H */ /* end */
/*************************************************************************** getarg.h - Support routines for the giflib utilities **************************************************************************/ #ifndef _GETARG_H #define _GETARG_H #include <stdbool.h> #define VERSION_COOKIE " Version %d.%d, " /*************************************************************************** Error numbers as returned by GAGetArg routine: ***************************************************************************/ #define CMD_ERR_NotAnOpt 1 /* None Option found. */ #define CMD_ERR_NoSuchOpt 2 /* Undefined Option Found. */ #define CMD_ERR_WildEmpty 3 /* Empty input for !*? seq. */ #define CMD_ERR_NumRead 4 /* Failed on reading number. */ #define CMD_ERR_AllSatis 5 /* Fail to satisfy (must-'!') option. */ bool GAGetArgs(int argc, char **argv, char *CtrlStr, ...); void GAPrintErrMsg(int Error); void GAPrintHowTo(char *CtrlStr); /****************************************************************************** From qprintf.c ******************************************************************************/ extern bool GifNoisyPrint; extern void GifQprintf(char *Format, ...); extern void PrintGifError(void); /* These used to live in the library header */ #define GIF_MESSAGE(Msg) fprintf(stderr, "\n%s: %s\n", PROGRAM_NAME, Msg) #define GIF_EXIT(Msg) { GIF_MESSAGE(Msg); exit(-3); } #endif /* _GETARG_H */ /* end */
Fix a header that had failed to track dome changed locations.
Fix a header that had failed to track dome changed locations.
C
mit
rcancro/giflib,cention-sany/libgif,Distrotech/giflib,Distrotech/giflib,rcancro/giflib,cention-sany/libgif,rcancro/giflib
c5142c547ffbe1cbbe5aa83e56f9c67d63c96606
lib/Target/R600/AMDGPUAsmPrinter.h
lib/Target/R600/AMDGPUAsmPrinter.h
//===-- AMDGPUAsmPrinter.h - Print AMDGPU assembly code -------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // /// \file /// \brief AMDGPU Assembly printer class. // //===----------------------------------------------------------------------===// #ifndef AMDGPU_ASMPRINTER_H #define AMDGPU_ASMPRINTER_H #include "llvm/CodeGen/AsmPrinter.h" #include <string> #include <vector> namespace llvm { class AMDGPUAsmPrinter : public AsmPrinter { public: explicit AMDGPUAsmPrinter(TargetMachine &TM, MCStreamer &Streamer); virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "AMDGPU Assembly Printer"; } /// \brief Emit register usage information so that the GPU driver /// can correctly setup the GPU state. void EmitProgramInfoR600(MachineFunction &MF); void EmitProgramInfoSI(MachineFunction &MF); /// Implemented in AMDGPUMCInstLower.cpp virtual void EmitInstruction(const MachineInstr *MI); protected: bool DisasmEnabled; std::vector<std::string> DisasmLines, HexLines; size_t DisasmLineMaxLen; }; } // End anonymous llvm #endif //AMDGPU_ASMPRINTER_H
//===-- AMDGPUAsmPrinter.h - Print AMDGPU assembly code ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // /// \file /// \brief AMDGPU Assembly printer class. // //===----------------------------------------------------------------------===// #ifndef AMDGPU_ASMPRINTER_H #define AMDGPU_ASMPRINTER_H #include "llvm/CodeGen/AsmPrinter.h" #include <string> #include <vector> namespace llvm { class AMDGPUAsmPrinter : public AsmPrinter { public: explicit AMDGPUAsmPrinter(TargetMachine &TM, MCStreamer &Streamer); virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "AMDGPU Assembly Printer"; } /// \brief Emit register usage information so that the GPU driver /// can correctly setup the GPU state. void EmitProgramInfoR600(MachineFunction &MF); void EmitProgramInfoSI(MachineFunction &MF); /// Implemented in AMDGPUMCInstLower.cpp virtual void EmitInstruction(const MachineInstr *MI); protected: bool DisasmEnabled; std::vector<std::string> DisasmLines, HexLines; size_t DisasmLineMaxLen; }; } // End anonymous llvm #endif //AMDGPU_ASMPRINTER_H
Fix missing C++ mode comment
Fix missing C++ mode comment git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@194339 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap
9089cca24db36608825598e1cd32451a8e20bb2f
src/libaacs/aacs.h
src/libaacs/aacs.h
/* * libaacs by Doom9 ppl 2009, 2010 */ #ifndef AACS_H_ #define AACS_H_ #include <stdint.h> #include "../file/configfile.h" #define LIBAACS_VERSION "1.0" typedef struct aacs AACS; struct aacs { uint8_t pk[16], mk[16], vuk[16], vid[16]; uint8_t *uks; /* unit key array (size = 16 * num_uks, each key is * at 16-byte offset) */ uint16_t num_uks; /* number of unit keys */ uint8_t iv[16]; CONFIGFILE *kf; }; AACS *aacs_open(const char *path, const char *keyfile_path); void aacs_close(AACS *aacs); int aacs_decrypt_unit(AACS *aacs, uint8_t *buf, uint32_t len, uint64_t offset); uint8_t *aacs_get_vid(AACS *aacs); #endif /* AACS_H_ */
/* * libaacs by Doom9 ppl 2009, 2010 */ #ifndef AACS_H_ #define AACS_H_ #include "../file/configfile.h" #include <stdint.h> #define LIBAACS_VERSION "1.0" typedef struct aacs AACS; struct aacs { uint8_t pk[16], mk[16], vuk[16], vid[16]; uint8_t *uks; /* unit key array (size = 16 * num_uks, each key is * at 16-byte offset) */ uint16_t num_uks; /* number of unit keys */ uint8_t iv[16]; CONFIGFILE *kf; }; AACS *aacs_open(const char *path, const char *keyfile_path); void aacs_close(AACS *aacs); int aacs_decrypt_unit(AACS *aacs, uint8_t *buf, uint32_t len, uint64_t offset); uint8_t *aacs_get_vid(AACS *aacs); #endif /* AACS_H_ */
Move inclusion of internal headers before system headers
Move inclusion of internal headers before system headers
C
lgpl-2.1
rraptorr/libaacs,zxlooong/libaacs,zxlooong/libaacs,ShiftMediaProject/libaacs,mwgoldsmith/aacs,rraptorr/libaacs,ShiftMediaProject/libaacs,mwgoldsmith/aacs
54eeba75d3914e457204a159a7888fc19e50a6dc
test/CodeGen/may-alias.c
test/CodeGen/may-alias.c
// RUN: %clang_cc1 -Werror -triple i386-unknown-unknown -emit-llvm -O1 -disable-llvm-optzns -o %t %s // RUN: FileCheck < %t %s // Types with the may_alias attribute should be considered equivalent // to char for aliasing. typedef int __attribute__((may_alias)) aliasing_int; void test0(aliasing_int *ai, int *i) { *ai = 0; *i = 1; } // CHECK: store i32 0, i32* %tmp, !tbaa !1 // CHECK: store i32 1, i32* %tmp1, !tbaa !3 // CHECK: !0 = metadata !{metadata !"any pointer", metadata !1} // CHECK: !1 = metadata !{metadata !"omnipotent char", metadata !2} // CHECK: !2 = metadata !{metadata !"Simple C/C++ TBAA", null} // CHECK: !3 = metadata !{metadata !"int", metadata !1}
// RUN: %clang_cc1 -Werror -triple i386-unknown-unknown -emit-llvm -O1 -disable-llvm-optzns -o %t %s // RUN: FileCheck < %t %s // Types with the may_alias attribute should be considered equivalent // to char for aliasing. typedef int __attribute__((may_alias)) aliasing_int; void test0(aliasing_int *ai, int *i) { *ai = 0; *i = 1; } // CHECK: store i32 0, i32* %{{.*}}, !tbaa !1 // CHECK: store i32 1, i32* %{{.*}}, !tbaa !3 // CHECK: !0 = metadata !{metadata !"any pointer", metadata !1} // CHECK: !1 = metadata !{metadata !"omnipotent char", metadata !2} // CHECK: !2 = metadata !{metadata !"Simple C/C++ TBAA", null} // CHECK: !3 = metadata !{metadata !"int", metadata !1}
Generalize this test to work without instruction names.
Generalize this test to work without instruction names. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@121742 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
b2c0eb6364d545a0083ec3d1cb55ea04fa6c6e2a
src/synchronizer.h
src/synchronizer.h
// // synchronizer.h // P2PSP // // This code is distributed under the GNU General Public License (see // THE_GENERAL_GNU_PUBLIC_LICENSE.txt for extending this information). // Copyright (C) 2016, the P2PSP team. // http://www.p2psp.org // #include <boost/format.hpp> #include <boost/program_options/parsers.hpp> #include <boost/program_options/variables_map.hpp> #include "../lib/p2psp/src/util/trace.h" #include <arpa/inet.h> #include <boost/array.hpp> #include <boost/asio.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/thread/thread.hpp> #include <ctime> #include <fstream> #include <string> #include <tuple> #include <vector> namespace p2psp { class Synchronizer { public: Synchronizer(); ~Synchronizer(); const std::vector<std::string>* peer_list; void Run(int argc, const char* argv[]) throw(boost::system::system_error); //Run the argument parser void PlayChunk(); //Play the chunk to the player void Synchronize(); //To get the offset from the first peer and synchronize the lists void ConnectToPeers(); //Connect the synchronizer with various peers }; }
// // synchronizer.h // P2PSP // // This code is distributed under the GNU General Public License (see // THE_GENERAL_GNU_PUBLIC_LICENSE.txt for extending this information). // Copyright (C) 2016, the P2PSP team. // http://www.p2psp.org // #include <boost/format.hpp> #include <boost/program_options/parsers.hpp> #include <boost/program_options/variables_map.hpp> #include "../lib/p2psp/src/util/trace.h" #include <arpa/inet.h> #include <boost/array.hpp> #include <boost/asio.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/thread/thread.hpp> #include <ctime> #include <fstream> #include <string> #include <tuple> #include <vector> namespace p2psp { class Synchronizer { public: Synchronizer(); ~Synchronizer(); const std::vector<std::string>* peer_list; boost::thread_group thread_group_; void Run(int argc, const char* argv[]) throw(boost::system::system_error); //Run the argument parser void PlayChunk(); //Play the chunk to the player void Synchronize(); //To get the offset from the first peer and synchronize the lists void ConnectToPeers(std::string); //Connect the synchronizer with various peers }; }
Add thread group to manage threads
Add thread group to manage threads
C
mit
hehaichi/p2psp-experiments,hehaichi/p2psp-experiments,hehaichi/p2psp-experiments
91f66b016cb667a05e5e7803a61c6ff1cc7fc8c2
include/dsnutil/singleton.h
include/dsnutil/singleton.h
/// \file /// \brief Singleton design pattern /// /// \author Peter 'png' Hille <peter@das-system-networks.de> #ifndef SINGLETON_HH #define SINGLETON_HH 1 #include <dsnutil/compiler_features.h> namespace dsn { /// \brief Template for singleton classes /// /// This template can be used to implement the "singleton" design pattern /// on any class. template <class Derived> class Singleton { public: /// \brief Access singleton instance /// /// Returns a reference to the instance of this singleton. static dsnutil_cpp_DEPRECATED Derived& getInstance() { return instanceRef(); } static Derived& instanceRef() { static Derived instance; return instance; } static Derived* instancePtr() { return &instanceRef(); } protected: /// \brief Default constructor /// /// \note This ctor is protected so that derived classes can implement /// their own logics for object initialization while still maintaining /// the impossibility of direct ctor calls! Singleton() {} private: /// \brief Copy constructor /// /// \note This ctor is private to prevent multiple instances of the same /// singleton from being created through object assignments! Singleton(const Singleton&) {} }; } #endif // !SINGLETON_HH
/// \file /// \brief Singleton design pattern /// /// \author Peter 'png' Hille <peter@das-system-networks.de> #ifndef SINGLETON_HH #define SINGLETON_HH 1 #include <dsnutil/compiler_features.h> namespace dsn { /// \brief Template for singleton classes /// /// This template can be used to implement the "singleton" design pattern /// on any class. template <class Derived> class Singleton { public: /// \brief Access singleton instance /// /// \return Reference to the instance of this singleton. static dsnutil_cpp_DEPRECATED Derived& getInstance() { return instanceRef(); } /// \brief Access singleton instance (by reference) /// /// \return Reference to the initialized singleton instance static Derived& instanceRef() { static Derived instance; return instance; } /// \brief Access singleton instance (by pointer) /// /// \return Pointer to the initialized singleton instance static Derived* instancePtr() { return &instanceRef(); } protected: /// \brief Default constructor /// /// \note This ctor is protected so that derived classes can implement /// their own logics for object initialization while still maintaining /// the impossibility of direct ctor calls! Singleton() {} private: /// \brief Copy constructor /// /// \note This ctor is private to prevent multiple instances of the same /// singleton from being created through object assignments! Singleton(const Singleton&) {} }; } #endif // !SINGLETON_HH
Add Doxygen comments for new Singleton methods
Add Doxygen comments for new Singleton methods
C
bsd-3-clause
png85/dsnutil_cpp
8ce936c7be896a867a44ce4a4d39b44f4dc7c9b5
UsbDk/Public.h
UsbDk/Public.h
/* * UsbDk filter/redirector driver * * Copyright (c) 2013 Red Hat, Inc. * * Authors: * Dmitry Fleytman <dfleytma@redhat.com> * */ #pragma once #include "UsbDkData.h" #include "UsbDkNames.h" #define USBDK_DEVICE_TYPE 50000 // UsbDk Control Device IOCTLs #define IOCTL_USBDK_COUNT_DEVICES \ ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x851, METHOD_BUFFERED, FILE_READ_ACCESS )) #define IOCTL_USBDK_ENUM_DEVICES \ ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x852, METHOD_BUFFERED, FILE_READ_ACCESS )) #define IOCTL_USBDK_ADD_REDIRECT \ ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x854, METHOD_BUFFERED, FILE_READ_ACCESS )) #define IOCTL_USBDK_REMOVE_REDIRECT \ ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x855, METHOD_BUFFERED, FILE_READ_ACCESS ))
/* * UsbDk filter/redirector driver * * Copyright (c) 2013 Red Hat, Inc. * * Authors: * Dmitry Fleytman <dfleytma@redhat.com> * */ #pragma once #include "UsbDkData.h" #include "UsbDkNames.h" #define USBDK_DEVICE_TYPE 50000 // UsbDk Control Device IOCTLs #define IOCTL_USBDK_COUNT_DEVICES \ ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x851, METHOD_BUFFERED, FILE_READ_ACCESS )) #define IOCTL_USBDK_ENUM_DEVICES \ ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x852, METHOD_BUFFERED, FILE_READ_ACCESS )) #define IOCTL_USBDK_ADD_REDIRECT \ ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x854, METHOD_BUFFERED, FILE_WRITE_ACCESS )) #define IOCTL_USBDK_REMOVE_REDIRECT \ ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x855, METHOD_BUFFERED, FILE_WRITE_ACCESS ))
Fix control device IOCTLS access type
UsbDk: Fix control device IOCTLS access type Signed-off-by: Dmitry Fleytman <f50f56ffad4b379c2a89812e98b14900ef87e9ea@redhat.com>
C
apache-2.0
SPICE/win32-usbdk,freedesktop-unofficial-mirror/spice__win32__usbdk,freedesktop-unofficial-mirror/spice__win32__usbdk,daynix/UsbDk,SPICE/win32-usbdk,freedesktop-unofficial-mirror/spice__win32__usbdk,daynix/UsbDk
5d4adccfabf26f2995b6726a75fdde281e20e8ac
texor.c
texor.c
#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> struct termios orig_termios; void disableRawMode() { tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios); } void enableRawMode() { tcgetattr(STDIN_FILENO, &orig_termios); atexit(disableRawMode); struct termios raw = orig_termios; raw.c_iflag &= ~(ICRNL | IXON); raw.c_oflag &= ~(OPOST); raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw); } int main() { enableRawMode(); char c; while (read(STDIN_FILENO, &c, 1) == 1 && c!= 'q') { if (iscntrl(c)) { printf("%d\r\n", c); } else { printf("%d ('%c')\r\n", c, c); } } return 0; }
#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> struct termios orig_termios; void disableRawMode() { tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios); } void enableRawMode() { tcgetattr(STDIN_FILENO, &orig_termios); atexit(disableRawMode); struct termios raw = orig_termios; raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); raw.c_oflag &= ~(OPOST); raw.c_cflag |= (CS8); raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw); } int main() { enableRawMode(); char c; while (read(STDIN_FILENO, &c, 1) == 1 && c!= 'q') { if (iscntrl(c)) { printf("%d\r\n", c); } else { printf("%d ('%c')\r\n", c, c); } } return 0; }
Disable a few misc flags
Disable a few misc flags
C
bsd-2-clause
kyletolle/texor
46f1e784fefa16719ec7dcbf9ccc4270656fc7df
TWRBorderedView/TWRBorderedView.h
TWRBorderedView/TWRBorderedView.h
// // TWRBorderedView.h // TWRBorderedView // // Created by Michelangelo Chasseur on 15/04/14. // Copyright (c) 2014 Touchware. All rights reserved. // #import <UIKit/UIKit.h> typedef NS_OPTIONS(NSUInteger, TWRBorderMask) { TWRBorderMaskTop = 1 << 0, TWRBorderMaskBottom = 1 << 1, TWRBorderMaskLeft = 1 << 2, TWRBorderMaskRight = 1 << 3 }; @interface TWRBorderedView : UIView @property (nonatomic, assign) TWRBorderMask mask; @property (nonatomic, assign) CGFloat borderWidth; @property (strong, nonatomic) UIColor *borderColor; // Use when assigning values from a XIB file @property (nonatomic, assign) BOOL topBorder; @property (nonatomic, assign) BOOL bottomBorder; @property (nonatomic, assign) BOOL leftBorder; @property (nonatomic, assign) BOOL rightomBorder; - (id)initWithFrame:(CGRect)frame borderWidth:(CGFloat)width color:(UIColor *)color andMask:(TWRBorderMask)mask; @end
// // TWRBorderedView.h // TWRBorderedView // // Created by Michelangelo Chasseur on 15/04/14. // Copyright (c) 2014 Touchware. All rights reserved. // #import <UIKit/UIKit.h> typedef NS_OPTIONS(NSUInteger, TWRBorderMask) { TWRBorderMaskTop = 1 << 0, TWRBorderMaskBottom = 1 << 1, TWRBorderMaskLeft = 1 << 2, TWRBorderMaskRight = 1 << 3 }; @interface TWRBorderedView : UIView @property (nonatomic, assign) TWRBorderMask mask; @property (nonatomic, assign) CGFloat borderWidth; @property (strong, nonatomic) UIColor *borderColor; // Use when assigning values from a XIB file @property (nonatomic, assign) BOOL topBorder; @property (nonatomic, assign) BOOL bottomBorder; @property (nonatomic, assign) BOOL leftBorder; @property (nonatomic, assign) BOOL rightBorder; - (id)initWithFrame:(CGRect)frame borderWidth:(CGFloat)width color:(UIColor *)color andMask:(TWRBorderMask)mask; @end
Fix spelling in property naming.
Fix spelling in property naming.
C
mit
chasseurmic/TWRBorderedView,ChetanGandhi/TWRBorderedView
9a00f8af17d4b4d5810c04f9861217014df99dc2
src/imap/cmd-close.c
src/imap/cmd-close.c
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!client_verify_open_mailbox(cmd)) return TRUE; storage = mailbox_get_storage(mailbox); client->mailbox = NULL; if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage); client_update_mailbox_flags(client, NULL); client_send_tagline(cmd, "OK Close completed."); return TRUE; }
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!client_verify_open_mailbox(cmd)) return TRUE; storage = mailbox_get_storage(mailbox); client->mailbox = NULL; if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); else if (mailbox_sync(mailbox, 0, 0, NULL) < 0) client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage); client_update_mailbox_flags(client, NULL); client_send_tagline(cmd, "OK Close completed."); return TRUE; }
Synchronize the mailbox after expunging messages to actually get them expunged.
CLOSE: Synchronize the mailbox after expunging messages to actually get them expunged. --HG-- branch : HEAD
C
mit
jkerihuel/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,jkerihuel/dovecot,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch,jwm/dovecot-notmuch
b4c0e72db659adff77f16277cf8634d6efc32a51
VisualPractice/commands.h
VisualPractice/commands.h
#ifndef TE_COMMANDS_H #define TE_COMMANDS_H #include <functional> #include <map> #include <SDL_keycode.h> #include <SDL_events.h> #include <memory> namespace te { class Rectangle; enum class Action { UP, DOWN }; typedef std::function<void()> Command; typedef std::map<Action, Command> CommandMap; CommandMap createPaddleCommandMap(std::shared_ptr<Rectangle> pPaddle); typedef std::map<std::pair<SDL_Keycode, Uint32>, Action> KeyMap; KeyMap createPaddleKeyMap(unsigned int configN = 1); } #endif /* TE_COMMANDS_H */
#ifndef TE_COMMANDS_H #define TE_COMMANDS_H #include <functional> #include <map> #include <SDL_keycode.h> #include <SDL_events.h> #include <memory> namespace te { class Rectangle; enum class Action { UP, DOWN }; //typedef std::function<void()> Command; //typedef std::map<Action, Command> CommandMap; //CommandMap createPaddleCommandMap(std::shared_ptr<Rectangle> pPaddle); //typedef std::map<std::pair<SDL_Keycode, Uint32>, Action> KeyMap; //KeyMap createPaddleKeyMap(unsigned int configN = 1); } #endif /* TE_COMMANDS_H */
Comment out old Command to avoid name collisions
Comment out old Command to avoid name collisions
C
mit
evinstk/TantechEngine,evinstk/TantechEngineOriginal,evinstk/TantechEngine,evinstk/TantechEngineOriginal,evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngineOriginal,evinstk/TantechEngineOriginal,evinstk/TantechEngine,evinstk/TantechEngineOriginal,evinstk/TantechEngine,evinstk/TantechEngineOriginal
093693a7dc5c39d74498bb99fa3f9782fdad63f1
test2/int_overflow/trapv_shift.c
test2/int_overflow/trapv_shift.c
// RUN: %ucc -ftrapv -fno-const-fold -o %t %s // RUN: %t; [ $? -ne 0 ] main() { int x; // ensure powers of two aren't shift-converted, as overflow can't catch this x = -3 * 0x4000000000000000; return 0; }
// RUN: %ocheck SIGILL %s -ftrapv -fno-const-fold -DT=int // RUN: %ocheck SIGILL %s -ftrapv -fno-const-fold -DT=long // RUN: %ocheck 0 %s -fno-const-fold -DT=int // RUN: %ocheck 0 %s -fno-const-fold -DT=long main() { // test with T being both int and long, to check how truncations are dealt with T x; // ensure powers of two aren't shift-converted, as overflow can't catch this x = -3 * 0x4000000000000000; return 0; }
Update trapv tests with explicit signal name
Update trapv tests with explicit signal name
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
54e41dd08a06f978a6d123f19f5bbe39370f04ea
audio/null_audio_poller.h
audio/null_audio_poller.h
/* * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef AUDIO_NULL_AUDIO_POLLER_H_ #define AUDIO_NULL_AUDIO_POLLER_H_ #include "modules/audio_device/include/audio_device_defines.h" #include "rtc_base/messagehandler.h" #include "rtc_base/thread_checker.h" namespace webrtc { namespace internal { class NullAudioPoller final : public rtc::MessageHandler { public: explicit NullAudioPoller(AudioTransport* audio_transport); ~NullAudioPoller(); protected: void OnMessage(rtc::Message* msg) override; private: const rtc::ThreadChecker thread_checker_; AudioTransport* const audio_transport_; int64_t reschedule_at_; }; } // namespace internal } // namespace webrtc #endif // AUDIO_NULL_AUDIO_POLLER_H_
/* * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef AUDIO_NULL_AUDIO_POLLER_H_ #define AUDIO_NULL_AUDIO_POLLER_H_ #include "modules/audio_device/include/audio_device_defines.h" #include "rtc_base/messagehandler.h" #include "rtc_base/thread_checker.h" namespace webrtc { namespace internal { class NullAudioPoller final : public rtc::MessageHandler { public: explicit NullAudioPoller(AudioTransport* audio_transport); ~NullAudioPoller(); protected: void OnMessage(rtc::Message* msg) override; private: rtc::ThreadChecker thread_checker_; AudioTransport* const audio_transport_; int64_t reschedule_at_; }; } // namespace internal } // namespace webrtc #endif // AUDIO_NULL_AUDIO_POLLER_H_
Remove const from ThreadChecker in NullAudioPoller.
Remove const from ThreadChecker in NullAudioPoller. TBR=henrika@webrtc.org,solenberg@webrtc.org Bug: webrtc:8482 Change-Id: Ib2738224e776618c692db95cd9473335bc17be15 Reviewed-on: https://webrtc-review.googlesource.com/17540 Commit-Queue: Björn Terelius <efeae16329b3cb4ac5daf80d4bfda3344c027db3@webrtc.org> Reviewed-by: Björn Terelius <efeae16329b3cb4ac5daf80d4bfda3344c027db3@webrtc.org> Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#20505}
C
bsd-3-clause
TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc
5be6eff496407146af24c8e85ae2c560b40eeab8
src/safe_memory.c
src/safe_memory.c
#include "safe-c/safe_memory.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void* safe_malloc_function(size_t size, const char* calling_function) { if (size == 0) { fprintf(stderr, "Error allocating memory: The function %s called " "'safe_malloc' and requested zero memory. The pointer should " "be explicitly set to NULL instead.\n", calling_function); exit(EXIT_FAILURE); } void* memory = malloc(size); if (!memory) { fprintf(stderr, "Error allocating memory: The function %s called " "'safe_malloc' requesting %u bytes of memory, but an error " "occurred allocating this amount of memory. Exiting", calling_function); exit(EXIT_FAILURE); } memset(memory, 0, size); return memory; } void safe_free_function(void** pointer) { if (pointer != NULL) { free(*pointer); *pointer = NULL; } }
#include "safe-c/safe_memory.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void* safe_malloc_function(size_t size, const char* calling_function) { if (size == 0) { fprintf(stderr, "Error allocating memory: The function %s called " "'safe_malloc' and requested zero memory. The pointer should " "be explicitly set to NULL instead.\n", calling_function); exit(EXIT_FAILURE); } void* memory = malloc(size); if (!memory) { fprintf(stderr, "Error allocating memory: The function %s called " "'safe_malloc' requesting %zu bytes of memory, but an error " "occurred allocating this amount of memory. Exiting", calling_function, size); exit(EXIT_FAILURE); } memory = memset(memory, 0, size); return memory; } void safe_free_function(void** pointer) { if (pointer != NULL) { free(*pointer); *pointer = NULL; } }
Add value parameter to fprintf in safe_malloc
Fix: Add value parameter to fprintf in safe_malloc Changed the value type in the `fprintf` from `u` to `zu`, this is because `size` is of type `size_t` and not `unsigned int`. In addation, asign the return value of memset to `memory`.
C
mit
VanJanssen/safe-c,ErwinJanssen/elegan-c,VanJanssen/elegan-c
174758bdd8ff7b763e274ccd6cfe84bf73f91f68
trace.h
trace.h
#ifndef _TRACE_H_ #define _TRACE_H_ #include <stdio.h> #include <errno.h> #ifdef DEBUG #define TRACE ERROR #else #define TRACE(fmt,arg...) ((void) 0) #endif #define ERROR(fmt,arg...) \ fprintf(stderr, "%s:%s:%d: "fmt, program_invocation_short_name, __func__, __LINE__, ##arg) #define FATAL(fmt,arg...) do { \ ERROR(fmt, ##arg); \ exit(1); \ } while (0) #endif
#ifndef _TRACE_H_ #define _TRACE_H_ #include <stdio.h> #include <errno.h> #ifdef DEBUG #define TRACE ERROR #else #define TRACE(fmt,arg...) ((void) 0) #endif #ifdef DEBUG #define ERROR(fmt,arg...) \ fprintf(stderr, "%s:%d: "fmt, __func__, __LINE__, ##arg) #else #define ERROR(fmt,arg...) \ fprintf(stderr, "%s: "fmt, program_invocation_short_name, ##arg) #endif #define FATAL(fmt,arg...) do { \ ERROR(fmt, ##arg); \ exit(1); \ } while (0) #endif
Add __func__, __LINE__ to TRACE if DEBUG, otherwise add progname.
Add __func__, __LINE__ to TRACE if DEBUG, otherwise add progname.
C
lgpl-2.1
TACCProjects/tacc_stats,aaichsmn/tacc_stats,TACCProjects/tacc_stats,rtevans/tacc_stats_old,TACCProjects/tacc_stats,dimm0/tacc_stats,TACC/tacc_stats,TACC/tacc_stats,sdsc/xsede_stats,ubccr/tacc_stats,dimm0/tacc_stats,ubccr/tacc_stats,sdsc/xsede_stats,sdsc/xsede_stats,aaichsmn/tacc_stats,ubccr/tacc_stats,TACC/tacc_stats,ubccr/tacc_stats,dimm0/tacc_stats,TACCProjects/tacc_stats,aaichsmn/tacc_stats,sdsc/xsede_stats,aaichsmn/tacc_stats,dimm0/tacc_stats,ubccr/tacc_stats,dimm0/tacc_stats,TACC/tacc_stats,rtevans/tacc_stats_old,TACC/tacc_stats,rtevans/tacc_stats_old
a198c3d0393faa1fa9f0e6e917ce980d3638f8df
drivers/scsi/qla2xxx/qla_version.h
drivers/scsi/qla2xxx/qla_version.h
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.02.01-k1" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 2 #define QLA_DRIVER_PATCH_VER 1 #define QLA_DRIVER_BETA_VER 0
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.02.01-k2" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 2 #define QLA_DRIVER_PATCH_VER 1 #define QLA_DRIVER_BETA_VER 0
Update version number to 8.02.01-k2.
[SCSI] qla2xxx: Update version number to 8.02.01-k2. Signed-off-by: Andrew Vasquez <67840a4977006af7f584bdc4c86d7243c1629cad@qlogic.com> Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@HansenPartnership.com>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs
cf3059a12936f8e92876e56b50bcdb092be70645
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k13"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k14"
Update driver version to 5.02.00-k14
[SCSI] qla4xxx: Update driver version to 5.02.00-k14 Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com> Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>
C
mit
KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
04fedf7ef8260ffbb1bbefc214aae279a62f6973
SSPSolution/SSPSolution/DoorEntity.h
SSPSolution/SSPSolution/DoorEntity.h
#ifndef SSPAPPLICATION_ENTITIES_DOORENTITY_H #define SSPAPPLICATION_ENTITIES_DOORENTITY_H #include "Entity.h" #include <vector> class DoorEntity : public Entity { private: struct ElementState { int entityID; EVENT desiredState; bool desiredStateReached; }; std::vector<ElementState> m_elementStates; bool m_isOpened; float m_minRotation; float m_maxRotation; float m_rotateTime; float m_rotatePerSec; public: DoorEntity(); virtual ~DoorEntity(); int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, float rotateTime = 1.0f, float minRotation = 0.0f, float maxRotation = DirectX::XM_PI / 2.0f); int Update(float dT, InputHandler* inputHandler); int React(int entityID, EVENT reactEvent); bool SetIsOpened(bool isOpened); bool GetIsOpened(); }; #endif
#ifndef SSPAPPLICATION_ENTITIES_DOORENTITY_H #define SSPAPPLICATION_ENTITIES_DOORENTITY_H #include "Entity.h" #include <vector> class DoorEntity : public Entity { private: /*struct ElementState { int entityID; EVENT desiredState; bool desiredStateReached; }; std::vector<ElementState> m_elementStates;*/ bool m_isOpened; float m_minRotation; float m_maxRotation; float m_rotateTime; float m_rotatePerSec; public: DoorEntity(); virtual ~DoorEntity(); int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, float rotateTime = 1.0f, float minRotation = 0.0f, float maxRotation = DirectX::XM_PI / 2.0f); int Update(float dT, InputHandler* inputHandler); int React(int entityID, EVENT reactEvent); bool SetIsOpened(bool isOpened); bool GetIsOpened(); }; #endif
UPDATE Commented out some test code
UPDATE Commented out some test code
C
apache-2.0
Chringo/SSP,Chringo/SSP
97560dd8e208d7b7fc2262cef135a3cbcaeae2eb
components/libc/mmap/posix_mmap.c
components/libc/mmap/posix_mmap.c
/* * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2017/11/30 Bernard The first version. */ #include <stdint.h> #include <stdio.h> #include <rtthread.h> #include <dfs_posix.h> #include <sys/mman.h> void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) { uint8_t *mem; if (addr) { mem = addr; } else mem = (uint8_t *)malloc(length); if (mem) { off_t cur; size_t read_bytes; cur = lseek(fd, 0, SEEK_SET); lseek(fd, offset, SEEK_SET); read_bytes = read(fd, addr, length); if (read_bytes != length) { if (addr == RT_NULL) { /* read failed */ free(mem); mem = RT_NULL; } } lseek(fd, cur, SEEK_SET); return mem; } errno = ENOMEM; return MAP_FAILED; } int munmap(void *addr, size_t length) { if (addr) { free(addr); return 0; } return -1; }
/* * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2017/11/30 Bernard The first version. */ #include <stdint.h> #include <stdio.h> #include <rtthread.h> #include <dfs_posix.h> #include <sys/mman.h> void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) { uint8_t *mem; if (addr) { mem = addr; } else mem = (uint8_t *)malloc(length); if (mem) { off_t cur; size_t read_bytes; cur = lseek(fd, 0, SEEK_SET); lseek(fd, offset, SEEK_SET); read_bytes = read(fd, mem, length); if (read_bytes != length) { if (addr == RT_NULL) { /* read failed */ free(mem); mem = RT_NULL; } } lseek(fd, cur, SEEK_SET); return mem; } errno = ENOMEM; return MAP_FAILED; } int munmap(void *addr, size_t length) { if (addr) { free(addr); return 0; } return -1; }
Fix the addr=NULL issue in mmap.
[libc] Fix the addr=NULL issue in mmap.
C
apache-2.0
RT-Thread/rt-thread,gbcwbz/rt-thread,weety/rt-thread,weiyuliang/rt-thread,RT-Thread/rt-thread,RT-Thread/rt-thread,nongxiaoming/rt-thread,geniusgogo/rt-thread,armink/rt-thread,armink/rt-thread,nongxiaoming/rt-thread,AubrCool/rt-thread,RT-Thread/rt-thread,gbcwbz/rt-thread,geniusgogo/rt-thread,hezlog/rt-thread,hezlog/rt-thread,ArdaFu/rt-thread,weety/rt-thread,zhaojuntao/rt-thread,zhaojuntao/rt-thread,hezlog/rt-thread,nongxiaoming/rt-thread,gbcwbz/rt-thread,FlyLu/rt-thread,weiyuliang/rt-thread,nongxiaoming/rt-thread,ArdaFu/rt-thread,hezlog/rt-thread,AubrCool/rt-thread,weiyuliang/rt-thread,ArdaFu/rt-thread,weety/rt-thread,zhaojuntao/rt-thread,geniusgogo/rt-thread,FlyLu/rt-thread,armink/rt-thread,nongxiaoming/rt-thread,armink/rt-thread,gbcwbz/rt-thread,FlyLu/rt-thread,weety/rt-thread,AubrCool/rt-thread,RT-Thread/rt-thread,gbcwbz/rt-thread,AubrCool/rt-thread,RT-Thread/rt-thread,nongxiaoming/rt-thread,weety/rt-thread,AubrCool/rt-thread,hezlog/rt-thread,zhaojuntao/rt-thread,ArdaFu/rt-thread,geniusgogo/rt-thread,ArdaFu/rt-thread,zhaojuntao/rt-thread,weety/rt-thread,weiyuliang/rt-thread,gbcwbz/rt-thread,nongxiaoming/rt-thread,weiyuliang/rt-thread,FlyLu/rt-thread,weety/rt-thread,ArdaFu/rt-thread,ArdaFu/rt-thread,FlyLu/rt-thread,hezlog/rt-thread,RT-Thread/rt-thread,zhaojuntao/rt-thread,weiyuliang/rt-thread,AubrCool/rt-thread,armink/rt-thread,armink/rt-thread,FlyLu/rt-thread,geniusgogo/rt-thread,geniusgogo/rt-thread,weiyuliang/rt-thread,geniusgogo/rt-thread,gbcwbz/rt-thread,zhaojuntao/rt-thread,FlyLu/rt-thread,armink/rt-thread,hezlog/rt-thread,AubrCool/rt-thread
e0ff8228425c0235e4d352460c203d43f6a24a19
util/InputState.h
util/InputState.h
#ifndef INPUTSTATE_H #define INPUTSTATE_H #include <SDL2/SDL.h> #undef main #include <map> class InputState { public: enum KeyFunction { KF_EXIT, KF_FORWARDS, KF_BACKWARDS, KF_ROTATE_SUN }; InputState(); void readInputState(); bool getKeyState(KeyFunction f); int getAbsoluteMouseX() { return mouse_x; }; int getAbsoluteMouseY() { return mouse_y; }; float getMouseX() { return (float)mouse_x / (float)w; }; float getMouseY() { return (float)mouse_y / (float)h; }; int w, h; int mouse_x, mouse_y; private: Uint8 *keys; Uint8 key_function_to_keycode[4]; }; #endif
#ifndef INPUTSTATE_H #define INPUTSTATE_H #include <SDL2/SDL.h> #undef main #include <map> class InputState { public: enum KeyFunction { KF_EXIT, KF_FORWARDS, KF_BACKWARDS, KF_ROTATE_SUN }; InputState(); void readInputState(); bool getKeyState(KeyFunction f); int getAbsoluteMouseX() { return mouse_x; }; int getAbsoluteMouseY() { return mouse_y; }; float getMouseX() { return (float)mouse_x / (float)w; }; float getMouseY() { return (float)mouse_y / (float)h; }; int w, h; int mouse_x, mouse_y; private: const Uint8 *keys; Uint8 key_function_to_keycode[4]; }; #endif
Change key state array constness.
Change key state array constness. Fixed for compatibility with upstream SDL2.
C
mit
pstiasny/derpengine,pstiasny/derpengine
7b1b9a38211b3d24d7e546c1f8314e17eea73391
oscl/oscl_base.h
oscl/oscl_base.h
/* ------------------------------------------------------------------ * Copyright (C) 2009 Martin Storsjo * * 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 OSCL_BASE_H #define OSCL_BASE_H #include <stdint.h> typedef int8_t int8; typedef uint8_t uint8; typedef int16_t int16; typedef uint16_t uint16; typedef int32_t int32; typedef uint32_t uint32; typedef int64_t int64; typedef uint64_t uint64; #define OSCL_IMPORT_REF #define OSCL_EXPORT_REF #define OSCL_UNUSED_ARG (void) #endif
/* ------------------------------------------------------------------ * Copyright (C) 2009 Martin Storsjo * * 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 OSCL_BASE_H #define OSCL_BASE_H #include <stdint.h> typedef int8_t int8; typedef uint8_t uint8; typedef int16_t int16; typedef uint16_t uint16; typedef int32_t int32; typedef uint32_t uint32; typedef int64_t int64; typedef uint64_t uint64; #define OSCL_IMPORT_REF #define OSCL_EXPORT_REF #define OSCL_UNUSED_ARG(x) (void)(x) #endif
Use suggested change from Martin in defining OSCL_UNUSED_ARG.
Use suggested change from Martin in defining OSCL_UNUSED_ARG.
C
apache-2.0
Distrotech/opencore-amr,KurentoLegacy/opencore-amr,KurentoLegacy/opencore-amr,VFR-maniac/opencore-amr,BelledonneCommunications/opencore-amr,yxl/opencore-amr-js,lyx2014/-opencore-amr,yxl/opencore-amr-js,VFR-maniac/opencore-amr,BelledonneCommunications/opencore-amr,jiangjianping/opencore-amr,VFR-maniac/opencore-amr,lyx2014/-opencore-amr,yxl/opencore-amr-js,Distrotech/opencore-amr,KurentoLegacy/opencore-amr,Distrotech/opencore-amr,jiangjianping/opencore-amr,yxl/opencore-amr-js,yxl/opencore-amr-js
b767e4fe4d8f4ff89dbd4a4c95352511e983162f
src/libcol/include/util/error.h
src/libcol/include/util/error.h
#ifndef ERROR_H #define ERROR_H /* * Note that we include "fmt" in the variadic argument list, because C99 * apparently doesn't allow variadic macros to be invoked without any vargs * parameters. */ #define ERROR(...) var_error(__FILE__, __LINE__, __VA_ARGS__) #define FAIL() simple_error(__FILE__, __LINE__) #define ASSERT(cond) ((cond) || assert_fail(APR_STRINGIFY(cond), \ __FILE__, __LINE__)) void simple_error(const char *file, int line_num); void var_error(const char *file, int line_num, const char *fmt, ...) __attribute__((format(printf, 3, 4))); int assert_fail(const char *cond, const char *file, int line_num); #endif /* ERROR_H */
#ifndef ERROR_H #define ERROR_H /* * Note that we include "fmt" in the variadic argument list, because C99 * apparently doesn't allow variadic macros to be invoked without any vargs * parameters. */ #define ERROR(...) var_error(__FILE__, __LINE__, __VA_ARGS__) #define FAIL() simple_error(__FILE__, __LINE__) #define ASSERT(cond) ((cond) || assert_fail(APR_STRINGIFY(cond), \ __FILE__, __LINE__)) void simple_error(const char *file, int line_num) __attribute__((noreturn)); void var_error(const char *file, int line_num, const char *fmt, ...) __attribute__((format(printf, 3, 4), noreturn)); int assert_fail(const char *cond, const char *file, int line_num); #endif /* ERROR_H */
Use GCC "noreturn" function attribute.
Use GCC "noreturn" function attribute.
C
mit
bloom-lang/c4,bloom-lang/c4,bloom-lang/c4
017146d8004a683cfb9fef68095a238372ba1743
include/nekit/config.h
include/nekit/config.h
// MIT License // Copyright (c) 2017 Zhuhao Wang // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #pragma once #ifndef NEKIT_TUNNEL_BUFFER_SIZE #define NEKIT_TUNNEL_BUFFER_SIZE 8192 #endif #ifndef NEKIT_TUNNEL_MAX_BUFFER_SIZE #define NEKIT_TUNNEL_MAX_BUFFER_SIZE NEKIT_TUNNEL_BUFFER_SIZE #endif
// MIT License // Copyright (c) 2017 Zhuhao Wang // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #pragma once #ifndef NEKIT_TUNNEL_BUFFER_SIZE #define NEKIT_TUNNEL_BUFFER_SIZE 8192 #endif #ifndef NEKIT_TUNNEL_MAX_BUFFER_SIZE #define NEKIT_TUNNEL_MAX_BUFFER_SIZE (NEKIT_TUNNEL_BUFFER_SIZE * 2) #endif
Enlarge default buffer size limit
FEAT: Enlarge default buffer size limit
C
mit
zhuhaow/libnekit,zhuhaow/libnekit,zhuhaow/libnekit,zhuhaow/libnekit
421139c98b8f202d8a3f5c7667cec95271ae0238
tests/regression/13-privatized/32-traces-mine-vs-oplus-vs-meet.c
tests/regression/13-privatized/32-traces-mine-vs-oplus-vs-meet.c
#include <pthread.h> #include <assert.h> int g = 0; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t C = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); pthread_mutex_lock(&C); pthread_mutex_lock(&B); g = 5; pthread_mutex_unlock(&B); pthread_mutex_lock(&B); g = 0; pthread_mutex_unlock(&B); pthread_mutex_unlock(&C); pthread_mutex_unlock(&A); return NULL; } int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); // This must be before the other to get Mine to fail for the other even with thread ID partitioning. pthread_mutex_lock(&B); pthread_mutex_lock(&C); assert(g == 0); pthread_mutex_unlock(&C); pthread_mutex_unlock(&B); pthread_mutex_lock(&A); pthread_mutex_lock(&B); assert(g == 0); pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); pthread_join(id, NULL); return 0; }
#include <pthread.h> #include <assert.h> int g = 0; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t C = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); pthread_mutex_lock(&C); pthread_mutex_lock(&B); g = 5; pthread_mutex_unlock(&B); pthread_mutex_lock(&B); g = 0; pthread_mutex_unlock(&B); pthread_mutex_unlock(&C); pthread_mutex_unlock(&A); return NULL; } int main(void) { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); // This must be before the other to get Mine to fail for the other even with thread ID partitioning. pthread_mutex_lock(&B); pthread_mutex_lock(&C); assert(g == 0); // mine and mutex-oplus fail, mutex-meet succeeds pthread_mutex_unlock(&C); pthread_mutex_unlock(&B); pthread_mutex_lock(&A); pthread_mutex_lock(&B); assert(g == 0); // mine fails, mutex-oplus and mutex-meet succeed pthread_mutex_unlock(&B); pthread_mutex_unlock(&A); pthread_join(id, NULL); return 0; }
Add assert fail/success comments to 13/32
Add assert fail/success comments to 13/32
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
5bf537f29920a7a3c9db7792666b3af281f203e4
src/plugins/cpu.c
src/plugins/cpu.c
#include <uv.h> #include <estragon.h> #ifdef __sun #include <sys/pset.h> #include <sys/loadavg.h> #endif static uv_timer_t cpu_timer; void send_cpu_usage(uv_timer_t *timer, int status) { double loadinfo[3]; #ifdef DEBUG printf("cpu usage timer fired, status %d\n", status); #endif #ifdef __sun /* On SunOS, if we're not in a global zone, uv_loadavg returns [0, 0, 0] */ /* This, instead, gets the loadavg for our assigned processor set. */ pset_getloadavg(PS_MYID, loadinfo, 3); #else uv_loadavg(loadinfo); #endif estragon_send("CPU load, last minute", "info", loadinfo[0]); estragon_send("CPU load, last 5 minutes", "info", loadinfo[1]); estragon_send("CPU load, last 15 minutes", "info", loadinfo[2]); } int cpu_init() { uv_timer_init(uv_default_loop(), &cpu_timer); uv_timer_start(&cpu_timer, send_cpu_usage, 0, 1000); return 0; }
#include <uv.h> #include <estragon.h> #ifdef __sun #include <sys/pset.h> #include <sys/loadavg.h> #endif static uv_timer_t cpu_timer; void send_cpu_usage(uv_timer_t *timer, int status) { double loadinfo[3]; #ifdef DEBUG printf("cpu usage timer fired, status %d\n", status); #endif #ifdef __sun /* On SunOS, if we're not in a global zone, uv_loadavg returns [0, 0, 0] */ /* This, instead, gets the loadavg for our assigned processor set. */ pset_getloadavg(PS_MYID, loadinfo, 3); #else uv_loadavg(loadinfo); #endif estragon_send("cpu", "info", "CPU load, last minute", loadinfo[0]); estragon_send("cpu", "info", "CPU load, last 5 minutes", loadinfo[1]); estragon_send("cpu", "info", "CPU load, last 15 minutes", loadinfo[2]); } int cpu_init() { uv_timer_init(uv_default_loop(), &cpu_timer); uv_timer_start(&cpu_timer, send_cpu_usage, 0, 1000); return 0; }
Use new `estragon_send` API in CPU plugin
[api] Use new `estragon_send` API in CPU plugin
C
mit
mmalecki/forza,opsmezzo/forza,mmalecki/forza,npm/forza,cloudninja-io/libinterposed,mmalecki/forza,opsmezzo/forza,opsmezzo/forza
c5dff4b623492ff9fdb44242b5263df7e637981c
src/plugins/zlib/istream-bzlib.c
src/plugins/zlib/istream-bzlib.c
/* Copyright (c) 2005-2008 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "istream-internal.h" #include "istream-zlib.h" #ifdef HAVE_BZLIB #include <bzlib.h> #define BZLIB_INCLUDE #define gzFile BZFILE #define gzdopen BZ2_bzdopen #define gzclose BZ2_bzclose #define gzread BZ2_bzread #define gzseek BZ2_bzseek #define i_stream_create_zlib i_stream_create_bzlib #include "istream-zlib.c" #endif
/* Copyright (c) 2005-2008 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "istream-internal.h" #include "istream-zlib.h" #ifdef HAVE_BZLIB #include <stdio.h> #include <bzlib.h> #define BZLIB_INCLUDE #define gzFile BZFILE #define gzdopen BZ2_bzdopen #define gzclose BZ2_bzclose #define gzread BZ2_bzread #define gzseek BZ2_bzseek #define i_stream_create_zlib i_stream_create_bzlib #include "istream-zlib.c" #endif
Include stdio.h in case bzlib.h needs it.
bzlib: Include stdio.h in case bzlib.h needs it. --HG-- branch : HEAD
C
mit
dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot
ef0b1d076b6a4a3954358e07f432a3e57b1e0e4e
Classes/APIAFNetworkingHTTPClient.h
Classes/APIAFNetworkingHTTPClient.h
// // APIAFNetworkingHTTPClient.h // APIClient // // Created by Klaas Pieter Annema on 30-08-13. // Copyright (c) 2013 Klaas Pieter Annema. All rights reserved. // #import <Foundation/Foundation.h> #import "AFNetworking.h" #import "APIHTTPClient.h" @interface APIAFNetworkingHTTPClient : NSObject <APIHTTPClient> @property (nonatomic, readonly, copy) NSURL *baseURL; @property (nonatomic, readonly, strong) NSURLSessionConfiguration *sessionConfiguration; - (id)initWithBaseURL:(NSURL *)baseURL; - (id)initWithBaseURL:(NSURL *)baseURL sessionConfiguration:(NSURLSessionConfiguration *)sessionConfiguration NS_DESIGNATED_INITIALIZER; @end
// // APIAFNetworkingHTTPClient.h // APIClient // // Created by Klaas Pieter Annema on 30-08-13. // Copyright (c) 2013 Klaas Pieter Annema. All rights reserved. // #import <Foundation/Foundation.h> #import <AFNetworking/AFNetworking.h> #import "APIHTTPClient.h" @interface APIAFNetworkingHTTPClient : NSObject <APIHTTPClient> @property (nonatomic, readonly, copy) NSURL *baseURL; @property (nonatomic, readonly, strong) NSURLSessionConfiguration *sessionConfiguration; - (id)initWithBaseURL:(NSURL *)baseURL; - (id)initWithBaseURL:(NSURL *)baseURL sessionConfiguration:(NSURLSessionConfiguration *)sessionConfiguration NS_DESIGNATED_INITIALIZER; @end
Use the correct import syntax
Use the correct import syntax
C
mit
klaaspieter/APIClient
fdd95026532a728b5faad191f7485183546cfe3b
include/fruit/impl/unordered_map.h
include/fruit/impl/unordered_map.h
/* * Copyright 2014 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. */ #ifndef FRUIT_UNORDERED_MAP_H #define FRUIT_UNORDERED_MAP_H #ifdef FRUIT_NO_SPARSE_HASH #include <unordered_map> namespace fruit { namespace impl { template <typename Key, typename Value> using UnorderedMap = std::unordered_map<Key, Value>; } // namespace impl } // namespace fruit #else #include <sparsehash/dense_hash_map> namespace fruit { namespace impl { template <typename Key, typename Value> using UnorderedMap = google::dense_hash_map<Key, Value>; } // namespace impl } // namespace fruit #endif #endif // FRUIT_UNORDERED_MAP_H
/* * Copyright 2014 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. */ #ifndef FRUIT_UNORDERED_MAP_H #define FRUIT_UNORDERED_MAP_H #ifdef FRUIT_NO_SPARSE_HASH #include <unordered_map> namespace fruit { namespace impl { template <typename Key, typename Value> using UnorderedMap = std::unordered_map<Key, Value>; } // namespace impl } // namespace fruit #else #include <google/dense_hash_map> namespace fruit { namespace impl { template <typename Key, typename Value> using UnorderedMap = google::dense_hash_map<Key, Value>; } // namespace impl } // namespace fruit #endif #endif // FRUIT_UNORDERED_MAP_H
Use the old include path for sparsehash to support older versions of sparsehash (still currently used in Ubuntu and Fedora).
Use the old include path for sparsehash to support older versions of sparsehash (still currently used in Ubuntu and Fedora).
C
apache-2.0
d/fruit,google/fruit,google/fruit,google/fruit,d/fruit,d/fruit
64d0405834a9228234f2d3f8b80503d4c7309515
include/matrix_constructors_impl.h
include/matrix_constructors_impl.h
//----------------------------------------------------------------------------- // Constructors //----------------------------------------------------------------------------- template<class T> matrix<T>::matrix():data_(),rows_(0),cols_(0){} template<class T> matrix<T>::matrix( std::size_t rows, std::size_t cols ): data_(rows*cols),rows_(rows),cols_(cols){} template<class T> matrix<T>::matrix( std::initializer_list<std::initializer_list<T>> init_list): data_( make_vector(init_list) ), rows_(init_list.size()),cols_( init_list.begin()->size() ){}
//----------------------------------------------------------------------------- // Constructors //----------------------------------------------------------------------------- template<class T> matrix<T>::matrix():data_(),rows_(0),cols_(0){} template<class T> matrix<T>::matrix( std::size_t rows, std::size_t cols ): data_(rows*cols),rows_(rows),cols_(cols){} template<class T> matrix<T>::matrix( std::initializer_list<std::initializer_list<T>> init_list): data_( make_vector(init_list) ), rows_(init_list.size()),cols_( init_list.begin()->size() ){} // !!! // // Is "init_list.begin()->size()" ok if init_list = {} ? // // !!!
Add question comment to constructor.
Add question comment to constructor.
C
mit
actinium/cppMatrix,actinium/cppMatrix
5cbfdaeb02fcf303e0b8d00b0ba4a91ba8320f53
wayland/input_device.h
wayland/input_device.h
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef OZONE_WAYLAND_INPUT_DEVICE_H_ #define OZONE_WAYLAND_INPUT_DEVICE_H_ #include <wayland-client.h> #include "base/basictypes.h" namespace ozonewayland { class WaylandKeyboard; class WaylandPointer; class WaylandDisplay; class WaylandWindow; class WaylandInputDevice { public: WaylandInputDevice(WaylandDisplay* display, uint32_t id); ~WaylandInputDevice(); wl_seat* GetInputSeat() { return input_seat_; } WaylandKeyboard* GetKeyBoard() const { return input_keyboard_; } WaylandPointer* GetPointer() const { return input_pointer_; } unsigned GetFocusWindowHandle() { return focused_window_handle_; } void SetFocusWindowHandle(unsigned windowhandle); private: static void OnSeatCapabilities(void *data, wl_seat *seat, uint32_t caps); // Keeps track of current focused window. unsigned focused_window_handle_; wl_seat* input_seat_; WaylandKeyboard* input_keyboard_; WaylandPointer* input_pointer_; DISALLOW_COPY_AND_ASSIGN(WaylandInputDevice); }; } // namespace ozonewayland #endif // OZONE_WAYLAND_INPUT_DEVICE_H_
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef OZONE_WAYLAND_INPUT_DEVICE_H_ #define OZONE_WAYLAND_INPUT_DEVICE_H_ #include <wayland-client.h> #include "base/basictypes.h" namespace ozonewayland { class WaylandKeyboard; class WaylandPointer; class WaylandDisplay; class WaylandWindow; class WaylandInputDevice { public: WaylandInputDevice(WaylandDisplay* display, uint32_t id); ~WaylandInputDevice(); wl_seat* GetInputSeat() const { return input_seat_; } WaylandKeyboard* GetKeyBoard() const { return input_keyboard_; } WaylandPointer* GetPointer() const { return input_pointer_; } unsigned GetFocusWindowHandle() const { return focused_window_handle_; } void SetFocusWindowHandle(unsigned windowhandle); private: static void OnSeatCapabilities(void *data, wl_seat *seat, uint32_t caps); // Keeps track of current focused window. unsigned focused_window_handle_; wl_seat* input_seat_; WaylandKeyboard* input_keyboard_; WaylandPointer* input_pointer_; DISALLOW_COPY_AND_ASSIGN(WaylandInputDevice); }; } // namespace ozonewayland #endif // OZONE_WAYLAND_INPUT_DEVICE_H_
Make read only functions as const.
Inputs: Make read only functions as const. Adds missing const keyword for Read only functions in WaylandInputDevice.
C
bsd-3-clause
01org/ozone-wayland,hongzhang-yan/ozone-wayland,rakuco/ozone-wayland,baillaw/ozone-wayland,qjia7/ozone-wayland,joone/ozone-wayland,nagineni/ozone-wayland,hongzhang-yan/ozone-wayland,kishansheshagiri/ozone-wayland,darktears/ozone-wayland,kuscsik/ozone-wayland,siteshwar/ozone-wayland,Tarnyko/ozone-wayland,Tarnyko/ozone-wayland,siteshwar/ozone-wayland,01org/ozone-wayland,kishansheshagiri/ozone-wayland,shaochangbin/ozone-wayland,hongzhang-yan/ozone-wayland,darktears/ozone-wayland,sjnewbury/ozone-wayland,clopez/ozone-wayland,joone/ozone-wayland,siteshwar/ozone-wayland,nicoguyo/ozone-wayland,01org/ozone-wayland,clopez/ozone-wayland,speedpat/ozone-wayland,mrunalk/ozone-wayland,shaochangbin/ozone-wayland,racarr-ubuntu/ozone-mir,tiagovignatti/ozone-wayland,joone/ozone-wayland,darktears/ozone-wayland,nicoguyo/ozone-wayland,ds-hwang/ozone-wayland,likewise/ozone-wayland,joone/ozone-wayland,AndriyP/ozone-wayland,hongzhang-yan/ozone-wayland,speedpat/ozone-wayland,shaochangbin/ozone-wayland,kuscsik/ozone-wayland,nagineni/ozone-wayland,baillaw/ozone-wayland,sjnewbury/ozone-wayland,kuscsik/ozone-wayland,kalyankondapally/ozone-wayland,nagineni/ozone-wayland,AndriyP/ozone-wayland,rakuco/ozone-wayland,AndriyP/ozone-wayland,kishansheshagiri/ozone-wayland,AndriyP/ozone-wayland,nicoguyo/ozone-wayland,baillaw/ozone-wayland,racarr-ubuntu/ozone-mir,nicoguyo/ozone-wayland,kuscsik/ozone-wayland,darktears/ozone-wayland,qjia7/ozone-wayland,rakuco/ozone-wayland,01org/ozone-wayland,tiagovignatti/ozone-wayland,ds-hwang/ozone-wayland,mrunalk/ozone-wayland,baillaw/ozone-wayland,speedpat/ozone-wayland,mrunalk/ozone-wayland,speedpat/ozone-wayland,kalyankondapally/ozone-wayland,Tarnyko/ozone-wayland,nagineni/ozone-wayland,likewise/ozone-wayland,qjia7/ozone-wayland,mrunalk/ozone-wayland,likewise/ozone-wayland,kalyankondapally/ozone-wayland,shaochangbin/ozone-wayland,sjnewbury/ozone-wayland,likewise/ozone-wayland,siteshwar/ozone-wayland,rakuco/ozone-wayland,ds-hwang/ozone-wayland,tiagovignatti/ozone-wayland,kalyankondapally/ozone-wayland,racarr-ubuntu/ozone-mir,kishansheshagiri/ozone-wayland,Tarnyko/ozone-wayland,qjia7/ozone-wayland,clopez/ozone-wayland,sjnewbury/ozone-wayland,tiagovignatti/ozone-wayland,racarr-ubuntu/ozone-mir,clopez/ozone-wayland,ds-hwang/ozone-wayland
1211ce98a12c4990d6d506cbdb9fb5024ad0100a
services/inputaxis.h
services/inputaxis.h
#ifndef INPUT_AXIS_H #define INPUT_AXIS_H #include "../services.h" #include <stdbool.h> typedef struct { bool invert; bool enabled; /* Deadzone */ double negative_deadzone; double positive_deadzone; /* Max/min */ double negative_maximum; double positive_maximum; } axis_config; typedef struct { const char* name; double value; axis_config* settings; } inputaxis; typedef struct { size_t num_inputaxes; inputaxis* axes; } inputaxis_data; const axis_config* default_settings(); double get_input_for_axis(void*, const char*); int update_axis_value(inputaxis_data*, const char* name, double val); int create_axis(inputaxis_data*, const char* name, axis_config*); int delete_axis(inputaxis_data*, const char* name, axis_config**); axis_config* get_axis_settings(inputaxis_data*, const char* name); int set_axis_settings(inputaxis_data*, const char* name, axis_config* settings); input* create_inputaxis(); inputaxis_data* delete_inputaxis(input*); #endif /* INPUT_AXIS_H */
#ifndef INPUT_AXIS_H #define INPUT_AXIS_H #include "../services.h" #include <stdbool.h> typedef struct { bool invert; bool enabled; /* Deadzone */ double negative_deadzone; double positive_deadzone; /* Max/min */ double negative_maximum; double positive_maximum; } axis_config; typedef struct { const char* name; double value; axis_config* settings; } inputaxis; typedef struct { size_t num_inputaxes; inputaxis* axes; } inputaxis_data; const axis_config* default_settings(); double get_input_for_axis(void*, const char*); int update_axis_value(inputaxis_data*, const char* name, double val); void reset_axis_values(inputaxis_data* d); int create_axis(inputaxis_data*, const char* name, axis_config*); int delete_axis(inputaxis_data*, const char* name, axis_config**); axis_config* get_axis_settings(inputaxis_data*, const char* name); int set_axis_settings(inputaxis_data*, const char* name, axis_config* settings); input* create_inputaxis(); inputaxis_data* delete_inputaxis(input*); #endif /* INPUT_AXIS_H */
Add new function to header
Add new function to header
C
mit
n00bDooD/geng,n00bDooD/geng,n00bDooD/geng
ebb41c4ea260ab9905c7697648e2d1bb4b3914c8
client.c
client.c
#include <stdio.h> #include <sys/socket.h> #include <netdb.h> #include <string.h> #include <unistd.h> int main(int argc, char *argv[]) { char *host = "127.0.0.1"; int port = 2000; int timeout = 2; int sockfd, n; char buffer[256]; struct sockaddr_in serv_addr; struct hostent *server; struct timeval tv; tv.tv_sec = timeout; server = gethostbyname(host); bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); serv_addr.sin_family = AF_INET; sockfd = socket(AF_INET, SOCK_STREAM, 0); setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(struct timeval)); setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(struct timeval)); connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)); n = read(sockfd, buffer, 255); if (n < 0) { perror("error reading from socket"); return 1; } printf("%s\n", buffer); return 0; }
#include <stdio.h> #include <sys/socket.h> #include <netdb.h> #include <string.h> #include <unistd.h> int main(int argc, char *argv[]) { char *host = "127.0.0.1"; int port = 2000; int timeout = 2; int sockfd, n; char buffer[256]; struct sockaddr_in serv_addr; struct hostent *server; struct timeval tv; tv.tv_sec = timeout; tv.tv_usec = 0; server = gethostbyname(host); bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(port); serv_addr.sin_family = AF_INET; sockfd = socket(AF_INET, SOCK_STREAM, 0); setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(struct timeval)); setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(struct timeval)); connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)); n = read(sockfd, buffer, 255); if (n < 0) { perror("error reading from socket"); return 1; } printf("%s\n", buffer); return 0; }
Fix for Ubuntu 14.04, CentOS should work too
Fix for Ubuntu 14.04, CentOS should work too Assign zero to tv.tv_usec, or it maybe any value. The c version tiemout works on Ubuntu 14.04 after my fix.
C
mit
moret/socket-read-timeout,moret/socket-read-timeout
43a917f2aefddfde5c9292fa2fa2267e3fd9751e
common.h
common.h
#pragma once #define pi (3.14159265358979323846) #define abort_on_error(where, error) ({ \ typeof(where) _where = where; \ typeof(error) _error = error; \ \ if(_error) { \ fprintf( \ stderr, \ __FILE__ ":%d: %s error (%#x).\n", \ __LINE__, \ _where, \ _error \ ); \ } \ })
#pragma once #include <stdlib.h> #define pi (3.14159265358979323846) #define abort_on_error(where, error) ({ \ typeof(where) _where = where; \ typeof(error) _error = error; \ \ if(_error) { \ fprintf( \ stderr, \ __FILE__ ":%d: %s error (%#x).\n", \ __LINE__, \ _where, \ _error \ ); \ \ exit(-1); \ } \ })
Fix abort_on_error: Don't forget to exit(-1).
Fix abort_on_error: Don't forget to exit(-1).
C
agpl-3.0
sonetto/lloyd,sonetto/lloyd
ad6cd72787fdee1d56e5589c9bc07df4f5e8b4d8
clangd/FSProvider.h
clangd/FSProvider.h
//===--- FSProvider.h - VFS provider for ClangdServer ------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_FSPROVIDER_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_FSPROVIDER_H #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/Support/VirtualFileSystem.h" namespace clang { namespace clangd { // Wrapper for vfs::FileSystem for use in multithreaded programs like clangd. // As FileSystem is not threadsafe, concurrent threads must each obtain one. class FileSystemProvider { public: virtual ~FileSystemProvider() = default; /// Called by ClangdServer to obtain a vfs::FileSystem to be used for parsing. /// Context::current() will be the context passed to the clang entrypoint, /// such as addDocument(), and will also be propagated to result callbacks. /// Embedders may use this to isolate filesystem accesses. virtual IntrusiveRefCntPtr<llvm::vfs::FileSystem> getFileSystem() const = 0; }; class RealFileSystemProvider : public FileSystemProvider { public: // FIXME: returns the single real FS instance, which is not threadsafe. IntrusiveRefCntPtr<llvm::vfs::FileSystem> getFileSystem() const override { return llvm::vfs::getRealFileSystem(); } }; } // namespace clangd } // namespace clang #endif
//===--- FSProvider.h - VFS provider for ClangdServer ------------*- C++-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_FSPROVIDER_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_FSPROVIDER_H #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/Support/VirtualFileSystem.h" namespace clang { namespace clangd { // Wrapper for vfs::FileSystem for use in multithreaded programs like clangd. // As FileSystem is not threadsafe, concurrent threads must each obtain one. class FileSystemProvider { public: virtual ~FileSystemProvider() = default; /// Called by ClangdServer to obtain a vfs::FileSystem to be used for parsing. /// Context::current() will be the context passed to the clang entrypoint, /// such as addDocument(), and will also be propagated to result callbacks. /// Embedders may use this to isolate filesystem accesses. virtual llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> getFileSystem() const = 0; }; class RealFileSystemProvider : public FileSystemProvider { public: // FIXME: returns the single real FS instance, which is not threadsafe. llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> getFileSystem() const override { return llvm::vfs::getRealFileSystem(); } }; } // namespace clangd } // namespace clang #endif
Fix the qualification of `IntrusiveRefCntPtr` to use `llvm::`.
Fix the qualification of `IntrusiveRefCntPtr` to use `llvm::`. Without this, the code only compiled if the header was included after something introduced the alias from `clang::` to `llvm::` for this type. Any modules build would fail here. git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@344225 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra,llvm-mirror/clang-tools-extra
bd2d4478e5228b3a9c67e7b36ce018afb400ff7d
ionAsset/IUniform.h
ionAsset/IUniform.h
#pragma once #include <ionGL.h> typedef ion::GL::Uniform IUniform; template <typename T> using CUniformValue = ion::GL::UniformValue<T>; template <typename T> using CUniformReference = ion::GL::UniformReference<T>;
#pragma once #include <ionGL.h> typedef ion::GL::Uniform IUniform; template <typename T> using CUniformValue = ion::GL::UniformValue<T>; template <typename T> using CUniformReference = ion::GL::UniformReference<T>; typedef ion::GL::VertexBuffer CVertexBuffer; typedef ion::GL::IndexBuffer CIndexBuffer;
Add typedefs for VertexBuffer, IndexBuffer in GL
Add typedefs for VertexBuffer, IndexBuffer in GL
C
mit
iondune/ionEngine,iondune/ionEngine
fe229791e558fe9156e74d5e0ef3679c1a99fb13
includes/iloglistener.h
includes/iloglistener.h
// Copyright 2016 Airtame #ifndef MANAGEDEVICE_LOGGING_ILOGLISTENER_H_ #define MANAGEDEVICE_LOGGING_ILOGLISTENER_H_ #include <string> // Forward declarations. enum class ELogLevel; class ILogListener { public: virtual ~ILogListener() {} virtual void Notify(const std::string& iLog, ELogLevel iLevel) = 0; }; #endif // MANAGEDEVICE_LOGGING_ILOGLISTENER_H_
// Copyright 2016 Pierre Fourgeaud #ifndef PF_ILOGLISTENER_H_ #define PF_ILOGLISTENER_H_ #include <string> // Forward declarations. enum class ELogLevel; /** * @brief The ILogListener class * * Define an interface to implement when creating a new LogListener. * SimpleLogger provide 3 default listeners: Buffer, File, Console. * * Implement this class if you want to create your own listener. */ class ILogListener { public: /** * Virtual destructor. */ virtual ~ILogListener() {} /** * Pure virtual method to implement when implementing this interface. * Method called when getting notified. * * @params iLog The string representing the messag to log * @params iLevel Log level of this message */ virtual void Notify(const std::string& iLog, ELogLevel iLevel) = 0; }; #endif // PF_ILOGLISTENER_H_
Update ILogListener interface with docs
Update ILogListener interface with docs
C
mit
pierrefourgeaud/SimpleLogger
21c61e46afee3db7179afdb54eb43461d2e7e90b
Runtime/Rendering/ConstantBufferDX11.h
Runtime/Rendering/ConstantBufferDX11.h
#pragma once #include "Rendering/BufferDX11.h" #include "Rendering/ShaderDX11.h" namespace Mile { class MEAPI ConstantBufferDX11 : public BufferDX11 { public: ConstantBufferDX11(RendererDX11* renderer); ~ConstantBufferDX11(); bool Init(unsigned int size); virtual ERenderResourceType GetResourceType() const override { return ERenderResourceType::ConstantBuffer; } virtual void* Map(ID3D11DeviceContext& deviceContext) override; virtual bool UnMap(ID3D11DeviceContext& deviceContext) override; bool Bind(ID3D11DeviceContext& deviceContext, unsigned int slot, EShaderType shaderType); void Unbind(ID3D11DeviceContext& deviceContext); FORCEINLINE bool IsBound() const { return m_bIsBound; } FORCEINLINE unsigned int GetBoundSlot() const { return m_boundSlot; } FORCEINLINE EShaderType GetBoundShaderType() const { return m_boundShader; } private: bool m_bIsBound; unsigned int m_boundSlot; EShaderType m_boundShader; }; }
#pragma once #include "Rendering/BufferDX11.h" #include "Rendering/ShaderDX11.h" namespace Mile { class MEAPI ConstantBufferDX11 : public BufferDX11 { public: ConstantBufferDX11(RendererDX11* renderer); ~ConstantBufferDX11(); bool Init(unsigned int size); template <typename Buffer> bool Init() { return Init(sizeof(Buffer)); } virtual ERenderResourceType GetResourceType() const override { return ERenderResourceType::ConstantBuffer; } virtual void* Map(ID3D11DeviceContext& deviceContext) override; virtual bool UnMap(ID3D11DeviceContext& deviceContext) override; bool Bind(ID3D11DeviceContext& deviceContext, unsigned int slot, EShaderType shaderType); void Unbind(ID3D11DeviceContext& deviceContext); FORCEINLINE bool IsBound() const { return m_bIsBound; } FORCEINLINE unsigned int GetBoundSlot() const { return m_boundSlot; } FORCEINLINE EShaderType GetBoundShaderType() const { return m_boundShader; } private: bool m_bIsBound; unsigned int m_boundSlot; EShaderType m_boundShader; }; }
Add template Init method for ConstantBuffer
Add template Init method for ConstantBuffer
C
mit
HoRangDev/MileEngine,HoRangDev/MileEngine
3502deee1a93e86a97fb22df1cdb512c5a643dd6
test/PCH/functions.c
test/PCH/functions.c
// Test this without pch. // RUN: clang-cc -include %S/functions.h -fsyntax-only -verify %s && // Test with pch. // RUN: clang-cc -emit-pch -o %t %S/functions.h && // RUN: clang-cc -include-pch %t -fsyntax-only -verify %s int f0(int x0, int y0, ...) { return x0 + y0; } float *test_f1(int val, double x, double y) { if (val > 5) return f1(x, y); else return f1(x); // expected-error{{too few arguments to function call}} return 0; } void test_g0(int *x, float * y) { g0(y); // expected-warning{{incompatible pointer types passing 'float *', expected 'int *'}} g0(x); }
// Test this without pch. // RUN: clang-cc -include %S/functions.h -fsyntax-only -verify %s && // Test with pch. // RUN: clang-cc -emit-pch -o %t %S/functions.h && // RUN: clang-cc -include-pch %t -fsyntax-only -verify %s int f0(int x0, int y0, ...) { return x0 + y0; } float *test_f1(int val, double x, double y) { if (val > 5) return f1(x, y); else return f1(x); // expected-error{{too few arguments to function call}} } void test_g0(int *x, float * y) { g0(y); // expected-warning{{incompatible pointer types passing 'float *', expected 'int *'}} g0(x); }
Revert this, we can now avoid error cascades better.
Revert this, we can now avoid error cascades better. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@76691 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
3d8ad86be25865eee842ca5e683ac3f525dc8783
config/config_kmalloc.h
config/config_kmalloc.h
/* SPDX-License-Identifier: BSD-2-Clause */ /* * This is a TEMPLATE. The actual config file is generated by CMake and stored * in <BUILD_DIR>/tilck_gen_headers/. */ #pragma once #include <tilck_gen_headers/config_global.h> /* --------- Boolean config variables --------- */ #cmakedefine01 KMALLOC_FREE_MEM_POISONING #cmakedefine01 KMALLOC_HEAVY_STATS #cmakedefine01 KMALLOC_SUPPORT_DEBUG_LOG #cmakedefine01 KMALLOC_SUPPORT_LEAK_DETECTOR /* * -------------------------------------------------------------------------- * Hard-coded global & derived constants * -------------------------------------------------------------------------- * * Here below there are many dervied constants and convenience constants like * COMPILER_NAME along with some pseudo-constants like USERMODE_VADDR_END not * designed to be easily changed because of the code makes assumptions about * them. Because of that, those constants are hard-coded and not available as * CMake variables. With time, some of those constants get "promoted" and moved * in CMake, others remain here. See the comments and think about the potential * implications before promoting a hard-coded constant to a configurable CMake * variable. */ #if !KERNEL_GCOV #define KMALLOC_FIRST_HEAP_SIZE ( 128 * KB) #else #define KMALLOC_FIRST_HEAP_SIZE ( 512 * KB) #endif
/* SPDX-License-Identifier: BSD-2-Clause */ /* * This is a TEMPLATE. The actual config file is generated by CMake and stored * in <BUILD_DIR>/tilck_gen_headers/. */ #pragma once #include <tilck_gen_headers/config_global.h> /* --------- Boolean config variables --------- */ #cmakedefine01 KMALLOC_FREE_MEM_POISONING #cmakedefine01 KMALLOC_HEAVY_STATS #cmakedefine01 KMALLOC_SUPPORT_DEBUG_LOG #cmakedefine01 KMALLOC_SUPPORT_LEAK_DETECTOR /* * -------------------------------------------------------------------------- * Hard-coded global & derived constants * -------------------------------------------------------------------------- * * Here below there are many dervied constants and convenience constants like * COMPILER_NAME along with some pseudo-constants like USERMODE_VADDR_END not * designed to be easily changed because of the code makes assumptions about * them. Because of that, those constants are hard-coded and not available as * CMake variables. With time, some of those constants get "promoted" and moved * in CMake, others remain here. See the comments and think about the potential * implications before promoting a hard-coded constant to a configurable CMake * variable. */ #if KERNEL_MAX_SIZE <= 1024 * KB #define KMALLOC_FIRST_HEAP_SIZE ( 128 * KB) #else #define KMALLOC_FIRST_HEAP_SIZE ( 512 * KB) #endif
Make KMALLOC_FIRST_HEAP_SIZE depend on KERNEL_MAX_SIZE
[config] Make KMALLOC_FIRST_HEAP_SIZE depend on KERNEL_MAX_SIZE
C
bsd-2-clause
vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs
bfcf057787d6ce78c503ce8f7773ea316eae0b13
src/rtmixer.h
src/rtmixer.h
// actions: // // * read from queue // * read from array // * write to queue // * write to array // * stop action (with and/or without time?) // * query xrun stats etc. // timestamp! start, duration (number of samples? unlimited?) // return values: actual start, actual duration (number of samples?) // queue usage: store smallest available write/read size // xruns during the runtime of the current action // // if queue is empty/full, stop playback/recording enum actiontype { PLAY_BUFFER, PLAY_RINGBUFFER, RECORD_BUFFER, RECORD_RINGBUFFER, }; struct action { enum actiontype actiontype; struct action* next; union { float* buffer; PaUtilRingBuffer* ringbuffer; }; unsigned long total_frames; unsigned long done_frames; // TODO: channel mapping (pointer to list of channels + length) // TODO: something to store the result of the action? }; struct state { int input_channels; int output_channels; PaUtilRingBuffer* action_q; // Queue for incoming commands PaUtilRingBuffer* result_q; // Queue for results and command disposal struct action* actions; // Singly linked list of actions }; int callback(const void* input, void* output, unsigned long frames , const PaStreamCallbackTimeInfo* time, PaStreamCallbackFlags status , void* userdata);
// actions: // // * read from queue // * read from array // * write to queue // * write to array // * stop action (with and/or without time?) // * query xrun stats etc. // timestamp! start, duration (number of samples? unlimited?) // return values: actual start, actual duration (number of samples?) // queue usage: store smallest available write/read size // xruns during the runtime of the current action // // if queue is empty/full, stop playback/recording enum actiontype { PLAY_BUFFER, PLAY_RINGBUFFER, RECORD_BUFFER, RECORD_RINGBUFFER, }; struct action { const enum actiontype actiontype; struct action* next; union { float* const buffer; PaUtilRingBuffer* const ringbuffer; }; const unsigned long total_frames; unsigned long done_frames; // TODO: channel mapping (pointer to list of channels + length) // TODO: something to store the result of the action? }; struct state { const int input_channels; const int output_channels; PaUtilRingBuffer* const action_q; // Queue for incoming commands PaUtilRingBuffer* const result_q; // Queue for results and command disposal struct action* actions; // Singly linked list of actions }; int callback(const void* input, void* output, unsigned long frames , const PaStreamCallbackTimeInfo* time, PaStreamCallbackFlags status , void* userdata);
Use const for struct members
Use const for struct members
C
mit
mgeier/python-rtmixer,mgeier/python-rtmixer
5986c9fde186378b26f7a5985c97102feba191e8
KTp/error-dictionary.h
KTp/error-dictionary.h
/* Telepathy error dictionary - usable strings for dbus messages Copyright (C) 2011 Martin Klapetek <martin.klapetek@gmail.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef ERROR_DICTIONARY_H #define ERROR_DICTIONARY_H #include <QString> #include <KTp/ktp-export.h> namespace KTp { namespace ErrorDictionary { ///Returns a verbose error message usable for displaying to the user KTP_EXPORT QString displayVerboseErrorMessage(const QString& dbusErrorName); ///Returns a short error message usable for little space KTP_EXPORT QString displayShortErrorMessage(const QString& dbusErrorName); } } #endif // ERROR_DICTIONARY_H
/* Telepathy error dictionary - usable strings for dbus messages Copyright (C) 2011 Martin Klapetek <martin.klapetek@gmail.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef ERROR_DICTIONARY_H #define ERROR_DICTIONARY_H #include <QString> #include <KTp/ktp-export.h> namespace KTp { /** * @short A method of turning error codes into human readable strings * */ namespace ErrorDictionary { /**Returns a verbose error message suitable for displaying to the user @param dbusErrorName The Telepathy error as specified in http://telepathy.freedesktop.org/spec/errors.html */ KTP_EXPORT QString displayVerboseErrorMessage(const QString& dbusErrorName); /**Returns a short error message suitable when there is little space @param dbusErrorName The Telepathy error as specified in http://telepathy.freedesktop.org/spec/errors.html */ KTP_EXPORT QString displayShortErrorMessage(const QString& dbusErrorName); } } #endif // ERROR_DICTIONARY_H
Add documentation to Error Dictionary class
Add documentation to Error Dictionary class Reviewed-by: Martin Klapetek
C
lgpl-2.1
KDE/ktp-common-internals,leonhandreke/ktp-common-internals,KDE/ktp-common-internals,KDE/ktp-common-internals,leonhandreke/ktp-common-internals,leonhandreke/ktp-common-internals
41ee615c0b08e43dc382bc15600f814ac02abf06
chip/stm32/usb-stm32f3.c
chip/stm32/usb-stm32f3.c
/* Copyright (c) 2014 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. * * STM32F3 Family specific USB functionality */ #include "usb-stm32f3.h" #include "usb_api.h" void usb_connect(void) { usb_board_connect(); } void usb_disconnect(void) { usb_board_connect(); }
/* Copyright (c) 2014 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. * * STM32F3 Family specific USB functionality */ #include "usb-stm32f3.h" #include "usb_api.h" void usb_connect(void) { usb_board_connect(); } void usb_disconnect(void) { usb_board_disconnect(); }
Fix cut and paste bug for board specific disconnection
USB: Fix cut and paste bug for board specific disconnection Signed-off-by: Anton Staaf <84531b4b964c017023781514a6665b71e84b32bc@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: I8ec4396370b7e3068d29d569b73fddc648e1f76f Reviewed-on: https://chromium-review.googlesource.com/247720 Trybot-Ready: Anton Staaf <84531b4b964c017023781514a6665b71e84b32bc@chromium.org> Tested-by: Anton Staaf <84531b4b964c017023781514a6665b71e84b32bc@chromium.org> Reviewed-by: Vic Yang <5fd92abeee651458f98e2856f4f200ee971cee4d@chromium.org> Commit-Queue: Anton Staaf <84531b4b964c017023781514a6665b71e84b32bc@chromium.org>
C
bsd-3-clause
akappy7/ChromeOS_EC_LED_Diagnostics,fourier49/BIZ_EC,fourier49/BIZ_EC,fourier49/BZ_DEV_EC,coreboot/chrome-ec,md5555/ec,md5555/ec,akappy7/ChromeOS_EC_LED_Diagnostics,eatbyte/chromium-ec,coreboot/chrome-ec,fourier49/BZ_DEV_EC,eatbyte/chromium-ec,fourier49/BZ_DEV_EC,coreboot/chrome-ec,eatbyte/chromium-ec,fourier49/BZ_DEV_EC,akappy7/ChromeOS_EC_LED_Diagnostics,coreboot/chrome-ec,coreboot/chrome-ec,akappy7/ChromeOS_EC_LED_Diagnostics,fourier49/BIZ_EC,md5555/ec,md5555/ec,fourier49/BIZ_EC,coreboot/chrome-ec,eatbyte/chromium-ec,akappy7/ChromeOS_EC_LED_Diagnostics
d07295d73267c51bf3d77b97831640db832bacb5
samples/libcurl/callbacks.h
samples/libcurl/callbacks.h
#include <stdio.h> // Those types are needed but not defined or used in libcurl headers. typedef size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata); typedef size_t write_data_callback(void *buffer, size_t size, size_t nmemb, void *userp); extern void something_using_callback1(header_callback*); extern void something_using_callback2(write_data_callback*);
#include <stddef.h> // Those types are needed but not defined or used in libcurl headers. typedef size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata); typedef size_t write_data_callback(void *buffer, size_t size, size_t nmemb, void *userp);
Remove some hacks from libcurl sample
Remove some hacks from libcurl sample
C
apache-2.0
JetBrains/kotlin-native,jiaminglu/kotlin-native,JuliusKunze/kotlin-native,wiltonlazary/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,jiaminglu/kotlin-native,JuliusKunze/kotlin-native,JuliusKunze/kotlin-native,JuliusKunze/kotlin-native,JetBrains/kotlin-native,JuliusKunze/kotlin-native,JetBrains/kotlin-native,jiaminglu/kotlin-native,jiaminglu/kotlin-native,JetBrains/kotlin-native,wiltonlazary/kotlin-native,jiaminglu/kotlin-native,JuliusKunze/kotlin-native,jiaminglu/kotlin-native,wiltonlazary/kotlin-native,wiltonlazary/kotlin-native,JuliusKunze/kotlin-native,JuliusKunze/kotlin-native,jiaminglu/kotlin-native,wiltonlazary/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,jiaminglu/kotlin-native
8a47f7478c3e73f916a13dd3d0b7cd1e140e21e7
src/lib/ecore/Ecore_Str.h
src/lib/ecore/Ecore_Str.h
#ifndef _ECORE_STR_H # define _ECORE_STR_H #ifdef EAPI #undef EAPI #endif #ifdef WIN32 # ifdef BUILDING_DLL # define EAPI __declspec(dllexport) # else # define EAPI __declspec(dllimport) # endif #else # ifdef __GNUC__ # if __GNUC__ >= 4 # define EAPI __attribute__ ((visibility("default"))) # else # define EAPI # endif # else # define EAPI # endif #endif /** * @file Ecore_Data.h * @brief Contains threading, list, hash, debugging and tree functions. */ # ifdef __cplusplus extern "C" { # endif # ifdef __sgi # define __FUNCTION__ "unknown" # ifndef __cplusplus # define inline # endif # endif /* strlcpy implementation for libc's lacking it */ EAPI size_t ecore_strlcpy(char *dst, const char *src, size_t siz); #ifdef __cplusplus } #endif #endif /* _ECORE_STR_H */
#ifndef _ECORE_STR_H # define _ECORE_STR_H #ifdef EAPI #undef EAPI #endif #ifdef WIN32 # ifdef BUILDING_DLL # define EAPI __declspec(dllexport) # else # define EAPI __declspec(dllimport) # endif #else # ifdef __GNUC__ # if __GNUC__ >= 4 # define EAPI __attribute__ ((visibility("default"))) # else # define EAPI # endif # else # define EAPI # endif #endif /** * @file Ecore_Str.h * @brief Contains useful C string functions. */ # ifdef __cplusplus extern "C" { # endif # ifdef __sgi # define __FUNCTION__ "unknown" # ifndef __cplusplus # define inline # endif # endif /* strlcpy implementation for libc's lacking it */ EAPI size_t ecore_strlcpy(char *dst, const char *src, size_t siz); #ifdef __cplusplus } #endif #endif /* _ECORE_STR_H */
Fix doxygen comments for new header.
Fix doxygen comments for new header. git-svn-id: 70cf712206e5b8426a8d7451e052914a94f8fa22@27891 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
C
mit
OpenInkpot-archive/ecore,OpenInkpot-archive/ecore,OpenInkpot-archive/ecore
00d1ca91bb5bb8530e9a9a3b9790ea8a4eec7305
core/gluonvarianttypes.h
core/gluonvarianttypes.h
/* <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> 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/>. */ ///TODO: Make this something entirely different... QVariant wrapped Eigen types, wooh! ;) #ifndef GLUON_VARIANTTYPES #define GLUON_VARIANTTYPES #include <QtCore/QVariant> #include <QtCore/QMetaType> #include <Eigen/Geometry> Q_DECLARE_METATYPE(Eigen::Vector3d) Q_DECLARE_METATYPE(Eigen::Vector3f) namespace { struct GluonVariantTypes { public: GluonVariantTypes() { qRegisterMetaType<Eigen::Vector3d>("Eigen::Vector3d"); qRegisterMetaType<Eigen::Vector3f>("Eigen::Vector3f"); } }; GluonVariantTypes gluonVariantTypes; } #endif
/* <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> 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/>. */ ///TODO: Make this something entirely different... QVariant wrapped Eigen types, wooh! ;) #ifndef GLUON_VARIANTTYPES #define GLUON_VARIANTTYPES #include <QtCore/QVariant> #include <QtCore/QMetaType> #include <Eigen/Geometry> Q_DECLARE_METATYPE(Eigen::Vector3d); Q_DECLARE_METATYPE(Eigen::Vector3f); Q_DECLARE_METATYPE(Eigen::Quaternionf); namespace { struct GluonVariantTypes { public: GluonVariantTypes() { qRegisterMetaType<Eigen::Vector3d>("Eigen::Vector3d"); qRegisterMetaType<Eigen::Vector3f>("Eigen::Vector3f"); qRegisterMetaType<Eigen::Quaternionf>("Eigen::Quaternionf"); } }; GluonVariantTypes gluonVariantTypes; } #endif
Add Quaternion to variant types, makes Q_PROPERTY support it
Add Quaternion to variant types, makes Q_PROPERTY support it
C
lgpl-2.1
cgaebel/gluon,KDE/gluon,cgaebel/gluon,pranavrc/example-gluon,cgaebel/gluon,pranavrc/example-gluon,pranavrc/example-gluon,cgaebel/gluon,KDE/gluon,pranavrc/example-gluon,KDE/gluon,KDE/gluon
a62eaa2f7447d930db84f966986736d30ef522bb
src/block/serpent/serpent.h
src/block/serpent/serpent.h
/* * Serpent * (C) 1999-2007 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_SERPENT_H__ #define BOTAN_SERPENT_H__ #include <botan/block_cipher.h> namespace Botan { /** * Serpent, an AES finalist */ class BOTAN_DLL Serpent : public BlockCipher { public: void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; void clear() { round_key.clear(); } std::string name() const { return "Serpent"; } BlockCipher* clone() const { return new Serpent; } Serpent() : BlockCipher(16, 16, 32, 8) {} protected: void key_schedule(const byte key[], u32bit length); SecureVector<u32bit, 132> round_key; }; } #endif
/* * Serpent * (C) 1999-2007 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_SERPENT_H__ #define BOTAN_SERPENT_H__ #include <botan/block_cipher.h> namespace Botan { /** * Serpent, an AES finalist */ class BOTAN_DLL Serpent : public BlockCipher { public: void encrypt_n(const byte in[], byte out[], u32bit blocks) const; void decrypt_n(const byte in[], byte out[], u32bit blocks) const; void clear() { round_key.clear(); } std::string name() const { return "Serpent"; } BlockCipher* clone() const { return new Serpent; } Serpent() : BlockCipher(16, 16, 32, 8) {} protected: /** * For use by subclasses using SIMD, asm, etc * @return const reference to the key schedule */ const SecureVector<u32bit, 132>& get_round_keys() const { return round_key; } /** * For use by subclasses that implement the key schedule * @param ks is the new key schedule value to set */ void set_round_keys(const u32bit ks[132]) { round_key.set(ks, 132); } private: void key_schedule(const byte key[], u32bit length); SecureVector<u32bit, 132> round_key; }; } #endif
Make Serpent's key_schedule and actual round keys private. Add protected accessor functions for get and set. Set is needed by the x86 version since it implements the key schedule directly.
Make Serpent's key_schedule and actual round keys private. Add protected accessor functions for get and set. Set is needed by the x86 version since it implements the key schedule directly.
C
bsd-2-clause
randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,randombit/botan
edd722e38b883236c9f214d5df309110500b3529
test/Sema/attr-noreturn.c
test/Sema/attr-noreturn.c
// RUN: clang-cc -verify -fsyntax-only %s static void (*fp0)(void) __attribute__((noreturn)); static void __attribute__((noreturn)) f0(void) { fatal(); } // expected-warning {{function declared 'noreturn' should not return}} // On K&R int f1() __attribute__((noreturn)); int g0 __attribute__((noreturn)); // expected-warning {{'noreturn' attribute only applies to function types}} int f2() __attribute__((noreturn(1, 2))); // expected-error {{attribute requires 0 argument(s)}} void f3() __attribute__((noreturn)); void f3() { return; // expected-warning {{function 'f3' declared 'noreturn' should not return}} } #pragma clang diagnostic error "-Winvalid-noreturn" void f4() __attribute__((noreturn)); void f4() { return; // expected-error {{function 'f4' declared 'noreturn' should not return}} } // PR4685 extern void f5 (unsigned long) __attribute__ ((__noreturn__)); void f5 (unsigned long size) { }
// RUN: clang -cc1 -verify -fsyntax-only %s static void (*fp0)(void) __attribute__((noreturn)); static void __attribute__((noreturn)) f0(void) { fatal(); } // expected-warning {{function declared 'noreturn' should not return}} // On K&R int f1() __attribute__((noreturn)); int g0 __attribute__((noreturn)); // expected-warning {{'noreturn' attribute only applies to function types}} int f2() __attribute__((noreturn(1, 2))); // expected-error {{attribute requires 0 argument(s)}} void f3() __attribute__((noreturn)); void f3() { return; // expected-warning {{function 'f3' declared 'noreturn' should not return}} } #pragma clang diagnostic error "-Winvalid-noreturn" void f4() __attribute__((noreturn)); void f4() { return; // expected-error {{function 'f4' declared 'noreturn' should not return}} } // PR4685 extern void f5 (unsigned long) __attribute__ ((__noreturn__)); void f5 (unsigned long size) { } // PR2461 __attribute__((noreturn)) void f(__attribute__((noreturn)) void (*x)(void)) { x(); }
Add testcase for recent checkin.
Add testcase for recent checkin. Patch by Chip Davis. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@91436 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
1cdd41d0d2ab5e112d347ec5f14383b5f5ba6034
kmer_util.h
kmer_util.h
#ifndef KMER_UTIL_H #define KMER_UTIL_H #include <assert.h> #include "logging_util.h" // Largest odd kmer that can be held in a uint64_t #define MAX_KMER 31 #define DEFAULT_KMER 21 #ifndef num2nuc # ifndef NUM2NUC_STR # define NUM2NUC_STR "ACGTN" # endif # define num2nuc(x) NUM2NUC_STR[(uint8_t)x] #endif #ifdef __cplusplus namespace dlib { #endif inline void kmer2cstr(uint64_t kmer, int k, char *buf) { buf[k] = '\0'; while(k) *buf++ = num2nuc((kmer >> (2 * --k)) & 0x3u); //LOG_DEBUG("kmer %lu has now become string '%s'.\n", kmer, start); } #ifdef __cplusplus } #endif #endif
#ifndef KMER_UTIL_H #define KMER_UTIL_H #include <assert.h> #include "logging_util.h" // Largest odd kmer that can be held in a uint64_t #define MAX_KMER 31 #define DEFAULT_KMER 21 #ifndef num2nuc # ifndef NUM2NUC_STR # define NUM2NUC_STR "ACGTN" # endif # define num2nuc(x) NUM2NUC_STR[(uint8_t)x] #endif #ifdef __cplusplus namespace dlib { #endif inline void kmer2cstr(uint64_t kmer, int k, char *buf) { buf[k] = '\0'; while(k) *buf++ = num2nuc((kmer >> (2 * --k)) & 0x3u); //LOG_DEBUG("kmer %lu has now become string '%s'.\n", kmer, start); } // Used to determine the direction in which to encode a kmer inline int cstr_rc_lt(char *seq, int k, int cpos) { char *_seq1 = cpos + seq, *_seq2 = _seq1 + k - 1; for(;k;--k) { if(*_seq1 != nuc_cmpl(*_seq2)) return *_seq1 < nuc_cmpl(*_seq2); ++_seq1, --_seq2; } return 0; // This is reverse-complementarily palindromic. Doesn't matter: it's the same string. } #ifdef __cplusplus } #endif #endif
Move kmer functionality from kmei to dlib.
Move kmer functionality from kmei to dlib.
C
mit
noseatbelts/dlib,noseatbelts/dlib
0fa6366ed15f48b3ec227987f21f339180fb4936
webrtc/base/checks.h
webrtc/base/checks.h
/* * Copyright 2006 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ // This module contains some basic debugging facilities. // Originally comes from shared/commandlineflags/checks.h #ifndef WEBRTC_BASE_CHECKS_H_ #define WEBRTC_BASE_CHECKS_H_ namespace rtc { // Prints an error message to stderr and aborts execution. void Fatal(const char* file, int line, const char* format, ...); } // namespace rtc // The UNREACHABLE macro is very useful during development. #define UNREACHABLE() \ rtc::Fatal(__FILE__, __LINE__, "unreachable code") #endif // WEBRTC_BASE_CHECKS_H_
/* * Copyright 2006 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ // This module contains some basic debugging facilities. // Originally comes from shared/commandlineflags/checks.h #ifndef WEBRTC_BASE_CHECKS_H_ #define WEBRTC_BASE_CHECKS_H_ namespace rtc { // Prints an error message to stderr and aborts execution. void Fatal(const char* file, int line, const char* format, ...); } // namespace rtc // Trigger a fatal error (which aborts the process and prints an error // message). FATAL_ERROR_IF may seem a lot like assert, but there's a crucial // difference: it's always "on". This means that it can be used to check for // regular errors that could actually happen, not just programming errors that // supposedly can't happen---but triggering a fatal error will kill the process // in an ugly way, so it's not suitable for catching errors that might happen // in production. #define FATAL_ERROR(msg) do { rtc::Fatal(__FILE__, __LINE__, msg); } while (0) #define FATAL_ERROR_IF(x) do { if (x) FATAL_ERROR("check failed"); } while (0) // The UNREACHABLE macro is very useful during development. #define UNREACHABLE() FATAL_ERROR("unreachable code") #endif // WEBRTC_BASE_CHECKS_H_
Define convenient FATAL_ERROR() and FATAL_ERROR_IF() macros
Define convenient FATAL_ERROR() and FATAL_ERROR_IF() macros R=henrike@webrtc.org Review URL: https://webrtc-codereview.appspot.com/16079004 git-svn-id: 917f5d3ca488f358c4d40eaec14422cf392ccec9@6701 4adac7df-926f-26a2-2b94-8c16560cd09d
C
bsd-3-clause
mwgoldsmith/ilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,mwgoldsmith/ilbc,TimothyGu/libilbc,mwgoldsmith/libilbc,ShiftMediaProject/libilbc,mwgoldsmith/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,mwgoldsmith/ilbc,TimothyGu/libilbc,mwgoldsmith/libilbc,mwgoldsmith/ilbc,mwgoldsmith/libilbc,ShiftMediaProject/libilbc
b2982d63745aa6222ca3ef00d1042b874ba50307
evmjit/libevmjit/Utils.h
evmjit/libevmjit/Utils.h
#pragma once #include <iostream> // The same as assert, but expression is always evaluated and result returned #define CHECK(expr) (assert(expr), expr) #if !defined(NDEBUG) // Debug namespace dev { namespace evmjit { std::ostream& getLogStream(char const* _channel); } } #define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL) #else // Release #define DLOG(CHANNEL) true ? std::cerr : std::cerr #endif
#pragma once #include <iostream> // The same as assert, but expression is always evaluated and result returned #define CHECK(expr) (assert(expr), expr) #if !defined(NDEBUG) // Debug namespace dev { namespace evmjit { std::ostream& getLogStream(char const* _channel); } } #define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL) #else // Release namespace dev { namespace evmjit { struct Voider { void operator=(std::ostream const&) {} }; } } #define DLOG(CHANNEL) true ? (void)0 : ::dev::evmjit::Voider{} = std::cerr #endif
Reimplement no-op version of DLOG to avoid C++ compiler warning
Reimplement no-op version of DLOG to avoid C++ compiler warning
C
mit
vaporry/cpp-ethereum,karek314/cpp-ethereum,expanse-project/cpp-expanse,programonauta/webthree-umbrella,expanse-org/cpp-expanse,PaulGrey30/go-get--u-github.com-tools-godep,vaporry/cpp-ethereum,joeldo/cpp-ethereum,LefterisJP/cpp-ethereum,d-das/cpp-ethereum,smartbitcoin/cpp-ethereum,d-das/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,gluk256/cpp-ethereum,xeddmc/cpp-ethereum,joeldo/cpp-ethereum,d-das/cpp-ethereum,johnpeter66/ethminer,yann300/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,anthony-cros/cpp-ethereum,smartbitcoin/cpp-ethereum,ethers/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,johnpeter66/ethminer,eco/cpp-ethereum,ethers/cpp-ethereum,ethers/cpp-ethereum,anthony-cros/cpp-ethereum,eco/cpp-ethereum,anthony-cros/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,LefterisJP/cpp-ethereum,joeldo/cpp-ethereum,anthony-cros/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,xeddmc/cpp-ethereum,yann300/cpp-ethereum,karek314/cpp-ethereum,vaporry/webthree-umbrella,PaulGrey30/go-get--u-github.com-tools-godep,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,subtly/cpp-ethereum-micro,LefterisJP/cpp-ethereum,gluk256/cpp-ethereum,expanse-org/cpp-expanse,LefterisJP/cpp-ethereum,expanse-project/cpp-expanse,gluk256/cpp-ethereum,anthony-cros/cpp-ethereum,karek314/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,expanse-org/cpp-expanse,expanse-org/cpp-expanse,karek314/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,joeldo/cpp-ethereum,karek314/cpp-ethereum,smartbitcoin/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,eco/cpp-ethereum,expanse-org/cpp-expanse,eco/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,subtly/cpp-ethereum-micro,expanse-project/cpp-expanse,smartbitcoin/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,ethers/cpp-ethereum,expanse-project/cpp-expanse,ethers/cpp-ethereum,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,subtly/cpp-ethereum-micro,expanse-project/cpp-expanse,subtly/cpp-ethereum-micro,vaporry/cpp-ethereum,d-das/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,eco/cpp-ethereum,yann300/cpp-ethereum,yann300/cpp-ethereum,PaulGrey30/go-get--u-github.com-tools-godep,programonauta/webthree-umbrella,gluk256/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,xeddmc/cpp-ethereum,yann300/cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,gluk256/cpp-ethereum,eco/cpp-ethereum,Sorceror32/go-get--u-github.com-tools-godep,expanse-project/cpp-expanse,d-das/cpp-ethereum,gluk256/cpp-ethereum,d-das/cpp-ethereum,xeddmc/cpp-ethereum,joeldo/cpp-ethereum,xeddmc/cpp-ethereum,LefterisJP/webthree-umbrella,expanse-org/cpp-expanse,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,chfast/webthree-umbrella,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,Sorceror32/.-git-clone-https-github.com-ethereum-cpp-ethereum,vaporry/cpp-ethereum,anthony-cros/cpp-ethereum,johnpeter66/ethminer,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,xeddmc/cpp-ethereum,smartbitcoin/cpp-ethereum,subtly/cpp-ethereum-micro,PaulGrey30/.-git-clone-https-github.com-ethereum-cpp-ethereum,ethers/cpp-ethereum,LefterisJP/cpp-ethereum,yann300/cpp-ethereum,vaporry/cpp-ethereum,karek314/cpp-ethereum,joeldo/cpp-ethereum,subtly/cpp-ethereum-micro,vaporry/cpp-ethereum,LefterisJP/webthree-umbrella,arkpar/webthree-umbrella,smartbitcoin/cpp-ethereum,LefterisJP/cpp-ethereum
b56013dda5371aa32a634bc59878f754b537f874
test/CFrontend/2004-03-07-BitfieldCrash.c
test/CFrontend/2004-03-07-BitfieldCrash.c
// RUN: %llvmgcc -S %s -o /dev/null /* * XFAIL: linux */ struct s { unsigned long long u33: 33; unsigned long long u40: 40; }; struct s a = { 1, 2}; int foo() { return a.u40; }
// RUN: %llvmgcc -S %s -o /dev/null /* * XFAIL: * */ struct s { unsigned long long u33: 33; unsigned long long u40: 40; }; struct s a = { 1, 2}; int foo() { return a.u40; }
Test fails on all platforms, not just linux
Test fails on all platforms, not just linux git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@19405 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm
2dd927c6610bb09ec315409d2973ed505f5e4cc7
lib/ReaderWriter/PECOFF/PDBPass.h
lib/ReaderWriter/PECOFF/PDBPass.h
//===- lib/ReaderWriter/PECOFF/PDBPass.h ----------------------------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_READER_WRITER_PE_COFF_PDB_PASS_H #define LLD_READER_WRITER_PE_COFF_PDB_PASS_H #include "lld/Core/Pass.h" #include "llvm/ADT/StringRef.h" #if !defined(_MSC_VER) && !defined(__MINGW32__) #include <unistd.h> #else #include <io.h> #endif namespace lld { namespace pecoff { class PDBPass : public lld::Pass { public: PDBPass(PECOFFLinkingContext &ctx) : _ctx(ctx) {} void perform(std::unique_ptr<MutableFile> &file) override { if (_ctx.getDebug()) touch(_ctx.getPDBFilePath()); } private: void touch(StringRef path) { int fd; if (llvm::sys::fs::openFileForWrite(path, fd, llvm::sys::fs::F_Append)) llvm::report_fatal_error("failed to create a PDB file"); ::close(fd); } PECOFFLinkingContext &_ctx; }; } // namespace pecoff } // namespace lld #endif
//===- lib/ReaderWriter/PECOFF/PDBPass.h ----------------------------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_READER_WRITER_PE_COFF_PDB_PASS_H #define LLD_READER_WRITER_PE_COFF_PDB_PASS_H #include "lld/Core/Pass.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Process.h" namespace lld { namespace pecoff { class PDBPass : public lld::Pass { public: PDBPass(PECOFFLinkingContext &ctx) : _ctx(ctx) {} void perform(std::unique_ptr<MutableFile> &file) override { if (_ctx.getDebug()) touch(_ctx.getPDBFilePath()); } private: void touch(StringRef path) { int fd; if (llvm::sys::fs::openFileForWrite(path, fd, llvm::sys::fs::F_Append)) llvm::report_fatal_error("failed to create a PDB file"); llvm::sys::Process::SafelyCloseFileDescriptor(fd); } PECOFFLinkingContext &_ctx; }; } // namespace pecoff } // namespace lld #endif
Use SafelyCloseFileDescriptor instead of close.
Use SafelyCloseFileDescriptor instead of close. Opening a file using openFileForWrite and closing it using close was asymmetric. It also had a subtle portability problem (details are described in the commit message for r219189). git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@222802 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/lld,llvm-mirror/lld
c03ed8c4aa935e2490178b52fbaa73675137f626
tests/amd64/wait4_WNOHANG/wait4_WNOHANG.c
tests/amd64/wait4_WNOHANG/wait4_WNOHANG.c
static int parent_main(pid_t child_pid) { pid_t pid; int status; pid = wait4(child_pid, &status, WNOHANG, NULL); if (pid != 0) return (1); return (0); } static void signal_handler(int sig) { } int main(int argc, const char *argv[]) { struct sigaction act; struct timespec t; pid_t child_pid; int retval; act.sa_handler = signal_handler; act.sa_flags = 0; if (sigfillset(&act.sa_mask) == -1) return (16); if (sigaction(SIGTERM, &act, NULL) == -1) return (17); child_pid = fork(); switch (child_pid) { case -1: return (18); case 0: t.tv_sec = 8; t.tv_nsec = 0; nanosleep(&t, NULL); return (0); default: break; } retval = parent_main(child_pid); kill(child_pid, SIGTERM); return (retval); }
static int parent_main(pid_t child_pid) { pid_t pid; int status; pid = wait4(child_pid, &status, WNOHANG, NULL); if (pid != 0) return (1); return (0); } int main(int argc, const char *argv[]) { pid_t child_pid; int retval; child_pid = fork(); switch (child_pid) { case -1: return (18); case 0: for (;;) ; return (0); default: break; } retval = parent_main(child_pid); kill(child_pid, SIGKILL); return (retval); }
Simplify the test for wait4(2) with WNOHANG.
Simplify the test for wait4(2) with WNOHANG.
C
mit
SumiTomohiko/fsyscall2,SumiTomohiko/fsyscall2,SumiTomohiko/fsyscall2,SumiTomohiko/fsyscall2,SumiTomohiko/fsyscall2
a78e1809fe4e6276c50d192e1bb5dc94ac84f626
3RVX/Controllers/Volume/VolumeController.h
3RVX/Controllers/Volume/VolumeController.h
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once class VolumeTransformation; class VolumeController { public: struct DeviceInfo { std::wstring name; std::wstring id; }; /// <summary> /// Retrieves the current volume level as a float, ranging from 0.0 - 1.0 /// </summary> virtual float Volume() = 0; /// <summary>Sets the volume level. Valid range: 0.0 - 1.0</summary> virtual void Volume(float vol) = 0; virtual bool Muted() = 0; virtual void Muted(bool mute) = 0; virtual void ToggleMute() { (Muted() == true) ? Muted(false) : Muted(true); } virtual void DeviceEnabled() = 0; virtual void AddTransformation(VolumeTransformation *transform) = 0; virtual void RemoveTransformation(VolumeTransformation *transform) = 0; public: static const int MSG_VOL_CHNG = WM_APP + 1080; static const int MSG_VOL_DEVCHNG = WM_APP + 1081; };
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once class VolumeTransformation; class VolumeController { public: struct DeviceInfo { std::wstring name; std::wstring id; }; /// <summary> /// Retrieves the current volume level as a float, ranging from 0.0 - 1.0 /// </summary> virtual float Volume() = 0; /// <summary>Sets the volume level. Valid range: 0.0 - 1.0</summary> virtual void Volume(float vol) = 0; virtual bool Muted() = 0; virtual void Muted(bool mute) = 0; virtual void ToggleMute() { (Muted() == true) ? Muted(false) : Muted(true); } virtual bool DeviceEnabled() = 0; virtual void AddTransformation(VolumeTransformation *transform) = 0; virtual void RemoveTransformation(VolumeTransformation *transform) = 0; public: static const int MSG_VOL_CHNG = WM_APP + 1080; static const int MSG_VOL_DEVCHNG = WM_APP + 1081; };
Use proper return type X-(
Use proper return type X-(
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
adca044ede25200548c3b2b4dbdcf8e1ddc40959
UIforETW/Version.h
UIforETW/Version.h
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.49f; // Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version // increment that won't trigger the new-version checks, handy for minor // releases that I don't want to bother users about. //#define VERSION_SUFFIX 'b'
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.50f; // Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version // increment that won't trigger the new-version checks, handy for minor // releases that I don't want to bother users about. //#define VERSION_SUFFIX 'b'
Change version number to 1.50
Change version number to 1.50
C
apache-2.0
ariccio/UIforETW,google/UIforETW,ariccio/UIforETW,google/UIforETW,ariccio/UIforETW,ariccio/UIforETW,google/UIforETW,google/UIforETW
f2f989b081da91d67646aeaeb9b0483d3586dae2
EasyImagy/EasyImagy.h
EasyImagy/EasyImagy.h
#import <UIKit/UIKit.h> //! Project version number for EasyImagy. FOUNDATION_EXPORT double EasyImagyVersionNumber; //! Project version string for EasyImagy. FOUNDATION_EXPORT const unsigned char EasyImagyVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <EasyImagy/PublicHeader.h>
#import <Foundation/Foundation.h> //! Project version number for EasyImagy. FOUNDATION_EXPORT double EasyImagyVersionNumber; //! Project version string for EasyImagy. FOUNDATION_EXPORT const unsigned char EasyImagyVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <EasyImagy/PublicHeader.h>
Replace unnecessary import of UIKit with Foundation
Replace unnecessary import of UIKit with Foundation
C
mit
koher/EasyImagy
11236637a5b66c166e266522d0c3b077ce084dc9
tomviz/PresetDialog.h
tomviz/PresetDialog.h
/* This source file is part of the Tomviz project, https://tomviz.org/. It is released under the 3-Clause BSD License, see "LICENSE". */ #ifndef tomvizPresetDialog_h #define tomvizPresetDialog_h #include <QDialog> #include <QScopedPointer> class QTableView; class vtkSMProxy; namespace Ui { class PresetDialog; } namespace tomviz { class PresetModel; class PresetDialog : public QDialog { Q_OBJECT public: explicit PresetDialog(QWidget* parent); QString presetName(); void addNewPreset(const QJsonObject& newPreset); QJsonObject jsonObject(); ~PresetDialog() override; signals: void applyPreset(); void resetToDefaults(); private slots: void warning(); private: QScopedPointer<Ui::PresetDialog> m_ui; PresetModel* m_model; QTableView* m_view; void customMenuRequested(const QModelIndex& Index); }; } // namespace tomviz #endif
/* This source file is part of the Tomviz project, https://tomviz.org/. It is released under the 3-Clause BSD License, see "LICENSE". */ #ifndef tomvizPresetDialog_h #define tomvizPresetDialog_h #include <QDialog> #include <QScopedPointer> class QTableView; class vtkSMProxy; namespace Ui { class PresetDialog; } namespace tomviz { class PresetModel; class PresetDialog : public QDialog { Q_OBJECT public: explicit PresetDialog(QWidget* parent); ~PresetDialog() override; QString presetName(); void addNewPreset(const QJsonObject& newPreset); QJsonObject jsonObject(); signals: void applyPreset(); void resetToDefaults(); private slots: void warning(); private: QScopedPointer<Ui::PresetDialog> m_ui; PresetModel* m_model; QTableView* m_view; void customMenuRequested(const QModelIndex& Index); }; } // namespace tomviz #endif
Move destructor to be below constructor
Move destructor to be below constructor Signed-off-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>
C
bsd-3-clause
OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz