commit
stringlengths
40
40
old_file
stringlengths
4
112
new_file
stringlengths
4
112
old_contents
stringlengths
0
2.05k
new_contents
stringlengths
28
3.9k
subject
stringlengths
17
736
message
stringlengths
18
4.78k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
111k
001af213199c25b457df50bebb664570285a1ca8
Pod/Classes/CMHActivityList.h
Pod/Classes/CMHActivityList.h
#import <CloudMine/CloudMine.h> #import <CareKit/CareKit.h> @interface CMHActivityList : CMObject - (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithObjectId:(NSString *)theObjectId NS_UNAVAILABLE; @property (nonatomic, nonnull, readonly) NSArray <OCKCarePlanActivity *> * activities; - (_Nonnull instancetype)initWithActivities:(NSArray<OCKCarePlanActivity *> *_Nonnull)activities; @end
#import <CloudMine/CloudMine.h> #import <CareKit/CareKit.h> @interface CMHActivityList : CMObject - (_Null_unspecified instancetype)init NS_UNAVAILABLE; - (_Null_unspecified instancetype)initWithObjectId:(NSString *_Null_unspecified)theObjectId NS_UNAVAILABLE; @property (nonatomic, nonnull, readonly) NSArray <OCKCarePlanActivity *> * activities; - (_Nonnull instancetype)initWithActivities:(NSArray<OCKCarePlanActivity *> *_Nonnull)activities; @end
Add placeholder nullability annotations to unavailable declarations to prevent warning while building activity list
Add placeholder nullability annotations to unavailable declarations to prevent warning while building activity list
C
mit
cloudmine/CMHealthSDK-iOS,cloudmine/CMHealthSDK-iOS,cloudmine/CMHealthSDK
f04e0dcb4e372731557990ba034745824260a37b
mudlib/mud/home/Http/initd.c
mudlib/mud/home/Http/initd.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2014 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths/system.h> #include <kotaka/privilege.h> inherit LIB_INITD; inherit UTILITY_COMPILE; private void load() { } static void create() { KERNELD->set_global_access("Http", 1); load(); } void upgrade_subsystem() { ACCESS_CHECK(previous_program() == INITD); load(); purge_orphans("Http"); }
Add http subsystem for later usage and expansion
Add http subsystem for later usage and expansion
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
4ec6dde3a662778f898375bdda879904509ad33d
src/NavRouting/SdkModel/NavRoutingLocationFinder.h
src/NavRouting/SdkModel/NavRoutingLocationFinder.h
#pragma once #include "ISingleOptionAlertBoxDismissedHandler.h" #include "INavRoutingLocationFinder.h" #include "NavRoutingLocationModel.h" #include "SearchResultModel.h" #include "ILocationService.h" #include "IAlertBoxFactory.h" namespace ExampleApp { namespace NavRouting { namespace SdkModel { class NavRoutingLocationFinder : public INavRoutingLocationFinder { private: Eegeo::Location::ILocationService& m_locationService; Eegeo::Resources::Interiors::InteriorsModelRepository& m_interiorsModelRepository; Eegeo::UI::NativeAlerts::IAlertBoxFactory& m_alertBoxFactory; Eegeo::UI::NativeAlerts::TSingleOptionAlertBoxDismissedHandler<NavRoutingLocationFinder> m_failAlertHandler; void OnFailAlertBoxDismissed(); public: NavRoutingLocationFinder( Eegeo::Location::ILocationService& locationService, Eegeo::Resources::Interiors::InteriorsModelRepository& interiorsModelRepository, Eegeo::UI::NativeAlerts::IAlertBoxFactory& alertBoxFactory); bool TryGetCurrentLocation(NavRoutingLocationModel &outLocation); bool TryGetLocationFromSearchResultModel( const Search::SdkModel::SearchResultModel& searchResultModel, NavRoutingLocationModel &outLocation); }; } } }
#pragma once #include "Types.h" #include "ISingleOptionAlertBoxDismissedHandler.h" #include "INavRoutingLocationFinder.h" #include "NavRoutingLocationModel.h" #include "SearchResultModel.h" #include "ILocationService.h" #include "IAlertBoxFactory.h" namespace ExampleApp { namespace NavRouting { namespace SdkModel { class NavRoutingLocationFinder : public INavRoutingLocationFinder, private Eegeo::NonCopyable { private: Eegeo::Location::ILocationService& m_locationService; Eegeo::Resources::Interiors::InteriorsModelRepository& m_interiorsModelRepository; Eegeo::UI::NativeAlerts::IAlertBoxFactory& m_alertBoxFactory; Eegeo::UI::NativeAlerts::TSingleOptionAlertBoxDismissedHandler<NavRoutingLocationFinder> m_failAlertHandler; void OnFailAlertBoxDismissed(); public: NavRoutingLocationFinder( Eegeo::Location::ILocationService& locationService, Eegeo::Resources::Interiors::InteriorsModelRepository& interiorsModelRepository, Eegeo::UI::NativeAlerts::IAlertBoxFactory& alertBoxFactory); virtual ~NavRoutingLocationFinder() {}; bool TryGetCurrentLocation(NavRoutingLocationModel &outLocation); bool TryGetLocationFromSearchResultModel( const Search::SdkModel::SearchResultModel& searchResultModel, NavRoutingLocationModel &outLocation); }; } } }
Fix missing virtual dtor on new type Buddy Michael Chan
Fix missing virtual dtor on new type Buddy Michael Chan
C
bsd-2-clause
eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app,eegeo/eegeo-example-app,wrld3d/wrld-example-app
b8ccf5a8022a002571a40900e6f725a0c8b0d860
src/udon2xml.c
src/udon2xml.c
#include <stdio.h> #include <stdlib.h> #include "udon.h" int main (int argc, char *argv[]) { int i; int found = 0; pstate *state = init_from_file("../sjson-examples/big.txt"); for(i=0; i<10000; i++) { found += parse(state); reset_state(state); } free_state(state); printf("%d\n", found); }
#include <stdio.h> #include <stdlib.h> #include "udon.h" int main (int argc, char *argv[]) { int i; int found = 0; if(argc < 2) return 1; pstate *state = init_from_file(argv[1]); for(i=0; i<10000; i++) { found += parse(state); reset_state(state); } free_state(state); printf("%d\n", found); }
Remove hardcoded file path. Still awkward and not generally usable, but _more_ general.
Remove hardcoded file path. Still awkward and not generally usable, but _more_ general.
C
mit
josephwecker/udon-c,josephwecker/udon-c,josephwecker/udon-c,josephwecker/udon-c
562f2b7069f12d7558bccf72d49a13007e090947
crypto/isrcrypto.h
crypto/isrcrypto.h
#ifndef LIBISRCRYPTO_H #define LIBISRCRYPTO_H struct isrcry_aes_key { ulong32 eK[60], dK[60]; int Nr; }; struct isrcry_blowfish_key { ulong32 S[4][256]; ulong32 K[18]; }; /** A block cipher CBC structure */ typedef struct { /** The index of the cipher chosen */ int cipher, /** The block size of the given cipher */ blocklen; /** The current IV */ unsigned char IV[MAXBLOCKSIZE]; /** The scheduled key */ symmetric_key key; } symmetric_CBC; #endif
Add initial exported header file
crypto: Add initial exported header file - Add initial exported header file with relevant structs from tomcrypt_cipher.h
C
epl-1.0
cmusatyalab/openisr,cmusatyalab/openisr,cmusatyalab/openisr,cmusatyalab/openisr,cmusatyalab/openisr
052b3fc55ae2ee20e2ab6d9e29fde8a4fee7a68b
src/pomodoro.h
src/pomodoro.h
// ---------------------------------------------------------------------------- // pomodoro - Defines a model to track progress through the Pomodoro Technique // Copyright (c) 2013 Jonathan Speicher ([email protected]) // Licensed under the MIT license: http://opensource.org/licenses/MIT // ---------------------------------------------------------------------------- #pragma once #include <stdbool.h> // Defines a type to hold the various pomodoro technique segment types. typedef enum { POMODORO_SEGMENT_TYPE_POMODORO = 0, POMODORO_SEGMENT_TYPE_BREAK, POMODORO_SEGMENT_TYPE_COUNT } SegmentType; // Defines a type to hold a pomodoro technique segment. typedef struct { Interval interval; bool restart_on_abort; } Segment; // Defines a structure type to hold the pomodoro technique segment sequence. typedef struct { Segment* this_segment; Segment segments[POMODORO_SEGMENT_TYPE_COUNT]; } Pomodoro; // Initializes the pomodoro technique structure. void pomodoro_init(Pomodoro* pomodoro); // Completes the current pomodoro technique segment and causes an advance to // the next appropriate segment in the pomodoro technique sequence. void pomodoro_complete_segment(Pomodoro* pomodoro); // Aborts the current pomodoro tecnique segment and causes an advance to the // next appropriate segment in the pomodoro technique sequence. void pomodoro_abort_segment(Pomodoro* pomodoro);
// ---------------------------------------------------------------------------- // pomodoro - Defines a model to track progress through the Pomodoro Technique // Copyright (c) 2013 Jonathan Speicher ([email protected]) // Licensed under the MIT license: http://opensource.org/licenses/MIT // ---------------------------------------------------------------------------- #pragma once #include <stdbool.h> // Defines a type to hold the various pomodoro technique segment types. typedef enum { POMODORO_SEGMENT_TYPE_POMODORO = 0, POMODORO_SEGMENT_TYPE_BREAK, POMODORO_SEGMENT_TYPE_COUNT } PomodoroSegmentType; // Defines a type to hold a pomodoro technique segment. typedef struct { Interval interval; bool restart_on_abort; } PomodoroSegment; // Defines a type to hold the pomodoro technique segment sequence. typedef struct { PomodoroSegment* this_segment; PomodoroSegment segments[POMODORO_SEGMENT_TYPE_COUNT]; } Pomodoro; // Initializes the pomodoro technique sequence structure. void pomodoro_init(Pomodoro* pomodoro); // Completes the current pomodoro technique segment and causes an advance to // the next appropriate segment in the pomodoro technique sequence. void pomodoro_complete_segment(Pomodoro* pomodoro); // Aborts the current pomodoro tecnique segment and causes an advance to the // next appropriate segment in the pomodoro technique sequence. void pomodoro_abort_segment(Pomodoro* pomodoro);
Fix some comments and type names
Fix some comments and type names
C
mit
jonspeicher/Pomade,jonspeicher/Pomade,elliots/simple-demo-pebble
35e0ab1f6591592e10dea911cacbd649de4f8da3
MouseEvent.h
MouseEvent.h
#pragma once #include <cstdint> namespace ni { struct MouseEvent { int32_t deltaX; int32_t deltaY; int32_t deltaWheel; uint8_t leftButtonDown; uint8_t rightButtonDown; uint8_t middleButtonDown; }; }
#pragma once #include <cstdint> namespace ni { struct MouseEvent { int32_t deltaX; int32_t deltaY; int8_t deltaWheel; uint8_t leftButtonDown; uint8_t rightButtonDown; uint8_t middleButtonDown; }; static_assert(sizeof(MouseEvent) == 12, "Improper mouse event size"); }
Change MouseWheel deltaWheel field size to one byte. Add compile time size check to Mouse Event.
Change MouseWheel deltaWheel field size to one byte. Add compile time size check to Mouse Event.
C
mit
jack-karamanian/NetInput
9e82bcb019f476a4f025f63b101f8a250033ca9d
win32_compat.h
win32_compat.h
/* Copyright (c) 2014 Harm Hanemaaijer <[email protected]> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* win32-compat.h -- header file with definitions for compatability with Windows. */ // Note: Just using the built-in maximum and minimum values on all system may be safer/ // give more consistent results than using 'INFINITY', so use of the latter is disabled. // #if !defined(__GNUC__ ) || defined(OPENGL_ES2) #if 1 #define POSITIVE_INFINITY_DOUBLE DBL_MAX #define NEGATIVE_INFINITY_DOUBLE DBL_MIN #define POSITIVE_INFINITY_FLOAT FLT_MAX #define NEGATIVE_INFINITY_FLOAT FLT_MIN #else #define POSITIVE_INFINITY_DOUBLE INFINITY #define NEGATIVE_INFINITY_DOUBLE (- INFINITY) #define POSITIVE_INFINITY_FLOAT INFINITY #define NEGATIVE_INFINITY_FLOAT (- INFINITY) #endif #ifndef __GNUC__ #define isnan(x) _isnan(x) #endif
/* Copyright (c) 2014 Harm Hanemaaijer <[email protected]> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* win32-compat.h -- header file with definitions for compatability with Windows. */ // Note: Just using the built-in maximum and minimum values on all system may be safer/ // give more consistent results than using 'INFINITY', so use of the latter is disabled. #define POSITIVE_INFINITY_DOUBLE DBL_MAX #define NEGATIVE_INFINITY_DOUBLE - DBL_MAX #define POSITIVE_INFINITY_FLOAT FLT_MAX #define NEGATIVE_INFINITY_FLOAT - FLT_MAX #ifndef __GNUC__ #define isnan(x) _isnan(x) #endif
Fix major bug in definition of greatest negative float value
Fix major bug in definition of greatest negative float value The minimum float value was actually defined as a very small negative value close to zero, as opposed to a very large negative value in the direction of minus infinity. This error may have caused multiple, sometimes hard to pinpoint, bugs. Also convert the file win32_compat.h to consistent UNIX newlines.
C
isc
hglm/sre,hglm/sre,hglm/sre
e87f79e573ba951dad55b81433b3a1839dd85332
extensions/ringopengl/opengl11/ring_opengl11.c
extensions/ringopengl/opengl11/ring_opengl11.c
#include "ring.h" /* OpenGL 1.1 Extension Copyright (c) 2017 Mahmoud Fayed <[email protected]> */ #include <GL/glew.h> #include <GL/glut.h> RING_FUNC(ring_get_gl_zero) { RING_API_RETNUMBER(GL_ZERO); } RING_FUNC(ring_get_gl_false) { RING_API_RETNUMBER(GL_FALSE); } RING_FUNC(ring_get_gl_logic_op) { RING_API_RETNUMBER(GL_LOGIC_OP); } RING_API void ringlib_init(RingState *pRingState) { ring_vm_funcregister("get_gl_zero",ring_get_gl_zero); ring_vm_funcregister("get_gl_false",ring_get_gl_false); ring_vm_funcregister("get_gl_logic_op",ring_get_gl_logic_op); }
#include "ring.h" /* OpenGL 1.1 Extension Copyright (c) 2017 Mahmoud Fayed <[email protected]> */ #include <GL/glew.h> #include <GL/glut.h> RING_FUNC(ring_get_gl_zero) { RING_API_RETNUMBER(GL_ZERO); } RING_FUNC(ring_get_gl_false) { RING_API_RETNUMBER(GL_FALSE); } RING_FUNC(ring_get_gl_logic_op) { RING_API_RETNUMBER(GL_LOGIC_OP); } RING_FUNC(ring_get_gl_none) { RING_API_RETNUMBER(GL_NONE); } RING_API void ringlib_init(RingState *pRingState) { ring_vm_funcregister("get_gl_zero",ring_get_gl_zero); ring_vm_funcregister("get_gl_false",ring_get_gl_false); ring_vm_funcregister("get_gl_logic_op",ring_get_gl_logic_op); ring_vm_funcregister("get_gl_none",ring_get_gl_none); }
Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_NONE
Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_NONE
C
mit
ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring
005729668570026852429b644002a5785cbbfd39
interface/include/quaternion_bind.h
interface/include/quaternion_bind.h
/* __ __ _ * / // /_____ ____ (_) * / // // ___// __ \ / / * / // // /__ / /_/ // / * /_//_/ \___/ \____//_/ * https://bitbucket.org/galaktor/llcoi * copyright (c) 2014, llcoi Team * MIT license applies - see file "LICENSE" for details. */ #pragma once #include "ogre_interface.h" DLL QuaternionHandle quaternion_create(); DLL void quaternion_from_rotation_matrix(QuaternionHandle quat, coiMatrix3 *rot); DLL void quaternion_to_rotation_matrix(QuaternionHandle quat, coiMatrix3 *rot); DLL QuaternionHandle quaternion_from_values(coiReal fW, coiReal fX, coiReal fY, coiReal fZ); DLL void quaternion_from_angle_axis(QuaternionHandle handle, coiRadian rfAngle, Vector3Handle vecHandle); DLL coiReal quaternion_get_w(QuaternionHandle quat); DLL coiReal quaternion_get_x(QuaternionHandle quat); DLL coiReal quaternion_get_y(QuaternionHandle quat); DLL coiReal quaternion_get_z(QuaternionHandle quat); DLL QuaternionHandle quaternion_multiply_quaternion(QuaternionHandle lhs, QuaternionHandle rhs); DLL QuaternionHandle quaternion_subtract_quaternion(QuaternionHandle lhs, QuaternionHandle rhs); DLL QuaternionHandle quaternion_unit_inverse(QuaternionHandle lhs, QuaternionHandle rhs);
/* __ __ _ * / // /_____ ____ (_) * / // // ___// __ \ / / * / // // /__ / /_/ // / * /_//_/ \___/ \____//_/ * https://bitbucket.org/galaktor/llcoi * copyright (c) 2014, llcoi Team * MIT license applies - see file "LICENSE" for details. */ #pragma once #include "ogre_interface.h" DLL QuaternionHandle quaternion_create(); DLL void quaternion_from_rotation_matrix(QuaternionHandle quat, coiMatrix3 *rot); DLL void quaternion_to_rotation_matrix(QuaternionHandle quat, coiMatrix3 *rot); DLL QuaternionHandle quaternion_from_values(coiReal fW, coiReal fX, coiReal fY, coiReal fZ); DLL void quaternion_from_angle_axis(QuaternionHandle handle, coiRadian rfAngle, Vector3Handle vecHandle); DLL coiReal quaternion_get_w(QuaternionHandle quat); DLL coiReal quaternion_get_x(QuaternionHandle quat); DLL coiReal quaternion_get_y(QuaternionHandle quat); DLL coiReal quaternion_get_z(QuaternionHandle quat); DLL QuaternionHandle quaternion_multiply_quaternion(QuaternionHandle lhs, QuaternionHandle rhs); DLL QuaternionHandle quaternion_subtract_quaternion(QuaternionHandle lhs, QuaternionHandle rhs); DLL QuaternionHandle quaternion_unit_inverse(QuaternionHandle q);
Update signature of quaternion unit inverse.
Update signature of quaternion unit inverse.
C
mit
fire/llcoi,fire/llcoi
340b3dbdf1142a12278ae902b9081ed9e55679f3
exemplos/primeiro-trimestre/02-somando-dois-numeros.c
exemplos/primeiro-trimestre/02-somando-dois-numeros.c
/** * Exemplo 02 - Somando dois números * * Nesse exemplo, vemos como podemos somar dois números. * Além disso, vemos como é possível mostrar um número na tela */ #include <stdio.h> int main(void) { /** * Para realizar a soma em si, utilizamos o operador + * Para imprimir o resultado, utilizamos a função printf (print formatted, imprimir com formatação) * A formatação do printf funciona da seguinte maneira: * O primeiro argumento será o "modelo" a ser impresso na tela * Tudo que começar com % será considerado uma "lacuna" a ser preenchida por algum valor * No caso, utilizamos %d, o d indicando que iremos imprimir um número (TODO: referenciar tabela) * Ao contrário da função puts, o printf não insere um "enter" (quebra de linha) após a mensagem, * logo inserimos nós mesmos. Na linguagem C, sequências começadas em \ são consideradas "escapadas", * se transformando em caracteres de controle. No caso, a sequência \n é impressa como um enter. */ printf("2 + 2 = %d \n", 2 + 2); return 0; }
Add another example! (somando dois números)
Add another example! (somando dois números)
C
unlicense
atropelando/terceiro-ano-programacao
f44be40fe1d9be9535a4819d7ef468cbba34ea74
scheduler.h
scheduler.h
/* * scheduler.h * * Created on: Jun 8, 2016 * Author: riley */ #ifndef SCHEDULER_H #define SCHEDULER_H #include <stdint.h> #include "scheduler_private.h" typedef void (*task_func_t)( void ) ; typedef volatile struct task_private_s { const char * name; volatile void * task_sp; //Task stack pointer volatile struct task_private_s * next; } task_t; /// Sets up the idle task void scheduler_init( void ); /** * Add task to task list to be run at next context switch. * Push task routine pointer and empty status register * onto the new task stack so they can be popped off later * from the task switch interrupt. */ void scheduler_add_task(task_t * task_handle, const char * name, task_func_t func, uint16_t * task_stack, uint16_t stack_bytes); /// Kicks off the timer interrupt void scheduler_run( void ); /** * Handy macro which blackboxes the allocation of memory * per task. Accepts the task function to schedule * and the size of stack to allocate as arguments. */ #define SCHEDULER_ADD(func, stack_size) \ CREATE_TASK_HANDLE(__LINE__, func); \ CREATE_TASK_STACK(__LINE__, func, stack_size); \ CALL_SCHEDULER_ADD(__LINE__, func); #endif /* SCHEDULER_H */
/* * scheduler.h * * Created on: Jun 8, 2016 * Author: riley */ #ifndef SCHEDULER_H #define SCHEDULER_H #include <stdint.h> #include "scheduler_private.h" typedef void (*task_func_t)( void ) ; typedef volatile struct task_private_s { const char * name; volatile void * task_sp; //Task stack pointer volatile struct task_private_s * next; } task_t; /// Sets up the idle task void scheduler_init( void ); /** * Add task to task list to be run at next context switch. */ void scheduler_add_task(task_t * task_handle, const char * name, task_func_t func, uint16_t * task_stack, uint16_t stack_bytes); /// Kicks off the timer interrupt void scheduler_run( void ); /** * Handy macro which blackboxes the allocation of memory * per task. Accepts the task function to schedule * and the size of stack to allocate as arguments. */ #define SCHEDULER_ADD(func, stack_size) \ CREATE_TASK_HANDLE(__LINE__, func); \ CREATE_TASK_STACK(__LINE__, func, stack_size); \ CALL_SCHEDULER_ADD(__LINE__, func); #endif /* SCHEDULER_H */
Remove implementation details from API comment
Remove implementation details from API comment
C
mit
rjw245/rileyOS
72a770c94deb158fbb1b804c7d0395623c568272
drivers/media/radio/lm7000.h
drivers/media/radio/lm7000.h
#ifndef __LM7000_H #define __LM7000_H /* Sanyo LM7000 tuner chip control * * Copyright 2012 Ondrej Zary <[email protected]> * based on radio-aimslab.c by M. Kirkwood * and radio-sf16fmi.c by M. Kirkwood and Petr Vandrovec */ #define LM7000_DATA (1 << 0) #define LM7000_CLK (1 << 1) #define LM7000_CE (1 << 2) #define LM7000_FM_100 (0 << 20) #define LM7000_FM_50 (1 << 20) #define LM7000_FM_25 (2 << 20) #define LM7000_BIT_FM (1 << 23) static inline void lm7000_set_freq(u32 freq, void *handle, void (*set_pins)(void *handle, u8 pins)) { int i; u8 data; u32 val; freq += 171200; /* Add 10.7 MHz IF */ freq /= 400; /* Convert to 25 kHz units */ val = freq | LM7000_FM_25 | LM7000_BIT_FM; /* write the 24-bit register, starting with LSB */ for (i = 0; i < 24; i++) { data = val & (1 << i) ? LM7000_DATA : 0; set_pins(handle, data | LM7000_CE); udelay(2); set_pins(handle, data | LM7000_CE | LM7000_CLK); udelay(2); set_pins(handle, data | LM7000_CE); udelay(2); } set_pins(handle, 0); } #endif /* __LM7000_H */
Add Sanyo LM7000 tuner driver
[media] radio: Add Sanyo LM7000 tuner driver Add very simple driver for Sanyo LM7000 AM/FM tuner chip. Only FM is supported as there is no known HW with AM implemented. This will be used by radio-aimslab and radio-sf16fmi. Signed-off-by: Ondrej Zary <[email protected]> Acked-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas
d61e95344b2052b6dfa8a96a61fff6b99f08e008
ext/libx11_ruby/libx11_ruby.c
ext/libx11_ruby/libx11_ruby.c
#include "libx11_ruby.h" VALUE rb_mLibX11; void Init_libx11_ruby(void) { rb_mLibX11 = rb_define_module("LibX11"); }
#include <X11/Xlib.h> #include "libx11_ruby.h" VALUE rb_mLibX11, rb_cDisplay; static size_t display_memsize(const void *); static const rb_data_type_t display_type = { .wrap_struct_name = "libx11_display", .function = { .dmark = NULL, .dfree = NULL, .dsize = display_memsize, .reserved = { NULL, NULL }, }, .parent = NULL, .data = NULL, .flags = RUBY_TYPED_FREE_IMMEDIATELY, }; static size_t display_memsize(const void *arg) { const Display *display = arg; return sizeof(display); } /* * Xlib XOpenDisplay */ static VALUE rb_libx11_open_display(VALUE self, VALUE display_name) { Display *display; Check_Type(display_name, T_STRING); display = XOpenDisplay(RSTRING_PTR(display_name)); return TypedData_Wrap_Struct(rb_cDisplay, &display_type, display); } /* * Xlib XCloseDisplay */ static VALUE rb_libx11_close_display(VALUE self, VALUE obj) { int ret; Display *display; TypedData_Get_Struct(obj, Display, &display_type, display); ret = XCloseDisplay(display); return INT2FIX(ret); } void Init_libx11_ruby(void) { rb_mLibX11 = rb_define_module("LibX11"); rb_define_singleton_method(rb_mLibX11, "open_display", rb_libx11_open_display, 1); rb_define_singleton_method(rb_mLibX11, "close_display", rb_libx11_close_display, 1); rb_cDisplay = rb_define_class_under(rb_mLibX11, "Display", rb_cData); }
Add bindings for XOpenDisplay and XCloseDisplay
Add bindings for XOpenDisplay and XCloseDisplay
C
mit
k0kubun/libx11-ruby,k0kubun/libx11-ruby
e5ef49ad2ccaf5319b2476f8c8b866dbdee3f187
src/nbody.h
src/nbody.h
#ifndef _nbody_h #define _nbody_h #include <stdbool.h> #include "window.h" #include "star.h" #define NUM_STARS 64 typedef struct { Window* window; bool running; Star stars[NUM_STARS]; } NBody; NBody* NBody_new(); void NBody_run(NBody* self); void NBody_destroy(NBody* self); #endif
#ifndef _nbody_h #define _nbody_h #include <stdbool.h> #include "window.h" #include "star.h" #define NUM_STARS 512 typedef struct { Window* window; bool running; Star stars[NUM_STARS]; } NBody; NBody* NBody_new(); void NBody_run(NBody* self); void NBody_destroy(NBody* self); #endif
Increase number of stars to 512.
Increase number of stars to 512.
C
mit
wtolson/nbody-opengl,wtolson/nbody-opengl
d3a6ecc4f70e7614cc8b5016617aee79f5960710
include/cpp-sort/utility/functional.h
include/cpp-sort/utility/functional.h
/* * The MIT License (MIT) * * Copyright (c) 2015 Morwenn * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef CPPSORT_UTILITY_FUNCTIONAL_H_ #define CPPSORT_UTILITY_FUNCTIONAL_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <cmath> #include <utility> namespace cppsort { namespace utility { struct half { template<typename T> constexpr auto operator()(T&& value) const -> decltype(std::forward<T>(value) / 2) { return std::forward<T>(value) / 2; } }; struct log { template<typename T> constexpr auto operator()(T&& value) const -> decltype(auto) { using std::log; return log(std::forward<T>(value)); } }; struct sqrt { template<typename T> constexpr auto operator()(T&& value) const -> decltype(auto) { using std::sqrt; return sqrt(std::forward<T>(value)); } }; }} #endif // CPPSORT_UTILITY_FUNCTIONAL_H_
Add somewhat useful function objects.
Add somewhat useful function objects.
C
mit
Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort
f18766e3a0dec67141ab2e1564023af04789cd7d
Projects/Project1/src/order.h
Projects/Project1/src/order.h
#ifndef ORDER_H_ #define ORDER_H_ /** * Represents an order with weight and volume */ class Order { public: Order(uint weight, uint volume) : _weight(weight), _volume(volume) { } ///< Constructor Order(const Order& other) : _weight(other._weight), _volume(other._volume) { } ///< Copy constructor Order operator=(const Order& other) const { return Order(other); } ///< Assignment operator uint GetWeight() const { return _weight; } ///< Returns the order weight uint GetVolume() const { return _volume; } ///< Returns the order volume private: const uint _weight; const uint _volume; }; #endif // ORDER_H_
#ifndef ORDER_H_ #define ORDER_H_ /** * Represents an order with weight and volume */ class Order { public: Order(uint weight, uint volume) : _weight(weight), _volume(volume) { } ///< Constructor uint GetWeight() const { return _weight; } ///< Returns the order weight uint GetVolume() const { return _volume; } ///< Returns the order volume private: uint _weight; uint _volume; }; #endif // ORDER_H_
Fix a bug with copy cctors, iterators and vector erases. Weird bugs are weird.
Fix a bug with copy cctors, iterators and vector erases. Weird bugs are weird.
C
mit
DDuarte/feup-cal,DDuarte/feup-cal,DDuarte/feup-cal,DDuarte/feup-cal,DDuarte/feup-cal
98c5148a59368feae0aecf56f87d64e74787768c
Engine/Sprite.h
Engine/Sprite.h
#pragma once #include "Point.h" #include <SDL/include/SDL.h> struct Sprite { SDL_Rect Rect; iPoint Pivot; };
#ifndef __SPRITE_H__ #define __SPRITE_H__ #include "Point.h" #include <SDL/include/SDL.h> struct Sprite { SDL_Rect Rect; iPoint Pivot; }; #endif // __SPRITE_H__
Substitute pragma once for ifndef guards
Substitute pragma once for ifndef guards
C
mit
jowie94/The-Simpsons-Arcade,jowie94/The-Simpsons-Arcade
71f77664fed316a2714c91b2828934f6a4d10211
examples/memory.c
examples/memory.c
#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int x, y, *p, **q; p = &x; q = &p; *q = &y; /* int *ptr; */ /* ptr = malloc(sizeof(int)); */ /* x = 5; */ /* *ptr = x; */ /* int y = *ptr; */ /* if (y != x) */ /* return EXIT_FAILURE; */ /* ptr = &x; */ /* printf("%d", *ptr); */ /* ptr = &argc; */ return EXIT_SUCCESS; }
Add a simple example for Andersen's analysis.
Add a simple example for Andersen's analysis.
C
mit
plast-lab/llvm-datalog,plast-lab/cclyzer
7b9661e1d1d78c7558123e4865a32c60e84d8049
src/graphics.h
src/graphics.h
#ifndef __GRAPHICS_H__ #define __GRAPHICS_H__ #include "models.h" typedef struct { int num_goats_to_put; int num_eaten_goats; player_turn_t turn; mvt_t input; mvt_t *possible_mvts; board_t *board; } state_to_draw_t; #endif
#ifndef __GRAPHICS_H__ #define __GRAPHICS_H__ #include "models.h" typedef struct { int num_goats_to_put; int num_eaten_goats; player_turn_t turn; mvt_t input; mvt_t *possible_mvts; size_t num_possible_mvts; board_t *board; } state_to_draw_t; #endif
Fix state_to_draw_t by adding the number of possible mvts
Fix state_to_draw_t by adding the number of possible mvts
C
mit
moverest/bagh-chal,moverest/bagh-chal,moverest/bagh-chal
41ecc842c747e8dc572fcbca6f41a11a08a55e4e
pkg/gridalt/gridalt_mapping.h
pkg/gridalt/gridalt_mapping.h
C $Header$ C $Name$ #include "PACKAGES_CONFIG.h" c Alternate grid Mapping Common c ------------------------------ #ifdef ALLOW_FIZHI integer nlperdyn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,Nsy) _RL dpphys0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) _RL dpphys(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) _RL dxfalt,dyfalt,drfalt common /gridalt_mapping/ nlperdyn,dpphys0,dpphys, . dxfalt,dyfalt,drfalt #endif
C $Header$ C $Name$ c Alternate grid Mapping Common c ------------------------------ #ifdef ALLOW_FIZHI integer nlperdyn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,Nsy) _RL dpphys0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) _RL dpphys(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) _RL dxfalt,dyfalt,drfalt common /gridalt_mapping/ nlperdyn,dpphys0,dpphys, . dxfalt,dyfalt,drfalt #endif
Remove explicit include of packages_config in here - it is included elsewhere in all routines which use this common
Remove explicit include of packages_config in here - it is included elsewhere in all routines which use this common
C
mit
altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h,altMITgcm/MITgcm66h
2d7cf3ef879b22bdfd271aa3b66733c53279e813
arch/powerpc/include/asm/kmap_types.h
arch/powerpc/include/asm/kmap_types.h
#ifndef _ASM_POWERPC_KMAP_TYPES_H #define _ASM_POWERPC_KMAP_TYPES_H #ifdef __KERNEL__ /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ enum km_type { KM_BOUNCE_READ, KM_SKB_SUNRPC_DATA, KM_SKB_DATA_SOFTIRQ, KM_USER0, KM_USER1, KM_BIO_SRC_IRQ, KM_BIO_DST_IRQ, KM_PTE0, KM_PTE1, KM_IRQ0, KM_IRQ1, KM_SOFTIRQ0, KM_SOFTIRQ1, KM_PPC_SYNC_PAGE, KM_PPC_SYNC_ICACHE, KM_TYPE_NR }; #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_KMAP_TYPES_H */
#ifndef _ASM_POWERPC_KMAP_TYPES_H #define _ASM_POWERPC_KMAP_TYPES_H #ifdef __KERNEL__ /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ enum km_type { KM_BOUNCE_READ, KM_SKB_SUNRPC_DATA, KM_SKB_DATA_SOFTIRQ, KM_USER0, KM_USER1, KM_BIO_SRC_IRQ, KM_BIO_DST_IRQ, KM_PTE0, KM_PTE1, KM_IRQ0, KM_IRQ1, KM_SOFTIRQ0, KM_SOFTIRQ1, KM_PPC_SYNC_PAGE, KM_PPC_SYNC_ICACHE, KM_TYPE_NR }; /* * This is a temporary build fix that (so they say on lkml....) should no longer * be required after 2.6.33, because of changes planned to the kmap code. * Let's try to remove this cruft then. */ #ifdef CONFIG_DEBUG_HIGHMEM #define KM_NMI (-1) #define KM_NMI_PTE (-1) #define KM_IRQ_PTE (-1) #endif #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_KMAP_TYPES_H */
Fix DEBUG_HIGHMEM build break from d4515646699
powerpc: Fix DEBUG_HIGHMEM build break from d4515646699 Code was added to mm/higmem.c that depends on several kmap types that powerpc does not support. We add dummy invalid definitions for KM_NMI, KM_NM_PTE, and KM_IRQ_PTE. According to list discussion, this fix should not be needed anymore starting with 2.6.33. The code is commented to this effect so hopefully we will remember to remove this. Signed-off-by: Becky Bruce <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
0b8a1228b773bc4e9a865a913a231f7e0d1e7a15
platform/shared/common/stat.h
platform/shared/common/stat.h
/* #if defined(__APPLE__) && !(defined(__DARWIN_ONLY_64_BIT_INO_T) && ___DARWIN_ONLY_64_BIT_INO_T) #define __DARWIN_ONLY_64_BIT_INO_T 1 #endif */ #include <sys/stat.h>
#if defined(__APPLE__) && !defined(__arm__) && !defined(__IPHONE_4_0) /* Simulator 3.2 or less */ #define RHO_IPHONE_SIMULATOR_3 #endif #ifdef RHO_IPHONE_SIMULATOR_3 #ifdef stat #undef stat #endif #ifdef lstat #undef lstat #endif #ifdef fstat #undef fstat #endif #endif #include <sys/stat.h> #ifdef RHO_IPHONE_SIMULATOR_3 /* * map stat functions and structure to theirs 64-bit analogues to be binary * compatible with iPhone 4 x86/x86_64 application - in iPhone 4 SDK stat * become 64-bit only so enabling such mapping we could run applications built * with 3.x SDK on iPhone 4 simulator * This is not required for iPhone devices - there stat was always 64-bit. */ #define stat stat64 #define lstat lstat64 #define fstat fstat64 #endif
Make iPhone simulator build binary compatible between 3.x and 4.x
Make iPhone simulator build binary compatible between 3.x and 4.x
C
mit
pslgoh/rhodes,tauplatform/tau,watusi/rhodes,tauplatform/tau,tauplatform/tau,tauplatform/tau,tauplatform/tau,watusi/rhodes,rhomobile/rhodes,rhomobile/rhodes,tauplatform/tau,tauplatform/tau,watusi/rhodes,pslgoh/rhodes,pslgoh/rhodes,tauplatform/tau,rhomobile/rhodes,rhomobile/rhodes,watusi/rhodes,pslgoh/rhodes,watusi/rhodes,pslgoh/rhodes,watusi/rhodes,rhomobile/rhodes,rhomobile/rhodes,tauplatform/tau,watusi/rhodes,watusi/rhodes,rhomobile/rhodes,pslgoh/rhodes,watusi/rhodes,pslgoh/rhodes,pslgoh/rhodes,tauplatform/tau,rhomobile/rhodes,watusi/rhodes,pslgoh/rhodes,rhomobile/rhodes,rhomobile/rhodes,pslgoh/rhodes
ca4e752c35e8a6254d85fae156cc256f2658de2a
src/ip.c
src/ip.c
/*****************************************************************************/ /* */ /* Telize 2.0.0 */ /* Copyright (c) 2013-2018, Frederic Cambus */ /* https://www.telize.com */ /* */ /* Created: 2013-08-15 */ /* Last Updated: 2018-10-04 */ /* */ /* Telize is released under the BSD 2-Clause license. */ /* See LICENSE file for details. */ /* */ /*****************************************************************************/ #include <sys/socket.h> #include <kore/kore.h> #include <kore/http.h> int ip(struct http_request *); int ip(struct http_request *req) { char addr[INET6_ADDRSTRLEN]; if (req->owner->addrtype == AF_INET) { inet_ntop(req->owner->addrtype, &(req->owner->addr.ipv4.sin_addr), addr, sizeof(addr)); } else { inet_ntop(req->owner->addrtype, &(req->owner->addr.ipv6.sin6_addr), addr, sizeof(addr)); } http_response(req, 200, addr, strlen(addr)); return (KORE_RESULT_OK); }
/*****************************************************************************/ /* */ /* Telize 2.0.0 */ /* Copyright (c) 2013-2018, Frederic Cambus */ /* https://www.telize.com */ /* */ /* Created: 2013-08-15 */ /* Last Updated: 2018-10-04 */ /* */ /* Telize is released under the BSD 2-Clause license. */ /* See LICENSE file for details. */ /* */ /*****************************************************************************/ #include <sys/socket.h> #include <kore/kore.h> #include <kore/http.h> int ip(struct http_request *); int ip(struct http_request *req) { const char *visitor_ip; char *ip, addr[INET6_ADDRSTRLEN]; if (req->owner->addrtype == AF_INET) { inet_ntop(req->owner->addrtype, &(req->owner->addr.ipv4.sin_addr), addr, sizeof(addr)); } else { inet_ntop(req->owner->addrtype, &(req->owner->addr.ipv6.sin6_addr), addr, sizeof(addr)); } if (http_request_header(req, "X-Forwarded-For", &visitor_ip)) { ip = kore_strdup(visitor_ip); } else { ip = addr; } http_response(req, 200, ip, strlen(ip)); return (KORE_RESULT_OK); }
Handle the 'X-Forwarded-For' HTTP header if present
Handle the 'X-Forwarded-For' HTTP header if present
C
bsd-2-clause
fcambus/telize
102f9015c61e9e7a84e1442705e85de19fe9b400
test/C++Frontend/ConstructorDestructorAttributes.c
test/C++Frontend/ConstructorDestructorAttributes.c
#include <stdio.h> void ctor() __attribute__((constructor)); void ctor() { printf("Create!\n"); } void dtor() __attribute__((destructor)); void dtor() { printf("Create!\n"); } int main() { return 0; }
Add a testcase to ensure that ctor/dtor attributes work in C
Add a testcase to ensure that ctor/dtor attributes work in C git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@6919 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm
f696c641dc0182e254ae9cea224465ed8e7fef79
src/common.h
src/common.h
#ifndef COMMON_INCLUDED #define COMMON_INCLUDED #pragma once #define _WIN32_WINNT _WIN32_WINNT_WINXP #define NOMINMAX #include <Windows.h> #define at_scope_exit(cb) auto CONCAT(scope_exit_, __COUNTER__) = make_scope_guard(cb); #define CONCAT(a, b) CONCAT2(a, b) #define CONCAT2(a, b) a ## b template <class Callback> class scope_guard { public: scope_guard(Callback cb) : cb(cb), valid(true) { } scope_guard(scope_guard&& other) : cb(std::move(other.cb)), valid(std::move(other.valid)) { other.valid = false; } scope_guard& operator = (scope_guard&& other) { cb = std::move(other.cb); valid = std::move(other.valid); other.valid = false; return *this; } ~scope_guard() { if (valid) cb(); } private: scope_guard(const scope_guard& other); scope_guard& operator = (const scope_guard& other); private: Callback cb; bool valid; }; template <class Callback> scope_guard<Callback> make_scope_guard(Callback cb) { return scope_guard<Callback>(cb); } extern HINSTANCE DllInstance; #endif
#ifndef COMMON_INCLUDED #define COMMON_INCLUDED #pragma once #define _WIN32_WINNT _WIN32_WINNT_WINXP #define NOMINMAX #include <Windows.h> #define at_scope_exit(cb) auto CONCAT(scope_exit_, __COUNTER__) = make_scope_guard(cb); #define CONCAT(a, b) CONCAT2(a, b) #define CONCAT2(a, b) a ## b template <class Callback> class scope_guard { public: scope_guard(Callback cb) : cb(cb), valid(true) { } scope_guard(const scope_guard& other) = delete; scope_guard& operator = (const scope_guard& other) = delete; scope_guard(scope_guard&& other) : cb(std::move(other.cb)), valid(std::move(other.valid)) { other.valid = false; } scope_guard& operator = (scope_guard&& other) { cb = std::move(other.cb); valid = std::move(other.valid); other.valid = false; return *this; } ~scope_guard() { if (valid) cb(); } private: Callback cb; bool valid; }; template <class Callback> scope_guard<Callback> make_scope_guard(Callback cb) { return scope_guard<Callback>(cb); } extern HINSTANCE DllInstance; #endif
Use = delete for deleted members.
Use = delete for deleted members. git-svn-id: 43fbdb37a1fde3402d8d2922bf6a94a542354cf8@402 41632dc1-7a16-0410-8441-a1f66f767317
C
mit
Bekenn/wcdx,Bekenn/wcdx
a98d2b55c79a9959efd814bd9a316415ebc8dac8
bin/varnishtest/vtc_h2_priv.h
bin/varnishtest/vtc_h2_priv.h
#include "vqueue.h" #define ITER_DONE(iter) (iter->buf == iter->end ? hpk_done : hpk_more) struct dynhdr { struct hpk_hdr header; VTAILQ_ENTRY(dynhdr) list; }; VTAILQ_HEAD(dynamic_table,dynhdr); struct hpk_iter { struct hpk_ctx *ctx; char *orig; char *buf; char *end; }; const struct txt * tbl_get_key(const struct hpk_ctx *ctx, uint32_t index); const struct txt * tbl_get_value(const struct hpk_ctx *ctx, uint32_t index); void push_header (struct hpk_ctx *ctx, const struct hpk_hdr *h);
/*- * Copyright (c) 2008-2016 Varnish Software AS * All rights reserved. * * Author: Guillaume Quintard <[email protected]> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "vqueue.h" #define ITER_DONE(iter) (iter->buf == iter->end ? hpk_done : hpk_more) struct dynhdr { struct hpk_hdr header; VTAILQ_ENTRY(dynhdr) list; }; VTAILQ_HEAD(dynamic_table,dynhdr); struct hpk_iter { struct hpk_ctx *ctx; char *orig; char *buf; char *end; }; const struct txt * tbl_get_key(const struct hpk_ctx *ctx, uint32_t index); const struct txt * tbl_get_value(const struct hpk_ctx *ctx, uint32_t index); void push_header (struct hpk_ctx *ctx, const struct hpk_hdr *h);
Add a copyright to this file
Add a copyright to this file
C
bsd-2-clause
gquintard/Varnish-Cache,gquintard/Varnish-Cache,gquintard/Varnish-Cache,gquintard/Varnish-Cache
f0b45d88d5e1c1737e75cdf4eceda4e5a01461b5
include/sys/mman.h
include/sys/mman.h
/* * Copyright (C) 2014, Galois, Inc. * This sotware is distributed under a standard, three-clause BSD license. * Please see the file LICENSE, distributed with this software, for specific * terms and conditions. */ #ifndef MINLIBC_MMAN_H #define MINLIBC_MMAN_H #include <sys/types.h> #define PROT_NONE 0x0 #define PROT_READ 0x1 #define PROT_WRITE 0x2 #define PROT_EXEC 0x4 #define PROT_NOCACHE 0x8 #define PROT_READWRITE (PROT_READ | PROT_WRITE) #define MAP_ANON 0x20 #define MAP_ANONYMOUS 0x20 #define MAP_PRIVATE 0x02 #define MAP_FAILED ((void *) -1) void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t off); int munmap(void *start, size_t length); void *mremap(void *old_address, size_t old_size, size_t new_size, int flags); int mprotect(void *addr, size_t len, int prot); #endif
/* * Copyright (C) 2014, Galois, Inc. * This sotware is distributed under a standard, three-clause BSD license. * Please see the file LICENSE, distributed with this software, for specific * terms and conditions. */ #ifndef MINLIBC_MMAN_H #define MINLIBC_MMAN_H #include <sys/types.h> #define PROT_NONE 0x0 #define PROT_READ 0x1 #define PROT_WRITE 0x2 #define PROT_EXEC 0x4 #define PROT_NOCACHE 0x8 #define PROT_READWRITE (PROT_READ | PROT_WRITE) #define MAP_SHARED 0x01 #define MAP_PRIVATE 0x02 #define MAP_FIXED 0x10 #define MAP_ANON 0x20 #define MAP_ANONYMOUS 0x20 #define MAP_FAILED ((void *) -1) #define MS_ASYNC 1 #define MS_INVALIDATE 2 #define MS_SYNC 4 #define MADV_NORMAL 0 #define MADV_RANDOM 1 #define MADV_SEQUENTIAL 2 #define MADV_WILLNEED 3 #define MADV_DONTNEED 4 void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t off); int munmap(void *start, size_t length); void *mremap(void *old_address, size_t old_size, size_t new_size, int flags); int mprotect(void *addr, size_t len, int prot); #endif
Add more flags for mmap() to ignore.
Add more flags for mmap() to ignore.
C
bsd-3-clause
GaloisInc/minlibc,GaloisInc/minlibc
532931d29b6fb5e28f3aa3904f20b097014ab5e8
include/LoggerStream.h
include/LoggerStream.h
// ============================================================================= // Licensed under the MIT License <http://opensource.org/licenses/MIT>. // Copyright (c) 2017 Kevin T Qi // // 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 #include "LoggerSink.h" #include <memory> #include <sstream> #include <string> #include <atomic> namespace slogger { class LoggerStreamFlush { public: static const LoggerStreamFlush &end() { static LoggerStreamFlush instance; return instance; } }; class LoggerStream; typedef std::shared_ptr<LoggerStream> LoggerStreamPtr; class LoggerStream { private: std::stringstream mLogStream; ILoggerSinkPtr mSink; std::atomic<bool> mInUse; template<typename T> friend LoggerStreamPtr &operator<<(LoggerStreamPtr &logStrm, const T &value); friend LoggerStreamPtr &operator<<(LoggerStreamPtr &logStrm, const LoggerStreamFlush &el); void flush() { if (mSink) { mLogStream << std::endl; mSink->flush(mLogStream.str()); mLogStream.clear(); mLogStream.str(""); mInUse = false; } } public: LoggerStream(ILoggerSinkPtr sink = nullptr) : mSink(sink), mInUse(false) { } ~LoggerStream() { mInUse = false; } bool inUse() { return mInUse; } }; template<typename T> inline LoggerStreamPtr &operator<<(LoggerStreamPtr &logStrm, const T &value) { if (logStrm && logStrm->mSink) { logStrm->mInUse = true; logStrm->mLogStream << value; } return logStrm; } inline LoggerStreamPtr &operator<<(LoggerStreamPtr &logStrm, const LoggerStreamFlush &el) { if (logStrm && logStrm->mSink) { logStrm->flush(); } return logStrm; } } /* namespace slogger */
Implement operator<< with template method
Implement operator<< with template method
C
mit
kevintqi/stream-like-logger
672c11b41fe66f96a3f3c6b16f839c1edf66a384
test/CFrontend/2005-04-09-ComplexOps.c
test/CFrontend/2005-04-09-ComplexOps.c
// %llvmgcc %s -S -o - #include <math.h> #define I 1.0iF double __complex test(double X) { return ~-(X*I); } _Bool EQ(double __complex A, double __complex B) { return A == B; } _Bool NE(double __complex A, double __complex B) { return A != B; }
// RUN: %llvmgcc %s -S -o - #include <math.h> #define I 1.0iF double __complex test(double X) { return ~-(X*I); } _Bool EQ(double __complex A, double __complex B) { return A == B; } _Bool NE(double __complex A, double __complex B) { return A != B; }
Add the RUN: prefix to the start of the run line so this test doesn't fail. BTW .. isn't the date on this funky? We haven't reachec 2005-05-09 yet???
Add the RUN: prefix to the start of the run line so this test doesn't fail. BTW .. isn't the date on this funky? We haven't reachec 2005-05-09 yet??? git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@21432 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm
15378c98e1987964299a406232dc405a11c7a413
trace.h
trace.h
#ifndef _TRACE_H_ #define _TRACE_H_ #include <stdio.h> #include <errno.h> #define TRACE ERROR #define ERROR(fmt,arg...) \ fprintf(stderr, "%s: "fmt, program_invocation_short_name, ##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 #define ERROR(fmt,arg...) \ fprintf(stderr, "%s: "fmt, program_invocation_short_name, ##arg) #define FATAL(fmt,arg...) do { \ ERROR(fmt, ##arg); \ exit(1); \ } while (0) #endif
Make TRACE depend on DEBUG.
Make TRACE depend on DEBUG.
C
lgpl-2.1
dimm0/tacc_stats,sdsc/xsede_stats,rtevans/tacc_stats_old,ubccr/tacc_stats,aaichsmn/tacc_stats,TACC/tacc_stats,dimm0/tacc_stats,rtevans/tacc_stats_old,sdsc/xsede_stats,TACC/tacc_stats,TACCProjects/tacc_stats,dimm0/tacc_stats,TACCProjects/tacc_stats,TACCProjects/tacc_stats,TACC/tacc_stats,aaichsmn/tacc_stats,ubccr/tacc_stats,aaichsmn/tacc_stats,ubccr/tacc_stats,TACC/tacc_stats,sdsc/xsede_stats,sdsc/xsede_stats,rtevans/tacc_stats_old,dimm0/tacc_stats,dimm0/tacc_stats,ubccr/tacc_stats,ubccr/tacc_stats,aaichsmn/tacc_stats,TACC/tacc_stats,TACCProjects/tacc_stats
3124e376b93054e742b6cd302e5c71bf8ccf2949
tests/regression/15-deadlock/14-missing-unlock.c
tests/regression/15-deadlock/14-missing-unlock.c
// PARAM: --set ana.activated[+] deadlock --set ana.activated[+] threadJoins #include <pthread.h> int x; pthread_mutex_t m1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m2 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m3 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m4 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m5 = PTHREAD_MUTEX_INITIALIZER; void *thread() { pthread_mutex_lock(&m2); pthread_mutex_lock(&m1); // We forgot to unlock // pthread_mutex_unlock(&m2); pthread_mutex_unlock(&m1); return NULL; } void *noOpThread() { return NULL; } int main() { pthread_t tid1; pthread_t tid2; pthread_create(&tid1, NULL, noOpThread, NULL); pthread_create(&tid2, NULL, thread, NULL); pthread_join(tid2,NULL); pthread_mutex_lock(&m2); //DEADLOCK return 0; }
Add problematic example with missed must deadlock
Add problematic example with missed must deadlock
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
2873c139d02d994834029349bc72b417108bad6c
tests/regression/24-octagon/17-problem-pointer.c
tests/regression/24-octagon/17-problem-pointer.c
void change(int *p) { (*p)++; } int a; int main() { a = 5; int *p = &a; change(p); assert(a - 6 == 0); return 0; }
// PARAM: --sets solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','octApron']" void change(int *p) { (*p)++; } int a; int main() { a = 5; int *p = &a; change(p); assert(a - 6 == 0); return 0; }
Add parameters to a test
Add parameters to a test
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
45cc7865e4142582460218bed288d41d60428bb4
src/chrono_vehicle/tracked_vehicle/ChTrackSubsysDefs.h
src/chrono_vehicle/tracked_vehicle/ChTrackSubsysDefs.h
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= // Authors: Radu Serban // ============================================================================= // // Various utility classes for tracked vehicle subsystems. // // TODO: combine with ChSubsysDefs.h // // ============================================================================= #ifndef CH_TRACK_SUBSYS_DEFS_H #define CH_TRACK_SUBSYS_DEFS_H namespace chrono { namespace vehicle { namespace TrackCollide { enum Enum { NONE = 0, SPROCKET_LEFT = 1 << 0, SPROCKET_RIGHT = 1 << 1, IDLER_LEFT = 1 << 2, IDLER_RIGHT = 1 << 3, WHEELS_LEFT = 1 << 4, WHEELS_RIGHT = 1 << 5, SHOES_LEFT = 1 << 6, SHOES_RIGHT = 1 << 7 }; } namespace TrackCollisionFamily { enum Enum { CHASSIS, IDLERS, WHEELS, SHOES }; } } // end namespace vehicle } // end namespace chrono #endif
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= // Authors: Radu Serban // ============================================================================= // // Various utility classes for tracked vehicle subsystems. // // TODO: combine with ChSubsysDefs.h // // ============================================================================= #ifndef CH_TRACK_SUBSYS_DEFS_H #define CH_TRACK_SUBSYS_DEFS_H namespace chrono { namespace vehicle { namespace TrackCollide { enum Enum { NONE = 0, SPROCKET_LEFT = 1 << 0, SPROCKET_RIGHT = 1 << 1, IDLER_LEFT = 1 << 2, IDLER_RIGHT = 1 << 3, WHEELS_LEFT = 1 << 4, WHEELS_RIGHT = 1 << 5, SHOES_LEFT = 1 << 6, SHOES_RIGHT = 1 << 7, ALL = 0xFFFF }; } namespace TrackCollisionFamily { enum Enum { CHASSIS, IDLERS, WHEELS, SHOES }; } } // end namespace vehicle } // end namespace chrono #endif
Add enum constant TrackCollide::ALL with a value 0xFFFF.
Add enum constant TrackCollide::ALL with a value 0xFFFF. This allows statements such as: vehicle.SetCollide(TrackCollide::ALL & ~TrackCollide::IDLER_RIGHT); to enable contact on all parts except the right idler wheel.
C
bsd-3-clause
dariomangoni/chrono,rserban/chrono,armanpazouki/chrono,amelmquist/chrono,jcmadsen/chrono,dariomangoni/chrono,andrewseidl/chrono,armanpazouki/chrono,jcmadsen/chrono,projectchrono/chrono,rserban/chrono,Milad-Rakhsha/chrono,Milad-Rakhsha/chrono,armanpazouki/chrono,andrewseidl/chrono,rserban/chrono,jcmadsen/chrono,rserban/chrono,amelmquist/chrono,amelmquist/chrono,dariomangoni/chrono,armanpazouki/chrono,andrewseidl/chrono,Milad-Rakhsha/chrono,amelmquist/chrono,projectchrono/chrono,armanpazouki/chrono,jcmadsen/chrono,tjolsen/chrono,amelmquist/chrono,tjolsen/chrono,rserban/chrono,jcmadsen/chrono,andrewseidl/chrono,tjolsen/chrono,projectchrono/chrono,armanpazouki/chrono,andrewseidl/chrono,tjolsen/chrono,rserban/chrono,projectchrono/chrono,projectchrono/chrono,dariomangoni/chrono,dariomangoni/chrono,dariomangoni/chrono,tjolsen/chrono,Milad-Rakhsha/chrono,projectchrono/chrono,Milad-Rakhsha/chrono,Milad-Rakhsha/chrono,jcmadsen/chrono,amelmquist/chrono,rserban/chrono,jcmadsen/chrono
380587f16b04bf1ad24b8cfb7a105711e8e8ab62
Source/PKMacros.h
Source/PKMacros.h
// // PKMacros.h // PKToolBox // // Created by Pavel Kunc on 17/07/2013. // Copyright (c) 2013 PKToolBox. All rights reserved. // #define PK_NIL_IF_NULL(obj) ((obj == [NSNull null]) ? nil : obj) #define PK_NULL_IF_NIL(obj) ((obj == nil) ? [NSNull null] : obj) #define PK_BOOL_TO_LOCALIZED_STRING(val) ((val == YES) ? NSLocalizedString(@"Yes", nil) : NSLocalizedString(@"No", nil)) #define PK_IS_WIDESCREEN ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON ) #define PK_IS_IPHONE ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) #define PK_IS_IPHONE_5 ( PK_IS_IPHONE && PK_IS_WIDESCREEN ) #define PK_IS_IOS7 ( floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1 )
// // PKMacros.h // PKToolBox // // Created by Pavel Kunc on 17/07/2013. // Copyright (c) 2013 PKToolBox. All rights reserved. // #pragma mark - Foundation #define PK_NIL_IF_NULL(obj) ((obj == (id)[NSNull null]) ? nil : obj) #define PK_NULL_IF_NIL(obj) ((obj == nil) ? [NSNull null] : obj) #define PK_DEFAULT_IF_NIL(obj,default) ((obj == nil) ? default : obj) #define PK_BOOL_TO_LOCALIZED_STRING(val) ((val == YES) ? NSLocalizedString(@"Yes", nil) : NSLocalizedString(@"No", nil)) #define PK_DEGREES_TO_RADIANS(degrees) ( degrees * (M_PI / 180.0) ) #define PK_RADIANS_TO_DEGREES(radians) ( radians * (180.0 / M_PI) ) #pragma mark - UI related #define PK_IS_WIDESCREEN ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON ) #define PK_IS_IPHONE ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) #define PK_IS_IPHONE_5 ( PK_IS_IPHONE && PK_IS_WIDESCREEN ) #define PK_IS_IOS7 ( floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1 )
Fix warnings and reorganize file.
Fix warnings and reorganize file.
C
mit
prajput/pkCode,pk/pktoolbox,prajput/pkCode,pk/pktoolbox
ca4f57fdff9f6c875cd96335dc6d73206bcb8fce
lua/myprog.c
lua/myprog.c
#include <math.h> #include "lua5.2/lua.h" #include "lua5.2/lauxlib.h" // Functions exposed to Lua static int l_sin(lua_State *L) { // Verify that the argument is a number double d = luaL_checknumber(L, 1); // Call the function, and return the result lua_pushnumber(L, sin(d)); return 1; // Single result } static int l_cos(lua_State *L) { double d = luaL_checknumber(L, 1); lua_pushnumber(L, cos(d)); return 1; } static int l_tan(lua_State *L) { double d = luaL_checknumber(L, 1); lua_pushnumber(L, tan(d)); return 1; } int main() { // Setup Lua lua_State *L = luaL_newstate(); luaL_openlibs(L); // Expose the functions to Lua lua_pushcfunction(L, l_sin); lua_setglobal(L, "lsin"); lua_pushcfunction(L, l_cos); lua_setglobal(L, "lcos"); lua_pushcfunction(L, l_tan); lua_setglobal(L, "ltan"); // Load and run the debug file luaL_dofile(L, "debug.lua"); printf("Done\n"); return 0; }
#include <math.h> #include "lua5.2/lua.h" #include "lua5.2/lauxlib.h" // Functions exposed to Lua static int l_sin(lua_State *L) { double value_as_number = luaL_checknumber(L, 1); // Call the function, and return the result lua_pushnumber(L, sin(value_as_number)); return 1; // Single result } static int l_cos(lua_State *L) { double value_as_number = luaL_checknumber(L, 1); lua_pushnumber(L, cos(value_as_number)); return 1; } static int l_tan(lua_State *L) { double value_as_number = luaL_checknumber(L, 1); lua_pushnumber(L, tan(value_as_number)); return 1; } int main() { // Setup Lua lua_State *L = luaL_newstate(); luaL_openlibs(L); // Expose the functions to Lua lua_pushcfunction(L, l_sin); lua_setglobal(L, "lsin"); lua_pushcfunction(L, l_cos); lua_setglobal(L, "lcos"); lua_pushcfunction(L, l_tan); lua_setglobal(L, "ltan"); // Load and run the debug file luaL_dofile(L, "debug.lua"); puts("Done"); return 0; }
Change comment into descriptive variable name
Change comment into descriptive variable name
C
apache-2.0
dspinellis/effective-debugging,dspinellis/effective-debugging,dspinellis/effective-debugging,dspinellis/effective-debugging,dspinellis/effective-debugging
45f62c1e3f74333affdeda3053630e78fcaa4aa1
bibdesk/BDSKSearchGroupViewController.h
bibdesk/BDSKSearchGroupViewController.h
// // BDSKSearchGroupViewController.h // Bibdesk // // Created by Christiaan Hofman on 1/2/07. /* This software is Copyright (c) 2007 Christiaan Hofman. 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 Christiaan Hofman nor the names of any 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 OWNER 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. */ #import <Cocoa/Cocoa.h> @class BDSKCollapsibleView, BDSKEdgeView, BDSKSearchGroup; @interface BDSKSearchGroupViewController : NSWindowController { IBOutlet BDSKCollapsibleView *view; IBOutlet BDSKEdgeView *edgeView; IBOutlet NSSearchField *searchField; IBOutlet NSButton *searchButton; BDSKSearchGroup *group; } - (NSView *)view; - (BDSKSearchGroup *)group; - (void)setGroup:(BDSKSearchGroup *)newGroup; - (IBAction)changeSearchTerm:(id)sender; - (IBAction)nextSearch:(id)sender; @end
Add new header file. (or: xcode is stupid)
Add new header file. (or: xcode is stupid) git-svn-id: cb3fc60f0f557b927b8032d8a94e869b6f9f230b@318 0fceea05-a30d-0410-8a8b-80ef821fb0a1
C
bsd-3-clause
jasongrout/skim,camillobruni/skim,jasongrout/skim,camillobruni/skim,camillobruni/skim,camillobruni/skim
759f87259e5cfada2a9d84118e26d21d227e3718
Portal/Portal.h
Portal/Portal.h
// // Portal.h // Portal // // Created by Guido Marucci Blas on 3/14/17. // Copyright © 2017 Guido Marucci Blas. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for Portal. FOUNDATION_EXPORT double PortalVersionNumber; //! Project version string for Portal. FOUNDATION_EXPORT const unsigned char PortalVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <Portal/PublicHeader.h> #import <Portal/YGLayout.h> #import <Portal/UIView+Yoga.h>
// // Portal.h // Portal // // Created by Guido Marucci Blas on 3/14/17. // Copyright © 2017 Guido Marucci Blas. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for Portal. FOUNDATION_EXPORT double PortalVersionNumber; //! Project version string for Portal. FOUNDATION_EXPORT const unsigned char PortalVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <Portal/PublicHeader.h> #import <Portal/Yoga.h> #import <Portal/YGNodeList.h> #import <Portal/YGLayout.h> #import <Portal/UIView+Yoga.h>
Add missing Yoga headers to umbrella header.
Add missing Yoga headers to umbrella header. This is needed to avoid warnings.
C
mit
guidomb/Portal,guidomb/Portal,guidomb/Portal,guidomb/Portal
aa1a7a8b481411f027d3931a2d52382398345ac1
tests/test-x509.c
tests/test-x509.c
#include <mongoc.h> #include "mongoc-ssl-private.h" #include "TestSuite.h" #ifdef MONGOC_ENABLE_OPENSSL static void test_extract_subject (void) { char *subject; subject = mongoc_ssl_extract_subject (CERT_SERVER, NULL); ASSERT_CMPSTR (subject, "C=IS,ST=Reykjavik,L=Reykjavik,O=MongoDB,OU=Drivers,CN=server"); bson_free (subject); subject = mongoc_ssl_extract_subject (CERT_CLIENT, NULL); ASSERT_CMPSTR (subject, "C=IS,ST=Kopavogur,L=Kopavogur,O=MongoDB,OU=Drivers,CN=client"); bson_free (subject); } #endif void test_x509_install (TestSuite *suite) { #ifdef MONGOC_ENABLE_OPENSSL TestSuite_Add (suite, "/X509/extract_subject", test_extract_subject); #endif }
#include <mongoc.h> #include "mongoc-ssl-private.h" #include "TestSuite.h" #ifdef MONGOC_ENABLE_OPENSSL static void test_extract_subject (void) { char *subject; subject = mongoc_ssl_extract_subject (CERT_SERVER, NULL); ASSERT_CMPSTR (subject, "C=US,ST=California,L=Palo Alto,O=MongoDB,OU=Drivers,CN=server"); bson_free (subject); subject = mongoc_ssl_extract_subject (CERT_CLIENT, NULL); ASSERT_CMPSTR (subject, "C=NO,ST=Oslo,L=Oslo,O=MongoDB,OU=Drivers,CN=client"); bson_free (subject); } #endif void test_x509_install (TestSuite *suite) { #ifdef MONGOC_ENABLE_OPENSSL TestSuite_Add (suite, "/X509/extract_subject", test_extract_subject); #endif }
Fix last-minute certificate subject changes
Fix last-minute certificate subject changes
C
apache-2.0
christopherjwang/mongo-c-driver,mongodb/mongo-c-driver,bjori/mongo-c-driver,ajdavis/mongo-c-driver,ajdavis/mongo-c-driver,beingmeta/mongo-c-driver,jmikola/mongo-c-driver,ajdavis/mongo-c-driver,mongodb/mongo-c-driver,acmorrow/mongo-c-driver,Machyne/mongo-c-driver,rcsanchez97/mongo-c-driver,christopherjwang/mongo-c-driver,Machyne/mongo-c-driver,Machyne/mongo-c-driver,acmorrow/mongo-c-driver,jmikola/mongo-c-driver,remicollet/mongo-c-driver,bjori/mongo-c-driver,bjori/mongo-c-driver,jmikola/mongo-c-driver,bjori/mongo-c-driver,Convey-Compliance/mongo-c-driver,Convey-Compliance/mongo-c-driver,mschoenlaub/mongo-c-driver,mschoenlaub/mongo-c-driver,christopherjwang/mongo-c-driver,bjori/mongo-c-driver,remicollet/mongo-c-driver,derickr/mongo-c-driver,ajdavis/mongo-c-driver,jmikola/mongo-c-driver,remicollet/mongo-c-driver,remicollet/mongo-c-driver,beingmeta/mongo-c-driver,rcsanchez97/mongo-c-driver,beingmeta/mongo-c-driver,mongodb/mongo-c-driver,mschoenlaub/mongo-c-driver,Machyne/mongo-c-driver,beingmeta/mongo-c-driver,ajdavis/mongo-c-driver,ajdavis/mongo-c-driver,jmikola/mongo-c-driver,bjori/mongo-c-driver,rcsanchez97/mongo-c-driver,jmikola/mongo-c-driver,malexzx/mongo-c-driver,rcsanchez97/mongo-c-driver,malexzx/mongo-c-driver,derickr/mongo-c-driver,remicollet/mongo-c-driver,derickr/mongo-c-driver,acmorrow/mongo-c-driver,Convey-Compliance/mongo-c-driver,derickr/mongo-c-driver,mongodb/mongo-c-driver,malexzx/mongo-c-driver,derickr/mongo-c-driver,acmorrow/mongo-c-driver,mschoenlaub/mongo-c-driver,malexzx/mongo-c-driver,acmorrow/mongo-c-driver,derickr/mongo-c-driver,beingmeta/mongo-c-driver,Convey-Compliance/mongo-c-driver,bjori/mongo-c-driver,mongodb/mongo-c-driver,derickr/mongo-c-driver,ajdavis/mongo-c-driver,rcsanchez97/mongo-c-driver,rcsanchez97/mongo-c-driver,beingmeta/mongo-c-driver,jmikola/mongo-c-driver,beingmeta/mongo-c-driver,remicollet/mongo-c-driver,remicollet/mongo-c-driver,beingmeta/mongo-c-driver,christopherjwang/mongo-c-driver,acmorrow/mongo-c-driver,acmorrow/mongo-c-driver,mongodb/mongo-c-driver,Convey-Compliance/mongo-c-driver,mongodb/mongo-c-driver,rcsanchez97/mongo-c-driver
b834040b9426954cde912b685af7505b741dab4a
control.c
control.c
#include <stdio.h> #include <string.h> #include <math.h> struct Packet { unsigned int status: 1; unsigned int group: 2; unsigned int plug: 2; }; unsigned int packet_to_binary(struct Packet packet) { unsigned int binary = (packet.status << 7); binary |= ((packet.group & 0x3) << 2); binary |= (packet.plug & 0x3); return binary & 0xFF; } void binary_to_packet(struct Packet *packet, unsigned int binary) { packet->status = (binary >> 7); packet->group = (binary >> 2) & 0x3; packet->plug = binary & 0x3; } void printBinary(int num, int digits) { int shift = digits - 1; int current = pow(2, shift); while (current > 0) { printf("%d", ((num & current) >> shift) & 1); shift--; current /= 2; } printf("\n"); }
#include <stdio.h> #include <string.h> #include <math.h> struct Packet { unsigned int status: 1; unsigned int group: 2; unsigned int plug: 2; }; unsigned int packet_to_binary(struct Packet packet) { unsigned int binary = (packet.status << 7); binary |= ((packet.group & 0x3) << 2); binary |= (packet.plug & 0x3); return binary & 0xFF; } void binary_to_packet(struct Packet *packet, unsigned int binary) { packet->status = (binary >> 7); packet->group = (binary >> 2) & 0x3; packet->plug = binary & 0x3; } void btoa(int num, char *buf, int digits) { int shift = digits - 1; int current = pow(2, shift); char digit[2]; while (current > 0) { sprintf(digit, "%d", ((num & current) >> shift) & 1); strncat(buf, digit, 1); shift--; current /= 2; } strcat(buf, "\0"); }
Rename printBinary function and write to string instead
Rename printBinary function and write to string instead printBinary is now called btoa (binary to ascii) btoa accepts the number, a buffer and a number of digits buffer length must be (digits + 1)
C
agpl-3.0
jackwilsdon/lightcontrol,jackwilsdon/lightcontrol
ac16931e26eee975b8a80dd7aa36c393de59a349
src/libclientserver/Client.h
src/libclientserver/Client.h
/** * @class Client * @brief Factor class for being able to generate connections * * This class will create connections using the common interface ClientBase * which is based on connections strings. The connections should be completly * abstracted from the parent classes other than this entry point. */ class Client { public: static ClientBase *Create(const std::string &ConnectionString); static ClientBase *CreateUnix(const std::string &ConnectionString); static ClientBase *CreateTcp(const std::string &ConnectionString); };
/** * @class Client * @brief Factor class for being able to generate connections * * This class will create connections using the common interface ClientBase * which is based on connections strings. The connections should be completly * abstracted from the parent classes other than this entry point. */ class Client { public: static ClientBase *Create(const std::string &ConnectionString); static ClientBase *CreateUnix(const std::string &ConnectionString); static ClientBase *CreateUnixSelected(const std::string &ConnectionString); static ClientBase *CreateTcp(const std::string &ConnectionString); };
Fix compile error with missing function declare
Fix compile error with missing function declare
C
mit
mistralol/libclientserver,mistralol/libclientserver
e6f3746ef6ef8910e3e420e78f2a073f8e5a9084
src/nbds.0.4.3/include/mem.h
src/nbds.0.4.3/include/mem.h
/* * Written by Josh Dybnis and released to the public domain, as explained at * http://creativecommons.org/licenses/publicdomain */ #ifndef MEM_H #define MEM_H void *nbd_malloc (size_t n) __attribute__((malloc, alloc_size(1))); void nbd_free (void *x) __attribute__((nonnull)); #endif//MEM_H
/* * Written by Josh Dybnis and released to the public domain, as explained at * http://creativecommons.org/licenses/publicdomain */ #ifndef MEM_H #define MEM_H void *nbd_malloc (size_t n) __attribute__((malloc)); void nbd_free (void *x) __attribute__((nonnull)); #endif//MEM_H
Remove a warning from NBDS.
Remove a warning from NBDS.
C
mit
eaburns/pbnf,eaburns/pbnf,eaburns/pbnf,eaburns/pbnf
450fc5d62732ee8a97220114a02c8393c1b67182
include/kernel.h
include/kernel.h
#ifndef __KERNEL_H__ #define __KERNEL_H__ #include <task.h> typedef struct kernel_global { TaskList *task_list; } KernelGlobal; #define TASK_MAX 30 #define TASK_STACK_SIZE 1000 #define TASK_PRIORITY_MAX 10 #define SWI_ENTRY_POINT 0x28 #define DATA_REGION_BASE 0x218000 #define CPU_MODE_USER 0x10 #define CPU_MODE_SVC 0x13 #define CPU_MODE_SYS 0x1f #endif // __KERNEL_H__
#ifndef __KERNEL_H__ #define __KERNEL_H__ #include <task.h> typedef struct kernel_global { TaskList *tlist; FreeList *flist; } KernelGlobal; #define TASK_MAX 30 #define TASK_STACK_SIZE 512 #define TASK_PRIORITY_MAX 10 #define SWI_ENTRY_POINT 0x28 #define DATA_REGION_BASE 0x218000 #define CPU_MODE_USER 0x10 #define CPU_MODE_SVC 0x13 #define CPU_MODE_SYS 0x1f #endif // __KERNEL_H__
Modify KernelGlobal structure; decrease TASK_STACK_SIZE
Modify KernelGlobal structure; decrease TASK_STACK_SIZE
C
mit
gregwym/ARM-Micro-Kernel,gregwym/ARM-Micro-Kernel,gregwym/ARM-Micro-Kernel
a726bc24664b69fd2f5899dab2a6155d3bd6b963
Core/CoreDefines.h
Core/CoreDefines.h
// For conditions of distribution and use, see copyright notice in license.txt #ifndef incl_CoreDefines_h #define incl_CoreDefines_h // useful defines #define SAFE_DELETE(p) { delete p; p=0; } #define SAFE_DELETE_ARRAY(p) { delete [] p; p=0; } #define NUMELEMS(x) (sizeof(x)/sizeof(x[0])) /// Use this template to downcast from a base class to a derived class when you know by static code analysis what the derived /// type has to be and don't want to pay the runtime performance incurred by dynamic_casting. In debug mode, the proper /// derived type will be assert()ed, but in release mode this be just the same as using static_cast. /// Repeating to make a note: In RELEASE mode, checked_static_cast == static_cast. It is *NOT* a substitute to use in places /// where you really need a dynamic_cast. template<typename Dst, typename Src> inline Dst checked_static_cast(Src src) { assert(dynamic_cast<Dst>(src) != 0); return static_cast<Dst>(src); } //! use to suppress warning C4101 (unreferenced local variable) #define UNREFERENCED_PARAM(P) (P) /// Use for QObjects #define SAFE_DELETE_LATER(p) { if ((p)) (p)->deleteLater(); (p) = 0; } #endif
// For conditions of distribution and use, see copyright notice in license.txt #ifndef incl_CoreDefines_h #define incl_CoreDefines_h // useful defines #define SAFE_DELETE(p) { delete p; p=0; } #define SAFE_DELETE_ARRAY(p) { delete [] p; p=0; } #define NUMELEMS(x) (sizeof(x)/sizeof(x[0])) /// Use this template to downcast from a base class to a derived class when you know by static code analysis what the derived /// type has to be and don't want to pay the runtime performance incurred by dynamic_casting. In debug mode, the proper /// derived type will be assert()ed, but in release mode this be just the same as using static_cast. /// Repeating to make a note: In RELEASE mode, checked_static_cast == static_cast. It is *NOT* a substitute to use in places /// where you really need a dynamic_cast. template<typename Dst, typename Src> inline Dst checked_static_cast(Src src) { assert(src == 0 || dynamic_cast<Dst>(src) != 0); return static_cast<Dst>(src); } //! use to suppress warning C4101 (unreferenced local variable) #define UNREFERENCED_PARAM(P) (P) /// Use for QObjects #define SAFE_DELETE_LATER(p) { if ((p)) (p)->deleteLater(); (p) = 0; } #endif
Fix checked_static_cast to allow null pointers.
Fix checked_static_cast to allow null pointers.
C
apache-2.0
antont/tundra,jesterKing/naali,antont/tundra,antont/tundra,realXtend/tundra,pharos3d/tundra,jesterKing/naali,jesterKing/naali,AlphaStaxLLC/tundra,antont/tundra,BogusCurry/tundra,BogusCurry/tundra,BogusCurry/tundra,antont/tundra,realXtend/tundra,jesterKing/naali,AlphaStaxLLC/tundra,pharos3d/tundra,AlphaStaxLLC/tundra,BogusCurry/tundra,jesterKing/naali,pharos3d/tundra,AlphaStaxLLC/tundra,pharos3d/tundra,BogusCurry/tundra,antont/tundra,BogusCurry/tundra,AlphaStaxLLC/tundra,realXtend/tundra,antont/tundra,jesterKing/naali,pharos3d/tundra,pharos3d/tundra,realXtend/tundra,realXtend/tundra,realXtend/tundra,AlphaStaxLLC/tundra,jesterKing/naali
abd31a208639f0be773f35d1c161fe7fdcb138db
src/main/entity/components/SkillComponent.h
src/main/entity/components/SkillComponent.h
#ifndef SKILLCOMPONENT_H_ #define SKILLCOMPONENT_H_ /** * Data structure to represent an Entity's skill. */ typedef struct { int ranks; ///< Current ranks in the skill int xp; ///< Amount of XP earned towards next rank } SkillComponent; /** * Enumeration for identifying different skills. */ enum skill_t { NOSKILL, Melee, Swords, BastardSword, Maces, SpikedMace, FirstAid }; /** * This array defines our parent skill relationships. * * If a skill's parent is NOSKILL, it has no parent. */ const skill_t* PARENT_SKILLS = { NOSKILL, NOSKILL, Melee, Swords, Melee, Maces, NOSKILL }; #endif
#ifndef SKILLCOMPONENT_H_ #define SKILLCOMPONENT_H_ /** * Data structure to represent an Entity's skill. */ typedef struct { int ranks; ///< Current ranks in the skill int xp; ///< Amount of XP earned towards next rank } SkillComponent; /** * Enumeration for identifying different skills. */ enum skill_t { Melee, Swords, BastardSword, Maces, SpikedMace, FirstAid }; /** * This array defines our parent skill relationships. * * If a skill's parent is itself, it has no parent. */ const skill_t PARENT_SKILLS[] = { Melee, Melee, Swords, Melee, Maces, FirstAid }; #endif
Fix PARENT_SKILLS declaration; remove NOSKILL
Fix PARENT_SKILLS declaration; remove NOSKILL Why would anyone want to be unskilled anyway?
C
mit
Kromey/roglick
0a574c093691f0a16a3016456475ec98d57c1109
src/ia64/Gget_proc_info.c
src/ia64/Gget_proc_info.c
/* libunwind - a platform-independent unwind library Copyright (C) 2002 Hewlett-Packard Co Contributed by David Mosberger-Tang <[email protected]> This file is part of libunwind. 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. */ #include "unwind_i.h" int unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi) { struct ia64_cursor *c = (struct ia64_cursor *) cursor; int ret; if ((ret = ia64_make_proc_info (c)) < 0) return ret; *pi = c->pi; return 0; }
Call ia64_make_proc_info() to ensure that the proc_info is valid.
(unw_get_proc_info): Call ia64_make_proc_info() to ensure that the proc_info is valid. 2002/12/11 12:26:26-08:00 mostang.com!davidm Rename: src/ia64/Lget_proc_info.c -> src/ia64/Gget_proc_info.c (Logical change 1.30)
C
mit
dagar/libunwind,geekboxzone/mmallow_external_libunwind,krytarowski/libunwind,cms-externals/libunwind,geekboxzone/lollipop_external_libunwind,rantala/libunwind,geekboxzone/lollipop_external_libunwind,unkadoug/libunwind,zeldin/platform_external_libunwind,libunwind/libunwind,CyanogenMod/android_external_libunwind,android-ia/platform_external_libunwind,tronical/libunwind,rogwfu/libunwind,zliu2014/libunwind-tilegx,DroidSim/platform_external_libunwind,igprof/libunwind,zliu2014/libunwind-tilegx,cloudius-systems/libunwind,evaautomation/libunwind,dagar/libunwind,igprof/libunwind,vtjnash/libunwind,igprof/libunwind,pathscale/libunwind,ehsan/libunwind,pathscale/libunwind,atanasyan/libunwind,fillexen/libunwind,joyent/libunwind,evaautomation/libunwind,krytarowski/libunwind,SyndicateRogue/libunwind,geekboxzone/mmallow_external_libunwind,CyanogenMod/android_external_libunwind,zeldin/platform_external_libunwind,android-ia/platform_external_libunwind,zliu2014/libunwind-tilegx,0xlab/0xdroid-external_libunwind,tronical/libunwind,androidarmv6/android_external_libunwind,SyndicateRogue/libunwind,lat/libunwind,wdv4758h/libunwind,frida/libunwind,dreal-deps/libunwind,tony/libunwind,androidarmv6/android_external_libunwind,vegard/libunwind,lat/libunwind,ehsan/libunwind,adsharma/libunwind,cloudius-systems/libunwind,dropbox/libunwind,djwatson/libunwind,frida/libunwind,rntz/libunwind,Keno/libunwind,maltek/platform_external_libunwind,vtjnash/libunwind,atanasyan/libunwind,rantala/libunwind,atanasyan/libunwind-android,olibc/libunwind,yuyichao/libunwind,Keno/libunwind,fdoray/libunwind,olibc/libunwind,dagar/libunwind,project-zerus/libunwind,martyone/libunwind,bo-on-software/libunwind,tony/libunwind,atanasyan/libunwind-android,wdv4758h/libunwind,tony/libunwind,atanasyan/libunwind,Chilledheart/libunwind,rantala/libunwind,yuyichao/libunwind,wdv4758h/libunwind,maltek/platform_external_libunwind,pathscale/libunwind,tkelman/libunwind,dreal-deps/libunwind,olibc/libunwind,cloudius-systems/libunwind,yuyichao/libunwind,unkadoug/libunwind,djwatson/libunwind,vtjnash/libunwind,bo-on-software/libunwind,maltek/platform_external_libunwind,bo-on-software/libunwind,tkelman/libunwind,project-zerus/libunwind,Chilledheart/libunwind,adsharma/libunwind,fdoray/libunwind,android-ia/platform_external_libunwind,tkelman/libunwind,fillexen/libunwind,DroidSim/platform_external_libunwind,geekboxzone/lollipop_external_libunwind,Keno/libunwind,cms-externals/libunwind,mpercy/libunwind,ehsan/libunwind,mpercy/libunwind,frida/libunwind,rogwfu/libunwind,rntz/libunwind,joyent/libunwind,geekboxzone/mmallow_external_libunwind,adsharma/libunwind,lat/libunwind,SyndicateRogue/libunwind,unkadoug/libunwind,jrmuizel/libunwind,zeldin/platform_external_libunwind,martyone/libunwind,atanasyan/libunwind-android,mpercy/libunwind,androidarmv6/android_external_libunwind,krytarowski/libunwind,tronical/libunwind,martyone/libunwind,jrmuizel/libunwind,project-zerus/libunwind,dreal-deps/libunwind,dropbox/libunwind,rntz/libunwind,rogwfu/libunwind,libunwind/libunwind,DroidSim/platform_external_libunwind,fillexen/libunwind,CyanogenMod/android_external_libunwind,djwatson/libunwind,libunwind/libunwind,joyent/libunwind,0xlab/0xdroid-external_libunwind,evaautomation/libunwind,vegard/libunwind,Chilledheart/libunwind,dropbox/libunwind,jrmuizel/libunwind,fdoray/libunwind,0xlab/0xdroid-external_libunwind,vegard/libunwind,cms-externals/libunwind
5a0d65b27682ea330b8d2c88edae4ff9e44f8098
src/plugins/crypto/compile_gcrypt.c
src/plugins/crypto/compile_gcrypt.c
/** * @file * * @brief tests if compilation works (include and build paths set correct, etc...) * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) * */ #include <gcrypt.h> gcry_cipher_hd_t nothing () { gcry_cipher_hd_t elektraCryptoHandle = NULL; return elektraCryptoHandle; } int main (void) { nothing (); return 0; }
/** * @file * * @brief tests if compilation works (include and build paths set correct, etc...) * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) * */ #include <gcrypt.h> gcry_cipher_hd_t nothing (void) { gcry_cipher_hd_t elektraCryptoHandle = NULL; return elektraCryptoHandle; } int main (void) { nothing (); return 0; }
Fix warning in GCrypt test program
Crypto: Fix warning in GCrypt test program
C
bsd-3-clause
e1528532/libelektra,e1528532/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,petermax2/libelektra,e1528532/libelektra,e1528532/libelektra,BernhardDenner/libelektra,petermax2/libelektra,BernhardDenner/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,mpranj/libelektra,BernhardDenner/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,BernhardDenner/libelektra,petermax2/libelektra,BernhardDenner/libelektra,e1528532/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,mpranj/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,e1528532/libelektra,e1528532/libelektra,mpranj/libelektra,e1528532/libelektra,mpranj/libelektra
e280eda845dd538c8e37d2d5e526d242e3099d41
tests/regression/08-malloc_null/02-paths-malloc.c
tests/regression/08-malloc_null/02-paths-malloc.c
// PARAM: --set ana.activated "['base','threadid','threadflag','escape','malloc_null','mallocWrapper']" --set ana.base.privatization none #include <stdlib.h> #include <stdio.h> #include <assert.h> int main(void) { int *v, *u, r; u = (int*)malloc(sizeof(*u)); v = (int*)malloc(sizeof(*v)); *u = 10; // WARN *v = 10; // WARN if (v == 0) exit(-1); *u = 15; // WARN *v = 15; // NOWARN if (u == 0) exit(-1); *u = 20; // NOWARN *v = 20; // NOWARN if (r){ u = (int*)malloc(sizeof(*u)); v = (int*)malloc(sizeof(*v)); } *u = 30; // WARN *v = 30; // WARN printf("???"); if (r){ if (u == 0 || v == 0) exit(-1); } assert(0); // FAIL *u = 40; // NOWARN *v = 40; // NOWARN return 0; }
// PARAM: --set ana.activated "['base','threadid','threadflag','escape','malloc_null','mallocWrapper']" --set ana.base.privatization none #include <stdlib.h> #include <stdio.h> #include <assert.h> int main(void) { int *v, *u, r; u = (int*)malloc(sizeof(*u)); v = (int*)malloc(sizeof(*v)); *u = 10; // WARN *v = 10; // WARN if (v == 0) exit(-1); *u = 15; // WARN *v = 15; // NOWARN if (u == 0) exit(-1); *u = 20; // NOWARN *v = 20; // NOWARN if (r){ u = (int*)malloc(sizeof(*u)); v = (int*)malloc(sizeof(*v)); } *u = 30; // WARN *v = 30; // WARN printf("???"); if (r){ if (u == 0 || v == 0) exit(-1); } *u = 40; // NOWARN *v = 40; // NOWARN return 0; }
Remove unnecessary assert(0) from 08/02
Remove unnecessary assert(0) from 08/02
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
df52622b317e55b88c6f9d62e0273defa0164a35
tests/ncc/struct_init_array_of_padded_structs/in.c
tests/ncc/struct_init_array_of_padded_structs/in.c
#include <assert.h> int main() { struct { struct { int *a; int b; } a[2]; } b = { .a[1].b = 1 }; assert(sizeof b.a == 32); assert(sizeof b.a[0] == 16); assert(b.a[1].b == 1); return 0; }
Add a similar test to the previous one, with arrays this time.
Add a similar test to the previous one, with arrays this time.
C
mit
orodley/naive,orodley/naive,orodley/naive,orodley/naive
1c0b391419b035f78b41ee3bce8934f42896eef2
browser/ui/atom_event_processing_window.h
browser/ui/atom_event_processing_window.h
// Copyright (c) 2013 GitHub, Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #define ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #import <Cocoa/Cocoa.h> // Override NSWindow to access unhandled keyboard events (for command // processing); subclassing NSWindow is the only method to do // this. @interface AtomEventProcessingWindow : NSWindow { @private BOOL redispatchingEvent_; BOOL eventHandled_; } // Sends a key event to |NSApp sendEvent:|, but also makes sure that it's not // short-circuited to the RWHV. This is used to send keyboard events to the menu // and the cmd-` handler if a keyboard event comes back unhandled from the // renderer. The event must be of type |NSKeyDown|, |NSKeyUp|, or // |NSFlagsChanged|. // Returns |YES| if |event| has been handled. - (BOOL)redispatchKeyEvent:(NSEvent*)event; - (BOOL)performKeyEquivalent:(NSEvent*)theEvent; @end #endif // ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_
// Copyright (c) 2013 GitHub, Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #define ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #import <Cocoa/Cocoa.h> #import "ui/base/cocoa/underlay_opengl_hosting_window.h" // Override NSWindow to access unhandled keyboard events (for command // processing); subclassing NSWindow is the only method to do // this. @interface AtomEventProcessingWindow : UnderlayOpenGLHostingWindow { @private BOOL redispatchingEvent_; BOOL eventHandled_; } // Sends a key event to |NSApp sendEvent:|, but also makes sure that it's not // short-circuited to the RWHV. This is used to send keyboard events to the menu // and the cmd-` handler if a keyboard event comes back unhandled from the // renderer. The event must be of type |NSKeyDown|, |NSKeyUp|, or // |NSFlagsChanged|. // Returns |YES| if |event| has been handled. - (BOOL)redispatchKeyEvent:(NSEvent*)event; - (BOOL)performKeyEquivalent:(NSEvent*)theEvent; @end #endif // ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_
Fix the black devtools view.
Fix the black devtools view. Without using UnderlayOpenGLHostingWindow the devtools view would just be black.
C
mit
baiwyc119/electron,IonicaBizauKitchen/electron,farmisen/electron,dahal/electron,bright-sparks/electron,darwin/electron,sky7sea/electron,greyhwndz/electron,sircharleswatson/electron,vipulroxx/electron,JesselJohn/electron,vaginessa/electron,hokein/atom-shell,thomsonreuters/electron,kenmozi/electron,brave/muon,Zagorakiss/electron,bobwol/electron,rprichard/electron,lzpfmh/electron,the-ress/electron,LadyNaggaga/electron,nicobot/electron,setzer777/electron,rreimann/electron,edulan/electron,IonicaBizauKitchen/electron,fabien-d/electron,gabriel/electron,farmisen/electron,tincan24/electron,kikong/electron,kazupon/electron,saronwei/electron,Faiz7412/electron,JussMee15/electron,anko/electron,leolujuyi/electron,eric-seekas/electron,aichingm/electron,bwiggs/electron,electron/electron,the-ress/electron,astoilkov/electron,kokdemo/electron,JesselJohn/electron,simongregory/electron,jlord/electron,natgolov/electron,jacksondc/electron,saronwei/electron,the-ress/electron,mattotodd/electron,mjaniszew/electron,simonfork/electron,kokdemo/electron,nagyistoce/electron-atom-shell,sshiting/electron,wan-qy/electron,webmechanicx/electron,Rokt33r/electron,iftekeriba/electron,mattdesl/electron,yalexx/electron,posix4e/electron,jonatasfreitasv/electron,deed02392/electron,xfstudio/electron,beni55/electron,stevemao/electron,jaanus/electron,jlord/electron,mirrh/electron,lrlna/electron,Ivshti/electron,shockone/electron,mattotodd/electron,gbn972/electron,pirafrank/electron,greyhwndz/electron,edulan/electron,systembugtj/electron,bruce/electron,arusakov/electron,RobertJGabriel/electron,pandoraui/electron,astoilkov/electron,timruffles/electron,vHanda/electron,mrwizard82d1/electron,posix4e/electron,christian-bromann/electron,Neron-X5/electron,jonatasfreitasv/electron,pirafrank/electron,Jacobichou/electron,RIAEvangelist/electron,howmuchcomputer/electron,hokein/atom-shell,the-ress/electron,nagyistoce/electron-atom-shell,nekuz0r/electron,Jonekee/electron,Evercoder/electron,benweissmann/electron,joaomoreno/atom-shell,tylergibson/electron,nicobot/electron,yan-foto/electron,electron/electron,carsonmcdonald/electron,mubassirhayat/electron,gabrielPeart/electron,nagyistoce/electron-atom-shell,dongjoon-hyun/electron,bitemyapp/electron,jiaz/electron,adcentury/electron,Zagorakiss/electron,Floato/electron,jonatasfreitasv/electron,adcentury/electron,twolfson/electron,electron/electron,beni55/electron,timruffles/electron,vipulroxx/electron,eric-seekas/electron,brenca/electron,Ivshti/electron,tylergibson/electron,LadyNaggaga/electron,jlhbaseball15/electron,ervinb/electron,gabrielPeart/electron,d-salas/electron,chrisswk/electron,cqqccqc/electron,christian-bromann/electron,kenmozi/electron,gabriel/electron,Zagorakiss/electron,xfstudio/electron,MaxWhere/electron,jiaz/electron,shiftkey/electron,bruce/electron,jannishuebl/electron,the-ress/electron,jannishuebl/electron,medixdev/electron,fabien-d/electron,Neron-X5/electron,jtburke/electron,oiledCode/electron,darwin/electron,fritx/electron,shockone/electron,pombredanne/electron,rsvip/electron,tincan24/electron,Faiz7412/electron,biblerule/UMCTelnetHub,christian-bromann/electron,takashi/electron,bbondy/electron,aaron-goshine/electron,MaxGraey/electron,mirrh/electron,mhkeller/electron,Faiz7412/electron,evgenyzinoviev/electron,shiftkey/electron,mirrh/electron,simongregory/electron,aliib/electron,preco21/electron,thompsonemerson/electron,bwiggs/electron,jcblw/electron,eric-seekas/electron,chrisswk/electron,bobwol/electron,wolfflow/electron,zhakui/electron,leolujuyi/electron,BionicClick/electron,IonicaBizauKitchen/electron,fireball-x/atom-shell,synaptek/electron,xfstudio/electron,adcentury/electron,miniak/electron,thingsinjars/electron,Andrey-Pavlov/electron,Faiz7412/electron,vHanda/electron,BionicClick/electron,jiaz/electron,zhakui/electron,ankitaggarwal011/electron,coderhaoxin/electron,roadev/electron,rajatsingla28/electron,sircharleswatson/electron,tomashanacek/electron,kostia/electron,anko/electron,kokdemo/electron,eric-seekas/electron,leethomas/electron,arturts/electron,stevekinney/electron,aliib/electron,jcblw/electron,sshiting/electron,iftekeriba/electron,pandoraui/electron,lrlna/electron,DivyaKMenon/electron,subblue/electron,Ivshti/electron,stevemao/electron,nicholasess/electron,fireball-x/atom-shell,MaxWhere/electron,chrisswk/electron,abhishekgahlot/electron,rhencke/electron,stevekinney/electron,Andrey-Pavlov/electron,chriskdon/electron,noikiy/electron,Ivshti/electron,systembugtj/electron,lzpfmh/electron,kikong/electron,miniak/electron,rreimann/electron,trankmichael/electron,tonyganch/electron,synaptek/electron,joneit/electron,trankmichael/electron,darwin/electron,digideskio/electron,aaron-goshine/electron,nekuz0r/electron,webmechanicx/electron,fabien-d/electron,wan-qy/electron,trigrass2/electron,kostia/electron,shennushi/electron,gamedevsam/electron,meowlab/electron,jcblw/electron,icattlecoder/electron,maxogden/atom-shell,oiledCode/electron,nicholasess/electron,voidbridge/electron,RIAEvangelist/electron,tomashanacek/electron,darwin/electron,egoist/electron,greyhwndz/electron,natgolov/electron,jiaz/electron,pirafrank/electron,Evercoder/electron,etiktin/electron,beni55/electron,SufianHassan/electron,tincan24/electron,fritx/electron,davazp/electron,egoist/electron,arturts/electron,vipulroxx/electron,kazupon/electron,jhen0409/electron,gbn972/electron,mubassirhayat/electron,pombredanne/electron,simonfork/electron,adamjgray/electron,dkfiresky/electron,fomojola/electron,wolfflow/electron,biblerule/UMCTelnetHub,soulteary/electron,seanchas116/electron,destan/electron,JesselJohn/electron,Jonekee/electron,evgenyzinoviev/electron,natgolov/electron,bitemyapp/electron,shockone/electron,xfstudio/electron,mjaniszew/electron,kikong/electron,timruffles/electron,digideskio/electron,fomojola/electron,Jacobichou/electron,trankmichael/electron,bobwol/electron,d-salas/electron,trankmichael/electron,faizalpribadi/electron,jacksondc/electron,leftstick/electron,ervinb/electron,jacksondc/electron,felixrieseberg/electron,kikong/electron,tomashanacek/electron,robinvandernoord/electron,leolujuyi/electron,kostia/electron,leethomas/electron,IonicaBizauKitchen/electron,RobertJGabriel/electron,fffej/electron,soulteary/electron,baiwyc119/electron,nicholasess/electron,fomojola/electron,renaesop/electron,RobertJGabriel/electron,twolfson/electron,simonfork/electron,aecca/electron,vHanda/electron,subblue/electron,Gerhut/electron,leethomas/electron,JussMee15/electron,thompsonemerson/electron,tinydew4/electron,nagyistoce/electron-atom-shell,shockone/electron,trigrass2/electron,mattdesl/electron,joaomoreno/atom-shell,micalan/electron,kokdemo/electron,renaesop/electron,rhencke/electron,webmechanicx/electron,hokein/atom-shell,bruce/electron,Evercoder/electron,Rokt33r/electron,wolfflow/electron,chrisswk/electron,tonyganch/electron,DivyaKMenon/electron,aliib/electron,davazp/electron,simongregory/electron,mubassirhayat/electron,vHanda/electron,nekuz0r/electron,eriser/electron,etiktin/electron,jsutcodes/electron,mubassirhayat/electron,takashi/electron,trigrass2/electron,iftekeriba/electron,sky7sea/electron,mattotodd/electron,vaginessa/electron,carsonmcdonald/electron,tomashanacek/electron,astoilkov/electron,chriskdon/electron,Neron-X5/electron,robinvandernoord/electron,RIAEvangelist/electron,medixdev/electron,aliib/electron,joaomoreno/atom-shell,cqqccqc/electron,rajatsingla28/electron,Jonekee/electron,neutrous/electron,farmisen/electron,fffej/electron,Gerhut/electron,iftekeriba/electron,jhen0409/electron,Zagorakiss/electron,soulteary/electron,noikiy/electron,leolujuyi/electron,leolujuyi/electron,oiledCode/electron,arusakov/electron,gstack/infinium-shell,chriskdon/electron,bitemyapp/electron,roadev/electron,shiftkey/electron,jhen0409/electron,mattotodd/electron,trankmichael/electron,dongjoon-hyun/electron,stevekinney/electron,simonfork/electron,jlord/electron,minggo/electron,the-ress/electron,sshiting/electron,beni55/electron,cos2004/electron,fireball-x/atom-shell,stevemao/electron,fabien-d/electron,yalexx/electron,bpasero/electron,saronwei/electron,baiwyc119/electron,bbondy/electron,mirrh/electron,benweissmann/electron,aecca/electron,leethomas/electron,jsutcodes/electron,mhkeller/electron,mattdesl/electron,kcrt/electron,kazupon/electron,jcblw/electron,aliib/electron,digideskio/electron,sircharleswatson/electron,mhkeller/electron,matiasinsaurralde/electron,vipulroxx/electron,cqqccqc/electron,joaomoreno/atom-shell,RIAEvangelist/electron,jannishuebl/electron,abhishekgahlot/electron,rsvip/electron,John-Lin/electron,arturts/electron,xiruibing/electron,chriskdon/electron,jlhbaseball15/electron,thomsonreuters/electron,bobwol/electron,baiwyc119/electron,tylergibson/electron,MaxGraey/electron,leftstick/electron,voidbridge/electron,wan-qy/electron,leftstick/electron,jsutcodes/electron,aecca/electron,tomashanacek/electron,egoist/electron,faizalpribadi/electron,deed02392/electron,Rokt33r/electron,greyhwndz/electron,LadyNaggaga/electron,howmuchcomputer/electron,gabrielPeart/electron,edulan/electron,anko/electron,deed02392/electron,brave/muon,DivyaKMenon/electron,jhen0409/electron,renaesop/electron,John-Lin/electron,jlhbaseball15/electron,astoilkov/electron,systembugtj/electron,iftekeriba/electron,aichingm/electron,carsonmcdonald/electron,jaanus/electron,bpasero/electron,davazp/electron,wolfflow/electron,brave/electron,trigrass2/electron,GoooIce/electron,wolfflow/electron,gbn972/electron,rsvip/electron,zhakui/electron,bwiggs/electron,mattotodd/electron,Neron-X5/electron,jonatasfreitasv/electron,mirrh/electron,coderhaoxin/electron,kenmozi/electron,etiktin/electron,yan-foto/electron,adamjgray/electron,coderhaoxin/electron,preco21/electron,bruce/electron,vipulroxx/electron,minggo/electron,twolfson/electron,ervinb/electron,etiktin/electron,chriskdon/electron,jonatasfreitasv/electron,wan-qy/electron,astoilkov/electron,aaron-goshine/electron,rajatsingla28/electron,mattotodd/electron,jacksondc/electron,lrlna/electron,thompsonemerson/electron,adamjgray/electron,brave/electron,gstack/infinium-shell,GoooIce/electron,chrisswk/electron,preco21/electron,deed02392/electron,Zagorakiss/electron,SufianHassan/electron,systembugtj/electron,icattlecoder/electron,lzpfmh/electron,biblerule/UMCTelnetHub,vipulroxx/electron,Gerhut/electron,kenmozi/electron,arturts/electron,faizalpribadi/electron,arusakov/electron,thompsonemerson/electron,xiruibing/electron,ianscrivener/electron,aichingm/electron,deed02392/electron,electron/electron,stevekinney/electron,takashi/electron,carsonmcdonald/electron,smczk/electron,systembugtj/electron,dahal/electron,zhakui/electron,felixrieseberg/electron,pirafrank/electron,ianscrivener/electron,dahal/electron,aichingm/electron,pandoraui/electron,Zagorakiss/electron,oiledCode/electron,wan-qy/electron,fffej/electron,natgolov/electron,kcrt/electron,jhen0409/electron,Jonekee/electron,dongjoon-hyun/electron,kazupon/electron,meowlab/electron,ianscrivener/electron,brave/muon,adamjgray/electron,edulan/electron,icattlecoder/electron,matiasinsaurralde/electron,jsutcodes/electron,IonicaBizauKitchen/electron,Faiz7412/electron,roadev/electron,gerhardberger/electron,edulan/electron,miniak/electron,deepak1556/atom-shell,tylergibson/electron,electron/electron,rprichard/electron,farmisen/electron,noikiy/electron,rhencke/electron,timruffles/electron,bwiggs/electron,noikiy/electron,felixrieseberg/electron,ianscrivener/electron,meowlab/electron,tinydew4/electron,tinydew4/electron,mhkeller/electron,setzer777/electron,arturts/electron,vaginessa/electron,nicobot/electron,pandoraui/electron,RIAEvangelist/electron,xfstudio/electron,lzpfmh/electron,felixrieseberg/electron,Gerhut/electron,bpasero/electron,trigrass2/electron,posix4e/electron,Jacobichou/electron,gstack/infinium-shell,Andrey-Pavlov/electron,GoooIce/electron,seanchas116/electron,cos2004/electron,jjz/electron,astoilkov/electron,cqqccqc/electron,tinydew4/electron,brave/muon,gamedevsam/electron,smczk/electron,gerhardberger/electron,davazp/electron,d-salas/electron,kenmozi/electron,fritx/electron,tonyganch/electron,mjaniszew/electron,xiruibing/electron,miniak/electron,gbn972/electron,brave/muon,setzer777/electron,jacksondc/electron,gamedevsam/electron,Jonekee/electron,jtburke/electron,systembugtj/electron,Floato/electron,gerhardberger/electron,biblerule/UMCTelnetHub,mhkeller/electron,simongregory/electron,Ivshti/electron,mattdesl/electron,icattlecoder/electron,rhencke/electron,shiftkey/electron,gabriel/electron,dahal/electron,JussMee15/electron,jtburke/electron,fritx/electron,nicobot/electron,Evercoder/electron,d-salas/electron,Neron-X5/electron,brenca/electron,gabrielPeart/electron,voidbridge/electron,brave/electron,xiruibing/electron,robinvandernoord/electron,rreimann/electron,jaanus/electron,shennushi/electron,nekuz0r/electron,shaundunne/electron,gerhardberger/electron,icattlecoder/electron,smczk/electron,shockone/electron,beni55/electron,abhishekgahlot/electron,nicholasess/electron,twolfson/electron,arturts/electron,leftstick/electron,trankmichael/electron,sircharleswatson/electron,bpasero/electron,stevemao/electron,robinvandernoord/electron,jtburke/electron,Jacobichou/electron,thompsonemerson/electron,meowlab/electron,rreimann/electron,icattlecoder/electron,minggo/electron,howmuchcomputer/electron,JesselJohn/electron,RobertJGabriel/electron,thomsonreuters/electron,gamedevsam/electron,farmisen/electron,thompsonemerson/electron,kazupon/electron,kcrt/electron,aichingm/electron,MaxWhere/electron,Floato/electron,simonfork/electron,aliib/electron,cos2004/electron,baiwyc119/electron,jlhbaseball15/electron,dongjoon-hyun/electron,howmuchcomputer/electron,pandoraui/electron,sshiting/electron,yan-foto/electron,neutrous/electron,michaelchiche/electron,destan/electron,matiasinsaurralde/electron,cos2004/electron,jjz/electron,vaginessa/electron,adcentury/electron,etiktin/electron,GoooIce/electron,chriskdon/electron,ankitaggarwal011/electron,Floato/electron,kikong/electron,roadev/electron,simonfork/electron,anko/electron,pirafrank/electron,bbondy/electron,bpasero/electron,joneit/electron,bpasero/electron,fabien-d/electron,jjz/electron,seanchas116/electron,d-salas/electron,lzpfmh/electron,bbondy/electron,renaesop/electron,eriser/electron,fffej/electron,medixdev/electron,mjaniszew/electron,adamjgray/electron,vaginessa/electron,meowlab/electron,Jonekee/electron,coderhaoxin/electron,benweissmann/electron,brave/electron,gabriel/electron,kcrt/electron,gerhardberger/electron,shockone/electron,dkfiresky/electron,jonatasfreitasv/electron,John-Lin/electron,eriser/electron,preco21/electron,kostia/electron,webmechanicx/electron,rsvip/electron,jhen0409/electron,Andrey-Pavlov/electron,deepak1556/atom-shell,MaxWhere/electron,xfstudio/electron,MaxGraey/electron,evgenyzinoviev/electron,BionicClick/electron,ankitaggarwal011/electron,ankitaggarwal011/electron,zhakui/electron,farmisen/electron,dahal/electron,joneit/electron,thingsinjars/electron,thingsinjars/electron,timruffles/electron,bbondy/electron,destan/electron,howmuchcomputer/electron,pombredanne/electron,micalan/electron,MaxGraey/electron,Andrey-Pavlov/electron,michaelchiche/electron,John-Lin/electron,renaesop/electron,mirrh/electron,dahal/electron,gamedevsam/electron,rsvip/electron,edulan/electron,jiaz/electron,saronwei/electron,cos2004/electron,ianscrivener/electron,shennushi/electron,eriser/electron,soulteary/electron,deed02392/electron,yan-foto/electron,medixdev/electron,mubassirhayat/electron,tylergibson/electron,Rokt33r/electron,benweissmann/electron,dongjoon-hyun/electron,smczk/electron,JussMee15/electron,matiasinsaurralde/electron,webmechanicx/electron,leolujuyi/electron,etiktin/electron,cqqccqc/electron,jlhbaseball15/electron,kostia/electron,tincan24/electron,Gerhut/electron,natgolov/electron,evgenyzinoviev/electron,michaelchiche/electron,thomsonreuters/electron,SufianHassan/electron,bobwol/electron,takashi/electron,MaxWhere/electron,kokdemo/electron,SufianHassan/electron,adcentury/electron,faizalpribadi/electron,anko/electron,minggo/electron,d-salas/electron,benweissmann/electron,John-Lin/electron,micalan/electron,shaundunne/electron,sircharleswatson/electron,deepak1556/atom-shell,bobwol/electron,leftstick/electron,michaelchiche/electron,fritx/electron,zhakui/electron,arusakov/electron,brenca/electron,robinvandernoord/electron,dkfiresky/electron,arusakov/electron,BionicClick/electron,egoist/electron,miniak/electron,jcblw/electron,JesselJohn/electron,destan/electron,tincan24/electron,sky7sea/electron,renaesop/electron,hokein/atom-shell,Floato/electron,noikiy/electron,tomashanacek/electron,bright-sparks/electron,jlord/electron,bwiggs/electron,egoist/electron,stevemao/electron,vHanda/electron,joaomoreno/atom-shell,voidbridge/electron,nicholasess/electron,shennushi/electron,posix4e/electron,fireball-x/atom-shell,JesselJohn/electron,rreimann/electron,jjz/electron,gerhardberger/electron,micalan/electron,ervinb/electron,jtburke/electron,mrwizard82d1/electron,xiruibing/electron,noikiy/electron,minggo/electron,MaxWhere/electron,jtburke/electron,bitemyapp/electron,mjaniszew/electron,stevemao/electron,yan-foto/electron,coderhaoxin/electron,gabrielPeart/electron,nekuz0r/electron,ianscrivener/electron,rajatsingla28/electron,nagyistoce/electron-atom-shell,stevekinney/electron,shaundunne/electron,Jacobichou/electron,eriser/electron,GoooIce/electron,wan-qy/electron,sshiting/electron,setzer777/electron,christian-bromann/electron,bruce/electron,shaundunne/electron,joneit/electron,bruce/electron,aecca/electron,simongregory/electron,rhencke/electron,anko/electron,micalan/electron,felixrieseberg/electron,maxogden/atom-shell,bitemyapp/electron,carsonmcdonald/electron,benweissmann/electron,michaelchiche/electron,Gerhut/electron,neutrous/electron,thingsinjars/electron,greyhwndz/electron,gstack/infinium-shell,mhkeller/electron,stevekinney/electron,biblerule/UMCTelnetHub,IonicaBizauKitchen/electron,nekuz0r/electron,BionicClick/electron,smczk/electron,aaron-goshine/electron,lrlna/electron,vaginessa/electron,oiledCode/electron,LadyNaggaga/electron,fomojola/electron,posix4e/electron,brave/muon,SufianHassan/electron,JussMee15/electron,gerhardberger/electron,greyhwndz/electron,kazupon/electron,rhencke/electron,Andrey-Pavlov/electron,thomsonreuters/electron,aecca/electron,jannishuebl/electron,thingsinjars/electron,gbn972/electron,sircharleswatson/electron,carsonmcdonald/electron,aaron-goshine/electron,evgenyzinoviev/electron,Rokt33r/electron,gbn972/electron,medixdev/electron,kcrt/electron,synaptek/electron,preco21/electron,joneit/electron,felixrieseberg/electron,seanchas116/electron,davazp/electron,brave/electron,jannishuebl/electron,xiruibing/electron,eric-seekas/electron,matiasinsaurralde/electron,shennushi/electron,deepak1556/atom-shell,leethomas/electron,takashi/electron,sky7sea/electron,shaundunne/electron,robinvandernoord/electron,bright-sparks/electron,ervinb/electron,bright-sparks/electron,bbondy/electron,DivyaKMenon/electron,yan-foto/electron,abhishekgahlot/electron,baiwyc119/electron,rreimann/electron,joaomoreno/atom-shell,subblue/electron,sky7sea/electron,digideskio/electron,abhishekgahlot/electron,bright-sparks/electron,minggo/electron,voidbridge/electron,roadev/electron,leftstick/electron,tylergibson/electron,voidbridge/electron,BionicClick/electron,tonyganch/electron,fffej/electron,arusakov/electron,fomojola/electron,pombredanne/electron,simongregory/electron,LadyNaggaga/electron,subblue/electron,fffej/electron,rajatsingla28/electron,Evercoder/electron,oiledCode/electron,thomsonreuters/electron,brenca/electron,deepak1556/atom-shell,jacksondc/electron,saronwei/electron,cqqccqc/electron,nicobot/electron,fritx/electron,sky7sea/electron,gamedevsam/electron,joneit/electron,electron/electron,meowlab/electron,dongjoon-hyun/electron,dkfiresky/electron,micalan/electron,abhishekgahlot/electron,bright-sparks/electron,christian-bromann/electron,LadyNaggaga/electron,shennushi/electron,nicobot/electron,lzpfmh/electron,smczk/electron,digideskio/electron,saronwei/electron,tonyganch/electron,faizalpribadi/electron,the-ress/electron,SufianHassan/electron,faizalpribadi/electron,ervinb/electron,pirafrank/electron,kokdemo/electron,pombredanne/electron,RIAEvangelist/electron,DivyaKMenon/electron,MaxGraey/electron,maxogden/atom-shell,yalexx/electron,medixdev/electron,gstack/infinium-shell,eriser/electron,evgenyzinoviev/electron,twolfson/electron,jsutcodes/electron,setzer777/electron,jannishuebl/electron,Jacobichou/electron,dkfiresky/electron,christian-bromann/electron,subblue/electron,adamjgray/electron,yalexx/electron,mattdesl/electron,sshiting/electron,howmuchcomputer/electron,Evercoder/electron,preco21/electron,kostia/electron,synaptek/electron,darwin/electron,rajatsingla28/electron,miniak/electron,gabriel/electron,destan/electron,thingsinjars/electron,tincan24/electron,ankitaggarwal011/electron,adcentury/electron,RobertJGabriel/electron,biblerule/UMCTelnetHub,gabrielPeart/electron,Neron-X5/electron,shiftkey/electron,rprichard/electron,subblue/electron,kcrt/electron,jiaz/electron,jlhbaseball15/electron,setzer777/electron,dkfiresky/electron,neutrous/electron,aecca/electron,lrlna/electron,DivyaKMenon/electron,takashi/electron,jjz/electron,synaptek/electron,michaelchiche/electron,fireball-x/atom-shell,seanchas116/electron,neutrous/electron,leethomas/electron,jsutcodes/electron,tinydew4/electron,bwiggs/electron,tonyganch/electron,neutrous/electron,roadev/electron,aaron-goshine/electron,mattdesl/electron,soulteary/electron,John-Lin/electron,bpasero/electron,ankitaggarwal011/electron,maxogden/atom-shell,coderhaoxin/electron,webmechanicx/electron,maxogden/atom-shell,jjz/electron,jlord/electron,shiftkey/electron,iftekeriba/electron,fomojola/electron,trigrass2/electron,vHanda/electron,yalexx/electron,eric-seekas/electron,mrwizard82d1/electron,rprichard/electron,JussMee15/electron,seanchas116/electron,kenmozi/electron,cos2004/electron,tinydew4/electron,posix4e/electron,mrwizard82d1/electron,davazp/electron,pandoraui/electron,yalexx/electron,nicholasess/electron,synaptek/electron,wolfflow/electron,mjaniszew/electron,destan/electron,electron/electron,matiasinsaurralde/electron,beni55/electron,jaanus/electron,brave/electron,jcblw/electron,brenca/electron,digideskio/electron,jaanus/electron,hokein/atom-shell,RobertJGabriel/electron,Floato/electron,GoooIce/electron,twolfson/electron,egoist/electron,brenca/electron,pombredanne/electron,aichingm/electron,jaanus/electron,lrlna/electron,mrwizard82d1/electron,shaundunne/electron,soulteary/electron,Rokt33r/electron,mrwizard82d1/electron,natgolov/electron,bitemyapp/electron,gabriel/electron
fc18109c3d40efea326780bbd020f8b9dfcd71b7
include/Math/NLEMath.h
include/Math/NLEMath.h
/* ----------------------------------------------------------------------------- This source file is part of NLRE (NonLinear Rendering Engine) For the latest info, see https://github.com/AlexandrSachkov/NonLinearRenderingEngine Copyright (c) 2014 NonLinear Rendering Engine Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------------- */ #ifndef NLE_MATH_ #define NLE_MATH_ #ifdef _DXMATH_ #include "Math/DXMath/DXMathWrap.h" #endif #endif
Revert "original structure is out of sync with github"
Revert "original structure is out of sync with github" This reverts commit 8a793e097c75856b7fdd55a5f9d4ed1984e81cae.
C
mit
AlexandrSachkov/NonLinearEngine
cb232f9f912e801a596e8c99191ed538021cd702
test2/vla/normal_alloca_after_vla.c
test2/vla/normal_alloca_after_vla.c
// RUN: %ocheck 0 %s void abort(void); g() { return 0; } main() { int n = 5; // an unaligned value int vla[n]; vla[0] = 1; vla[1] = 2; vla[2] = 3; vla[3] = 4; { // this alloca is done in order after the vla, // but is coalesced to before the VLA by the stack logic int x = 99; if(x != 99) abort(); if(g()) return 3; // scope-leave/restore vla, but doesn't pop the vla state int y = 35; if(y != 35) abort(); // more scope leave code for(int i = 0; i < 10; i++) if(i == 5) break; if(vla[0] != 1) abort(); if(vla[1] != 2) abort(); if(vla[2] != 3) abort(); if(vla[3] != 4) abort(); if(sizeof vla != n * sizeof(int)) abort(); if(y != 35) abort(); if(x != 99) abort(); } if(vla[0] != 1) abort(); if(vla[1] != 2) abort(); if(vla[2] != 3) abort(); if(vla[3] != 4) abort(); if(sizeof vla != n * sizeof(int)) abort(); return 0; }
Test normal (backend-)allocas inside VLA scope
Test normal (backend-)allocas inside VLA scope
C
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
a94d0b43cf4cf548d828fec548790a6da073bec1
include/paper.h
include/paper.h
#ifndef PAPER_H #define PAPER_H #include <stdbool.h> bool paper_is_start_of_first_word(char *ptr) { // Lookback and check if that is a NUL then check that we aren't // currently on a space. return (*(ptr - 1) == KATA_NUL && *ptr != KATA_SPACE); } bool paper_is_start_of_subsequent_word(char *ptr) { // Lookback and see if the prior character was a space then check that // we aren't currently on a space. return (*(ptr - 1) == KATA_SPACE && *ptr != KATA_SPACE); } size_t paper_word_count(char *paper) { size_t count = 0; char *ptr = paper; do { if (!*ptr) { break; } if ( paper_is_start_of_first_word(ptr) || paper_is_start_of_subsequent_word(ptr) ) { count += 1; } } while (*(++ptr)); return count; } #endif // PAPER_H
#ifndef PAPER_H #define PAPER_H #include <stdbool.h> bool paper_is_start_of_first_word(size_t word_count, char *ptr) { return (word_count == 0 && *ptr != KATA_SPACE); } bool paper_is_start_of_subsequent_word(char *ptr) { // Lookback and see if the prior character was a space then check that // we aren't currently on a space. return (*(ptr - 1) == KATA_SPACE && *ptr != KATA_SPACE); } size_t paper_word_count(char *paper) { size_t count = 0; char *ptr = paper; do { if (!*ptr) { break; } if ( paper_is_start_of_first_word(count, ptr) || paper_is_start_of_subsequent_word(ptr) ) { count += 1; } } while (*(++ptr)); return count; } #endif // PAPER_H
Refactor to fix potential buffer overflow.
Refactor to fix potential buffer overflow.
C
mit
jbenner-radham/pencil-durability-kata-c
f19341dec7361451f100a882a023b14583454d7e
test/CFrontend/extern-weak.c
test/CFrontend/extern-weak.c
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc #if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) void foo() __attribute__((weak_import)); #else void foo() __attribute__((weak)); #endif void bar() { foo(); }
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc #if !defined(__linux__) && !defined(__FreeBSD__) && \ !defined(__OpenBSD__) && !defined(__CYGWIN__) void foo() __attribute__((weak_import)); #else void foo() __attribute__((weak)); #endif void bar() { foo(); }
Make this pass for CYGWIN.
Make this pass for CYGWIN. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@44354 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap
1110425df2e58bdaeb623f9c3a8de84bccee7381
test/Driver/noexecstack.c
test/Driver/noexecstack.c
// RUN: clang -### %s -c -o tmp.o -Wa,--noexecstack | grep "-mnoexecstack"
// RUN: clang -### %s -c -o tmp.o -Wa,--noexecstack | grep "mnoexecstack"
Remove the leading hyphen so that grep doesn't parse it as one long option :)
Remove the leading hyphen so that grep doesn't parse it as one long option :) git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@133491 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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
dc6f838f1d6b4c7dabaaaf0740e194298f9d4ff4
DDMathParser/DDMathParser.h
DDMathParser/DDMathParser.h
// // DDMathParser.h // DDMathParser // // Created by Dave DeLong on 11/20/10. // Copyright 2010 Home. All rights reserved. // #import "DDMathEvaluator.h" #import "DDExpression.h" #import "DDParser.h" #import "DDTypes.h" #import "NSString+DDMathParsing.h" #define DDRuleTemplateAnyNumber @"__num" #define DDRuleTemplateAnyFunction @"__func" #define DDRuleTemplateAnyVariable @"__var" #define DDRuleTemplateAnyExpression @"__exp" #ifdef __clang__ #define DD_STRONG strong #else #define DD_STRONG retain #endif #if __has_feature(objc_arc) #define DD_HAS_ARC 1 #define DD_RETAIN(_o) (_o) #define DD_RELEASE(_o) #define DD_AUTORELEASE(_o) (_o) #else #define DD_HAS_ARC 0 #define DD_RETAIN(_o) [(_o) retain] #define DD_RELEASE(_o) [(_o) release] #define DD_AUTORELEASE(_o) [(_o) autorelease] #endif // change this to 0 if you want the "%" character to mean a percentage // please see the wiki for more information about what this switch means: // https://github.com/davedelong/DDMathParser/wiki #define DD_INTERPRET_PERCENT_SIGN_AS_MOD 0
// // DDMathParser.h // DDMathParser // // Created by Dave DeLong on 11/20/10. // Copyright 2010 Home. All rights reserved. // #import "DDMathEvaluator.h" #import "DDExpression.h" #import "DDParser.h" #import "DDTypes.h" #import "NSString+DDMathParsing.h" #define DDRuleTemplateAnyNumber @"__num" #define DDRuleTemplateAnyFunction @"__func" #define DDRuleTemplateAnyVariable @"__var" #define DDRuleTemplateAnyExpression @"__exp" #ifdef __clang__ #define DD_STRONG strong #else #define DD_STRONG retain #endif #if __has_feature(objc_arc) #define DD_HAS_ARC 1 #define DD_RETAIN(_o) (_o) #define DD_RELEASE(_o) #define DD_AUTORELEASE(_o) (_o) #else #define DD_HAS_ARC 0 #define DD_RETAIN(_o) [(_o) retain] #define DD_RELEASE(_o) [(_o) release] #define DD_AUTORELEASE(_o) [(_o) autorelease] #endif // change this to 0 if you want the "%" character to mean a percentage // please see the wiki for more information about what this switch means: // https://github.com/davedelong/DDMathParser/wiki #define DD_INTERPRET_PERCENT_SIGN_AS_MOD 1
Fix default value of PERCENT_SIGN_AS_MOD
Fix default value of PERCENT_SIGN_AS_MOD
C
mit
mrackwitz/DDMathParser,davedelong/DDMathParser,carabina/DDMathParser,hyperoslo/HYPMathParser,carabina/DDMathParser,mrackwitz/DDMathParser,davedelong/DDMathParser
3440d0b857fa6def37c1a4185ac9602be2393c9c
tools/obj2yaml/obj2yaml.h
tools/obj2yaml/obj2yaml.h
//===------ utils/obj2yaml.hpp - obj2yaml conversion tool -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // This file declares some helper routines, and also the format-specific // writers. To add a new format, add the declaration here, and, in a separate // source file, implement it. //===----------------------------------------------------------------------===// #ifndef LLVM_UTILS_OBJ2YAML_H #define LLVM_UTILS_OBJ2YAML_H #include "llvm/ADT/ArrayRef.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/system_error.h" namespace yaml { // routines for writing YAML // Write a hex stream: // <Prefix> !hex: "<hex digits>" #|<ASCII chars>\n llvm::raw_ostream &writeHexStream (llvm::raw_ostream &Out, const llvm::ArrayRef<uint8_t> arr); // Writes a number in hex; prefix it by 0x if it is >= 10 llvm::raw_ostream &writeHexNumber (llvm::raw_ostream &Out, unsigned long long N); } llvm::error_code coff2yaml(llvm::raw_ostream &Out, llvm::MemoryBuffer *TheObj); #endif
//===------ utils/obj2yaml.hpp - obj2yaml conversion tool -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // This file declares some helper routines, and also the format-specific // writers. To add a new format, add the declaration here, and, in a separate // source file, implement it. //===----------------------------------------------------------------------===// #ifndef LLVM_TOOLS_OBJ2YAML_H #define LLVM_TOOLS_OBJ2YAML_H #include "llvm/ADT/ArrayRef.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/system_error.h" namespace yaml { // routines for writing YAML // Write a hex stream: // <Prefix> !hex: "<hex digits>" #|<ASCII chars>\n llvm::raw_ostream &writeHexStream (llvm::raw_ostream &Out, const llvm::ArrayRef<uint8_t> arr); // Writes a number in hex; prefix it by 0x if it is >= 10 llvm::raw_ostream &writeHexNumber (llvm::raw_ostream &Out, unsigned long long N); } llvm::error_code coff2yaml(llvm::raw_ostream &Out, llvm::MemoryBuffer *TheObj); #endif
Fix include guards to match new location.
Fix include guards to match new location. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@178877 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm
691cb4414e03ca9cf56b86cf76740078c4208080
include/frozen/bits/constexpr_assert.h
include/frozen/bits/constexpr_assert.h
/* * Frozen * Copyright 2016 QuarksLab * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 FROZEN_LETITGO_CONSTEXPR_ASSERT_H #define FROZEN_LETITGO_CONSTEXPR_ASSERT_H #ifdef _MSC_VER // FIXME: find a way to implement that correctly for msvc #define constexpr_assert(cond, msg) #else #define constexpr_assert(cond, msg)\ if(!(cond)) {\ extern void constexpr_assert_helper(char const*);\ constexpr_assert_helper(msg);\ } #endif #endif
/* * Frozen * Copyright 2016 QuarksLab * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 FROZEN_LETITGO_CONSTEXPR_ASSERT_H #define FROZEN_LETITGO_CONSTEXPR_ASSERT_H #include <cassert> #ifdef _MSC_VER // FIXME: find a way to implement that correctly for msvc #define constexpr_assert(cond, msg) #else #define constexpr_assert(cond, msg)\ assert(cond && msg); #endif #endif
Use regular assert for static_assert, it's C++14 compatible
Use regular assert for static_assert, it's C++14 compatible works everywhere... but for MVSC :-/
C
apache-2.0
serge-sans-paille/frozen,serge-sans-paille/frozen
19350bd42ffbaec283ccb6caa9199accc2c8f074
generate/templates/manual/include/cleanup_handle.h
generate/templates/manual/include/cleanup_handle.h
#ifndef NODEGIT_CLEANUP_HANDLE_H #define NODEGIT_CLEANUP_HANDLE_H #include <map> #include <memory> namespace nodegit { class CleanupHandle { public: CleanupHandle(); virtual ~CleanupHandle(); }; class FilterRegistryCleanupHandles : public CleanupHandle { public: std::map<std::string, std::shared_ptr<CleanupHandle>> registeredFilters; }; } #endif
#ifndef NODEGIT_CLEANUP_HANDLE_H #define NODEGIT_CLEANUP_HANDLE_H #include <map> #include <memory> #include <string> namespace nodegit { class CleanupHandle { public: CleanupHandle(); virtual ~CleanupHandle(); }; class FilterRegistryCleanupHandles : public CleanupHandle { public: std::map<std::string, std::shared_ptr<CleanupHandle>> registeredFilters; }; } #endif
Fix a reference error when compiling with VC2019
Fix a reference error when compiling with VC2019
C
mit
nodegit/nodegit,jmurzy/nodegit,nodegit/nodegit,jmurzy/nodegit,jmurzy/nodegit,nodegit/nodegit,jmurzy/nodegit,nodegit/nodegit,nodegit/nodegit,jmurzy/nodegit
46d81f2bcfa56dc2579d26b1d38b86051119c7ca
src/Core/Framework/QScriptEngineHelpers.h
src/Core/Framework/QScriptEngineHelpers.h
// For conditions of distribution and use, see copyright notice in license.txt #include <QScriptEngine> #include <QMetaType> // The following functions help register a custom QObject-derived class to a QScriptEngine. // See http://lists.trolltech.com/qt-interest/2007-12/thread00158-0.html . template <typename Tp> QScriptValue qScriptValueFromQObject(QScriptEngine *engine, Tp const &qobject) { return engine->newQObject(qobject); } template <typename Tp> void qScriptValueToQObject(const QScriptValue &value, Tp &qobject) { qobject = qobject_cast<Tp>(value.toQObject()); } template <typename Tp> int qScriptRegisterQObjectMetaType(QScriptEngine *engine, const QScriptValue &prototype = QScriptValue() #ifndef qdoc , Tp * = 0 #endif ) { return qScriptRegisterMetaType<Tp>(engine, qScriptValueFromQObject, qScriptValueToQObject, prototype); }
// For conditions of distribution and use, see copyright notice in license.txt #include <QScriptEngine> #include <QMetaType> // The following functions help register a custom QObject-derived class to a QScriptEngine. // See http://lists.trolltech.com/qt-interest/2007-12/thread00158-0.html . template <typename Tp> QScriptValue qScriptValueFromQObject(QScriptEngine *engine, Tp const &qobject) { return engine->newQObject(qobject); } template <typename Tp> void qScriptValueToQObject(const QScriptValue &value, Tp &qobject) { qobject = dynamic_cast<Tp>(value.toQObject()); if (!qobject) { // qobject_cast has been observed to fail for some metatypes, such as Entity*, so prefer dynamic_cast. // However, to see that there are no regressions from that, check that if dynamic_cast fails, so does qobject_cast Tp ptr = qobject_cast<Tp>(value.toQObject()); assert(!ptr); if (ptr) ::LogError("qScriptValueToQObject: dynamic_cast was null, but qobject_cast was not!"); } } template <typename Tp> int qScriptRegisterQObjectMetaType(QScriptEngine *engine, const QScriptValue &prototype = QScriptValue() #ifndef qdoc , Tp * = 0 #endif ) { return qScriptRegisterMetaType<Tp>(engine, qScriptValueFromQObject, qScriptValueToQObject, prototype); }
Use dynamic_cast in qScriptValueToQObject as qobject_cast fails for some metatypes such as Entity*. However, assert that if dynamic_cast is null, so is qobject_cast.
Use dynamic_cast in qScriptValueToQObject as qobject_cast fails for some metatypes such as Entity*. However, assert that if dynamic_cast is null, so is qobject_cast.
C
apache-2.0
realXtend/tundra,jesterKing/naali,pharos3d/tundra,jesterKing/naali,jesterKing/naali,AlphaStaxLLC/tundra,AlphaStaxLLC/tundra,BogusCurry/tundra,jesterKing/naali,pharos3d/tundra,jesterKing/naali,AlphaStaxLLC/tundra,jesterKing/naali,BogusCurry/tundra,jesterKing/naali,BogusCurry/tundra,BogusCurry/tundra,pharos3d/tundra,realXtend/tundra,pharos3d/tundra,AlphaStaxLLC/tundra,realXtend/tundra,pharos3d/tundra,BogusCurry/tundra,AlphaStaxLLC/tundra,realXtend/tundra,pharos3d/tundra,AlphaStaxLLC/tundra,realXtend/tundra,realXtend/tundra,BogusCurry/tundra
3241c8f801152bcaf30ca852e7ee1a14c128f7c8
v0100/tests/c99.c
v0100/tests/c99.c
/* How to compile for DOS (all mode(l)s: tiny/.COM, small/.EXE, huge/.EXE): smlrcc -dost c99.c -o c99dt.com smlrcc -doss c99.c -o c99ds.exe smlrcc -dosh c99.c -o c99dh.exe How to compile for Windows: smlrcc -win c99.c -o c99w.exe How to compile for Linux: smlrcc -linux c99.c -o c99l */ #include <stdio.h> #include <stdint.h> // C99 uint8_t u8 = -1; uint16_t u16 = -1; #ifdef __SMALLER_C_32__ uint32_t u32 = -1; #endif // C99: // comments // C99: trailing comma allowed in enum declarations enum { EZERO, }; int main(void) { // C99: __func__ predefined identifier printf("Hello from %s()\n", __func__); printf("u8=%u, u16=%u", (unsigned)u8, (unsigned)u16); #ifdef __SMALLER_C_32__ printf(", u32=%u", (unsigned)u32); #endif printf("\n"); // C99: variable declaration(s) in for loop's clause-1 for (int i = 0; i < 10; i++) printf("%d", i); printf("\n"); // C99: mixed declarations and code static int call = EZERO; switch (call) { case 0: for (int i = 0; i < 2; i++) { printf("\ncalling main()...\n\n"); call++; printf("\nmain() returned %d (expected %d)\n", main(), i); } return 0; case 1: break; case 2: return 1; } (void)3; // trying to fool the compiler into returning 3 // C99: reaching the } that terminates the main function returns a value of 0 }
Add a small C99 test
Add a small C99 test
C
bsd-2-clause
gdos/SmallerC,JianpingZeng/SmallerC,JianpingZeng/SmallerC,gdos/SmallerC
ade2938ab94b28aa3dd2574bf5752e1e5a8c6641
libavutil/pca.h
libavutil/pca.h
/* * Principal component analysis * Copyright (c) 2004 Michael Niedermayer <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /** * @file pca.h * Principal component analysis */ typedef struct PCA{ int count; int n; double *covariance; double *mean; }PCA;
/* * Principal component analysis * Copyright (c) 2004 Michael Niedermayer <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /** * @file pca.h * Principal component analysis */ struct PCA *ff_pca_init(int n); void ff_pca_free(struct PCA *pca); void ff_pca_add(struct PCA *pca, double *v); int ff_pca(struct PCA *pca, double *eigenvector, double *eigenvalue); typedef struct PCA{ int count; int n; double *covariance; double *mean; }PCA;
Add prototypes to header (based on code by ramiro)
Add prototypes to header (based on code by ramiro) git-svn-id: a4d7c1866f8397a4106e0b57fc4fbf792bbdaaaf@14808 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
C
lgpl-2.1
prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg
114548ece9c6664d069e3e8db33e04a5e74acf75
ADX2Manager/ADX2Manager.h
ADX2Manager/ADX2Manager.h
#ifndef CCADX2Manager_Manager_h #define CCADX2Manager_Manager_h #include "Manager.h" #include "CueSheet.h" #endif
#ifndef CCADX2Manager_Manager_h #define CCADX2Manager_Manager_h #include "Manager.h" #include "CueSheet.h" #include "SharedCueSheet.h" #endif
Add SharedCueSheet to global headers
Add SharedCueSheet to global headers
C
mit
giginet/CCADX2Manager,giginet/CCADX2Manager,giginet/CCADX2Manager,giginet/CCADX2Manager
67c6e446503055f3b29f2ecd8269b09f5743ab85
insts/jg/FREEVERB/denormals.h
insts/jg/FREEVERB/denormals.h
// Macro for killing denormalled numbers // // Written by Jezar at Dreampoint, June 2000 // http://www.dreampoint.co.uk // Based on IS_DENORMAL macro by Jon Watte // This code is public domain #ifndef _denormals_ #define _denormals_ #if 0 #define undenormalise(sample) if(((*(unsigned int*)&sample)&0x7f800000)==0) sample=0.0f #else #define undenormalise(sample) #endif #endif//_denormals_ //ends
// Macro for killing denormalled numbers // // Written by Jezar at Dreampoint, June 2000 // http://www.dreampoint.co.uk // Based on IS_DENORMAL macro by Jon Watte // This code is public domain #ifndef _denormals_ #define _denormals_ #if defined(i386) #ifdef NOMORE // original code doesn't work on recent gcc compilers #define undenormalise(sample) \ if (((*(unsigned int*)&sample)&0x7f800000) == 0) sample = 0.0f #else // !NOMORE // see <ccrma-mail.stanford.edu/pipermail/planetccrma/2005-January/007868.html> static inline float undenormalise(volatile float s) { s += 9.8607615E-32f; return s - 9.8607615E-32f; } //#define undenormalise(sample) #endif // !NOMORE #else // !defined(i386) #define undenormalise(sample) // nothing #endif // !defined(i386) #endif//_denormals_ //ends
Replace denormalise macro, broken on recent gcc's.
Replace denormalise macro, broken on recent gcc's.
C
apache-2.0
RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix
e0da7bce8c184f72a42a49990b8de158ab828423
platform/shared/common/RhoFatalError.h
platform/shared/common/RhoFatalError.h
#ifndef _RHOFATALERROR_H_ #define _RHOFATALERROR_H_ #include "RhoPort.h" #ifdef OS_SYMBIAN #include <e32std.h> #endif namespace rho{ namespace common{ class CRhoFatalError{ public: static void processFatalError(){ #ifdef RHO_DEBUG #if defined (OS_WINDOWS) //__debugbreak(); DebugBreak(); #elif defined (OS_WINCE) //NKDbgPrintfW ? DebugBreak(); #elif defined(OS_SYMBIAN) User::Invariant(); // exit(-1); #elif defined(OS_MACOSX) //TODO: debugbreak for OS_MACOSX exit(-1); #else exit(-1); #endif #else //!RHO_DEBUG exit(-1); #endif //!RHO_DEBUG } }; } } #endif //_RHOFATALERROR_H_
#ifndef _RHOFATALERROR_H_ #define _RHOFATALERROR_H_ #include "RhoPort.h" #ifdef OS_SYMBIAN #include <e32std.h> #endif namespace rho{ namespace common{ class CRhoFatalError{ public: static void processFatalError(){ #ifdef RHO_DEBUG #if defined (OS_WINDOWS) //__debugbreak(); DebugBreak(); #elif defined (OS_WINCE) //NKDbgPrintfW ? DebugBreak(); #elif defined(OS_SYMBIAN) User::Invariant(); // exit(-1); #elif defined(OS_MACOSX) __assert_rtn(__func__, __FILE__, __LINE__,"RhoFatalError"); #else exit(-1); #endif #else //!RHO_DEBUG exit(-1); #endif //!RHO_DEBUG } }; } } #endif //_RHOFATALERROR_H_
Support RHO_ASSERT in Debug mode
Support RHO_ASSERT in Debug mode
C
mit
pslgoh/rhodes,UIKit0/rhodes,louisatome/rhodes,rhosilver/rhodes-1,pslgoh/rhodes,nosolosoftware/rhodes,UIKit0/rhodes,louisatome/rhodes,rhomobile/rhodes,watusi/rhodes,jdrider/rhodes,tauplatform/tau,pslgoh/rhodes,rhosilver/rhodes-1,pslgoh/rhodes,pslgoh/rhodes,watusi/rhodes,rhomobile/rhodes,UIKit0/rhodes,tauplatform/tau,rhomobile/rhodes,jdrider/rhodes,jdrider/rhodes,UIKit0/rhodes,louisatome/rhodes,tauplatform/tau,louisatome/rhodes,jdrider/rhodes,watusi/rhodes,nosolosoftware/rhodes,watusi/rhodes,louisatome/rhodes,watusi/rhodes,rhosilver/rhodes-1,jdrider/rhodes,UIKit0/rhodes,tauplatform/tau,louisatome/rhodes,pslgoh/rhodes,jdrider/rhodes,nosolosoftware/rhodes,tauplatform/tau,UIKit0/rhodes,nosolosoftware/rhodes,tauplatform/tau,louisatome/rhodes,pslgoh/rhodes,rhosilver/rhodes-1,pslgoh/rhodes,rhomobile/rhodes,rhomobile/rhodes,UIKit0/rhodes,rhosilver/rhodes-1,rhosilver/rhodes-1,rhosilver/rhodes-1,nosolosoftware/rhodes,rhomobile/rhodes,rhosilver/rhodes-1,jdrider/rhodes,jdrider/rhodes,nosolosoftware/rhodes,watusi/rhodes,watusi/rhodes,UIKit0/rhodes,rhomobile/rhodes,rhomobile/rhodes,pslgoh/rhodes,UIKit0/rhodes,nosolosoftware/rhodes,watusi/rhodes,tauplatform/tau,nosolosoftware/rhodes,rhosilver/rhodes-1,watusi/rhodes,louisatome/rhodes,louisatome/rhodes,rhomobile/rhodes,tauplatform/tau,watusi/rhodes,jdrider/rhodes,pslgoh/rhodes,rhosilver/rhodes-1,UIKit0/rhodes,tauplatform/tau,rhomobile/rhodes,tauplatform/tau
e63f331dd3a1f20e0f5d961a3569dd75b8104994
tests/regression/62-abortUnless/03-unsound-abortUnless.c
tests/regression/62-abortUnless/03-unsound-abortUnless.c
// PARAM: --set ana.activated[+] abortUnless #include <goblint.h> int zero(int cond) { return 0; } void assume_abort_if_not(int cond) { if (cond) { cond = zero(cond); } else { abort(); } } int main(void) { int x; assume_abort_if_not(x == 8); __goblint_check(x==8); // UNKNOWN! }
Add test abortUnless unsound test
Add test abortUnless unsound test
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
a6b10190b8c629901b451a1519b49e2cee2bb4e1
ouzel/scene/SceneManager.h
ouzel/scene/SceneManager.h
// Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #pragma once #include "utils/Types.h" #include "utils/Noncopyable.h" namespace ouzel { class Engine; namespace scene { class SceneManager: public Noncopyable { friend Engine; public: virtual ~SceneManager(); void draw(); void setScene(Scene* newScene); const Scene* getScene() const { return scene; } void removeScene(Scene* oldScene); protected: SceneManager(); Scene* scene; Scene* nextScene; }; } // namespace scene } // namespace ouzel
// Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #pragma once #include "utils/Types.h" #include "utils/Noncopyable.h" namespace ouzel { class Engine; namespace scene { class SceneManager: public Noncopyable { friend Engine; public: virtual ~SceneManager(); void draw(); void setScene(Scene* newScene); const Scene* getScene() const { return scene; } void removeScene(Scene* oldScene); protected: SceneManager(); Scene* scene = nullptr; Scene* nextScene = nullptr; }; } // namespace scene } // namespace ouzel
Set scene and nextScene to null
Set scene and nextScene to null
C
unlicense
elvman/ouzel,elvman/ouzel,Hotspotmar/ouzel,elnormous/ouzel,elnormous/ouzel,Hotspotmar/ouzel,elnormous/ouzel,Hotspotmar/ouzel
3dee78190789bf7961a326101e417203d05253f5
master/mcoils.c
master/mcoils.c
#include "../modlib.h" #include "../parser.h" #include "mtypes.h" #include "mcoils.h" //Use external master configuration extern MODBUSMasterStatus MODBUSMaster;
Add function for building request01
Add function for building request01
C
mit
Jacajack/modlib
c018da163f50acc6add9df3d74905ec150ce8573
generate/templates/manual/include/callback_wrapper.h
generate/templates/manual/include/callback_wrapper.h
#ifndef CALLBACK_WRAPPER_H #define CALLBACK_WRAPPER_H #include <nan.h> #include <uv.h> using namespace v8; using namespace node; class CallbackWrapper { Nan::Callback* jsCallback; // throttling data, used for callbacks that need to be throttled int throttle; // in milliseconds - if > 0, calls to the JS callback will be throttled uint64_t lastCallTime; public: CallbackWrapper() { jsCallback = NULL; lastCallTime = 0; throttle = 0; } ~CallbackWrapper() { SetCallback(NULL); } bool HasCallback() { return jsCallback != NULL; } Nan::Callback* GetCallback() { return jsCallback; } void SetCallback(Nan::Callback* callback, int throttle = 0) { if(jsCallback) { delete jsCallback; } jsCallback = callback; this->throttle = throttle; } bool WillBeThrottled() { if(!throttle) { return false; } // throttle if needed uint64_t now = uv_hrtime(); if(lastCallTime > 0 && now < lastCallTime + throttle * 1000000) { // throttled return true; } else { lastCallTime = now; return false; } } }; #endif
#ifndef CALLBACK_WRAPPER_H #define CALLBACK_WRAPPER_H #include <nan.h> #include <uv.h> using namespace v8; using namespace node; class CallbackWrapper { Nan::Callback* jsCallback; // throttling data, used for callbacks that need to be throttled int throttle; // in milliseconds - if > 0, calls to the JS callback will be throttled uint64_t lastCallTime; public: CallbackWrapper() { jsCallback = NULL; lastCallTime = 0; throttle = 0; } ~CallbackWrapper() { SetCallback(NULL); } bool HasCallback() { return jsCallback != NULL; } Nan::Callback* GetCallback() { return jsCallback; } void SetCallback(Nan::Callback* callback, int throttle = 0) { if(jsCallback) { delete jsCallback; } jsCallback = callback; this->throttle = throttle; } bool WillBeThrottled() { if(!throttle) { return false; } // throttle if needed uint64_t now = uv_hrtime(); if(lastCallTime > 0 && now < lastCallTime + throttle * (uint64_t)1000000) { // throttled return true; } else { lastCallTime = now; return false; } } }; #endif
Use wider int to calculate throttle window
Use wider int to calculate throttle window
C
mit
nodegit/nodegit,jmurzy/nodegit,jmurzy/nodegit,jmurzy/nodegit,nodegit/nodegit,nodegit/nodegit,nodegit/nodegit,nodegit/nodegit,jmurzy/nodegit,jmurzy/nodegit
cb094452ae663fbc04e8f7c01f3864dee30bf98f
protocols/jabber/jingle/libjingle/talk/base/base64.h
protocols/jabber/jingle/libjingle/talk/base/base64.h
//********************************************************************* //* C_Base64 - a simple base64 encoder and decoder. //* //* Copyright (c) 1999, Bob Withers - [email protected] //* //* This code may be freely used for any purpose, either personal //* or commercial, provided the authors copyright notice remains //* intact. //********************************************************************* #ifndef Base64_H #define Base64_H #include <string> using std::string; // comment if your compiler doesn't use namespaces class Base64 { public: static string encode(const string & data); static string decode(const string & data); static string encodeFromArray(const char * data, size_t len); private: static const string Base64::Base64Table; static const string::size_type Base64::DecodeTable[]; }; #endif
//********************************************************************* //* C_Base64 - a simple base64 encoder and decoder. //* //* Copyright (c) 1999, Bob Withers - [email protected] //* //* This code may be freely used for any purpose, either personal //* or commercial, provided the authors copyright notice remains //* intact. //********************************************************************* #ifndef Base64_H #define Base64_H #include <string> using std::string; // comment if your compiler doesn't use namespaces class Base64 { public: static string encode(const string & data); static string decode(const string & data); static string encodeFromArray(const char * data, size_t len); private: static const string Base64Table; static const string::size_type DecodeTable[]; }; #endif
Make it build with gcc 4.1
Make it build with gcc 4.1 svn path=/branches/kopete/0.12/kopete/; revision=518337
C
lgpl-2.1
josh-wambua/kopete,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,Jtalk/kopete-fork-xep0136,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,josh-wambua/kopete
3bc2b96d8ddb01e739161e4c65fe23473135db40
chrome/common/notification_observer.h
chrome/common/notification_observer.h
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_COMMON_NOTIFICATION_OBSERVER_H_ #define CHROME_COMMON_NOTIFICATION_OBSERVER_H_ class NotificationDetails; class NotificationSource; class NotificationType; // This is the base class for notification observers. When a matching // notification is posted to the notification service, Observe is called. class NotificationObserver { public: virtual ~NotificationObserver(); virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) = 0; }; #endif // CHROME_COMMON_NOTIFICATION_OBSERVER_H_
Add forgotted notification observer header.
Add forgotted notification observer header. git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@9021 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
yitian134/chromium,adobe/chromium,adobe/chromium,ropik/chromium,adobe/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,ropik/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,adobe/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,ropik/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium
b6d178b4dcb894180356c445b8cde644e7dc4327
Squirrel/SQRLShipItLauncher.h
Squirrel/SQRLShipItLauncher.h
// // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt service could not be started. extern const NSInteger SQRLShipItLauncherErrorCouldNotStartService; // Responsible for launching the ShipIt service to actually install an update. @interface SQRLShipItLauncher : NSObject // Attempts to launch the ShipIt service. // // error - If not NULL, set to any error that occurs. // // Returns the XPC connection established, or NULL if an error occurs. If an // error occurs in the connection, it will be automatically released. Retain it // if you'll still need it after that point. - (xpc_connection_t)launch:(NSError **)error; @end
// // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt service could not be started. extern const NSInteger SQRLShipItLauncherErrorCouldNotStartService; // Responsible for launching the ShipIt service to actually install an update. @interface SQRLShipItLauncher : NSObject // Attempts to launch the ShipIt service. // // error - If not NULL, set to any error that occurs. // // Returns the XPC connection established, or NULL if an error occurs. The // connection will be automatically released once it has completed or received // an error. Retain the connection if you'll still need it after that point. - (xpc_connection_t)launch:(NSError **)error; @end
Clarify XPC connection lifecycle for -launch:
Clarify XPC connection lifecycle for -launch:
C
mit
emiscience/Squirrel.Mac,EdZava/Squirrel.Mac,Squirrel/Squirrel.Mac,EdZava/Squirrel.Mac,Squirrel/Squirrel.Mac,emiscience/Squirrel.Mac,EdZava/Squirrel.Mac,emiscience/Squirrel.Mac,Squirrel/Squirrel.Mac
e3a82a7ee478b4693a7f250004d628e822c105ed
src/bin/e_acpi.h
src/bin/e_acpi.h
#ifdef E_TYPEDEFS /* enum for various event types */ typedef enum _E_Acpi_Type { E_ACPI_TYPE_UNKNOWN = 0, E_ACPI_TYPE_LID, E_ACPI_TYPE_BATTERY, E_ACPI_TYPE_BUTTON, E_ACPI_TYPE_SLEEP, E_ACPI_TYPE_WIFI } E_Acpi_Type; /* struct used to pass to event handlers */ typedef struct _E_Event_Acpi E_Event_Acpi; #else # ifndef E_ACPI_H # define E_ACPI_H struct _E_Event_Acpi { const char *device, *bus_id; int type, data; }; EAPI int e_acpi_init(void); EAPI int e_acpi_shutdown(void); extern EAPI int E_EVENT_ACPI_LID; extern EAPI int E_EVENT_ACPI_BATTERY; extern EAPI int E_EVENT_ACPI_BUTTON; extern EAPI int E_EVENT_ACPI_SLEEP; extern EAPI int E_EVENT_ACPI_WIFI; # endif #endif
#ifdef E_TYPEDEFS /* enum for various event types */ typedef enum _E_Acpi_Type { E_ACPI_TYPE_UNKNOWN = 0, E_ACPI_TYPE_BATTERY, E_ACPI_TYPE_BUTTON, E_ACPI_TYPE_FAN, E_ACPI_TYPE_LID, E_ACPI_TYPE_PROCESSOR, E_ACPI_TYPE_SLEEP, E_ACPI_TYPE_POWER, E_ACPI_TYPE_THERMAL, E_ACPI_TYPE_VIDEO, E_ACPI_TYPE_WIFI } E_Acpi_Type; /* struct used to pass to event handlers */ typedef struct _E_Event_Acpi E_Event_Acpi; #else # ifndef E_ACPI_H # define E_ACPI_H struct _E_Event_Acpi { const char *device, *bus_id; int type, data; }; EAPI int e_acpi_init(void); EAPI int e_acpi_shutdown(void); extern EAPI int E_EVENT_ACPI_LID; extern EAPI int E_EVENT_ACPI_BATTERY; extern EAPI int E_EVENT_ACPI_BUTTON; extern EAPI int E_EVENT_ACPI_SLEEP; extern EAPI int E_EVENT_ACPI_WIFI; # endif #endif
Add some more acpi event types that we will handle.
Add some more acpi event types that we will handle. git-svn-id: 6ac5796aeae0cef97fb47bcc287d4ce899c6fa6e@48916 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
C
bsd-2-clause
jordemort/e17,jordemort/e17,jordemort/e17
02b194c36659bfd85485aded4e52c3e587df48b0
Runtime/Rendering/BufferDX11.h
Runtime/Rendering/BufferDX11.h
#pragma once #include "ResourceDX11.h" namespace Mile { class MEAPI BufferDX11 : public ResourceDX11 { public: BufferDX11( RendererDX11* renderer ) : m_buffer( nullptr ), ResourceDX11( renderer ) { } ~BufferDX11( ) { SafeRelease( m_buffer ); } virtual ID3D11Resource* GetResource( ) override; D3D11_BUFFER_DESC GetDesc( ) const { return m_desc; } virtual void* Map( ) { return nullptr; } virtual void UnMap( ) { } protected: ID3D11Buffer* m_buffer; D3D11_BUFFER_DESC m_desc; }; }
#pragma once #include "ResourceDX11.h" namespace Mile { class MEAPI BufferDX11 : public ResourceDX11 { public: BufferDX11( RendererDX11* renderer ) : m_buffer( nullptr ), ResourceDX11( renderer ) { } ~BufferDX11( ) { SafeRelease( m_buffer ); } virtual ID3D11Resource* GetResource( ) override; D3D11_BUFFER_DESC GetDesc( ) const { return m_desc; } virtual void* Map( ) { return nullptr; } virtual bool UnMap( ) { return false; } protected: ID3D11Buffer* m_buffer; D3D11_BUFFER_DESC m_desc; }; }
Modify UnMap function return boolean value that succesfully unmaped.
Modify UnMap function return boolean value that succesfully unmaped.
C
mit
HoRangDev/MileEngine,HoRangDev/MileEngine
eff92ef21f2853cdde235b81b3e4427ce122787d
xFaceLib/xFaceLib/Classes/runtime/XViewController.h
xFaceLib/xFaceLib/Classes/runtime/XViewController.h
/* This file was modified from or inspired by Apache Cordova. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ // // XViewController.h // xFaceLib // // #import <Foundation/Foundation.h> #import <Cordova/CDVViewController.h> @protocol XApplication; @interface XViewController : CDVViewController @property (nonatomic, assign) BOOL loadFromString; @property (weak, nonatomic) id<XApplication> ownerApp; /**< 关联的app */ @end
/* This file was modified from or inspired by Apache Cordova. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ // // XViewController.h // xFaceLib // // #import <Foundation/Foundation.h> #import "Cordova/CDVViewController.h" @protocol XApplication; @interface XViewController : CDVViewController @property (nonatomic, assign) BOOL loadFromString; @property (weak, nonatomic) id<XApplication> ownerApp; /**< 关联的app */ @end
Update the way of importing CDVViewController to avoid compiler warning when using xFaceLib in 3rd party.
Update the way of importing CDVViewController to avoid compiler warning when using xFaceLib in 3rd party.
C
apache-2.0
polyvi/xface-ios,polyvi/xface-ios,polyvi/xface-ios,polyvi/xface-ios
aafe9cec55a481c7982611fd491279c44b2bab41
LinkedList/linkedList.c
LinkedList/linkedList.c
#include <stdio.h> #include <stdlib.h> #ifndef LINKED_LIST_H #define LINKED_LIST_H #include "linkedList.h" #endif struct Node { int data; struct Node* next; }; int main(int arc, char **argc) { // Create size for the nodes struct Node* head = malloc(sizeof(struct Node)); struct Node* middle = malloc(sizeof(struct Node)); struct Node* tail = malloc(sizeof(struct Node)); // Assign their data head->data = 15; middle->data = 20; tail->data = 25; // Chain them together head->next = middle; middle->next = tail; tail->next = NULL; // Create pointer node for traversal struct Node* n = malloc(sizeof(struct Node)); n = head; // Traverse the linked list while(n != NULL) { printf("data is: %i\n", n->data); n = n->next; } return 0; }
#include <stdio.h> #include <stdlib.h> #ifndef LINKED_LIST_H #define LINKED_LIST_H #include "linkedList.h" #endif struct Node { int data; struct Node* next; }; bool hasNode(struct Node* head, int data) { return true; } int main(int arc, char **argc) { // Create size for the nodes struct Node* head = malloc(sizeof(struct Node)); struct Node* middle = malloc(sizeof(struct Node)); struct Node* tail = malloc(sizeof(struct Node)); // Assign their data head->data = 15; middle->data = 20; tail->data = 25; // Chain them together head->next = middle; middle->next = tail; tail->next = NULL; // Create pointer node for traversal struct Node* n = malloc(sizeof(struct Node)); n = head; // Traverse the linked list while(n != NULL) { printf("data is: %i\n", n->data); n = n->next; } return 0; }
Add base struct for hasNode.
Add base struct for hasNode.
C
mit
karysto/c-datastructures,karysto/c-datastructures
6ba1561ebea8ed03aa36e1aaa4892a53f9bc9496
php_extcss3.h
php_extcss3.h
#ifndef PHP_EXTCSS3_H #define PHP_EXTCSS3_H #include <php.h> #include "extcss3/types.h" #define PHP_EXTCSS3_EXTNAME "extcss3" #define PHP_EXTCSS3_EXTVER "1.0.0" #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ extern zend_module_entry extcss3_module_entry; #define phpext_extcss3_ptr &extcss3_module_entry; typedef struct _extcss3_object { extcss3_intern *intern; zend_object std; } extcss3_object; #endif /* PHP_EXTCSS3_H */
#ifndef PHP_EXTCSS3_H #define PHP_EXTCSS3_H #include <php.h> #include "extcss3/types.h" #define PHP_EXTCSS3_EXTNAME "extcss3" #define PHP_EXTCSS3_EXTVER "1.0.1" #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ extern zend_module_entry extcss3_module_entry; #define phpext_extcss3_ptr &extcss3_module_entry; typedef struct _extcss3_object { extcss3_intern *intern; zend_object std; } extcss3_object; #endif /* PHP_EXTCSS3_H */
Change the version to `1.0.1`
Change the version to `1.0.1`
C
mit
sevenval/php-ext-css,sevenval/php-ext-css,sevenval/php-ext-css
b4efe8788da54f5fd42311a4cc8d8d432b181167
project_config/lmic_project_config.h
project_config/lmic_project_config.h
// project-specific definitions for otaa sensor //#define CFG_eu868 1 //#define CFG_us915 1 //#define CFG_au921 1 #define CFG_as923 1 #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP //#define CFG_in866 1 #define CFG_sx1276_radio 1 //#define LMIC_USE_INTERRUPTS
// project-specific definitions for otaa sensor //#define CFG_eu868 1 //#define CFG_us915 1 //#define CFG_au921 1 #define CFG_as923 1 #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP //#define CFG_in866 1 #define CFG_sx1276_radio 1 //#define LMIC_USE_INTERRUPTS #define LMIC_DEBUG_LEVEL 2 #define LMIC_DEBUG_PRINTF_FN lmic_printf
Set debug level to 2 and use a suitable printf function
Set debug level to 2 and use a suitable printf function
C
mit
mcci-catena/arduino-lmic,mcci-catena/arduino-lmic,mcci-catena/arduino-lmic
b621f9804b8dc2274d9d990eb074978151c6d09d
portable_io.c
portable_io.c
#include <stdio.h> #include "portable_io.h" char Prbuf[MAXLLEN]; //将输入输出函数包出来. void portable_puts(char* buf){ while((*buf)!=0){ putchar(*buf); buf++; } } void portable_input_int(int* val){ portable_gets(Prbuf); sscanf(Prbuf, "%d", val); } void portable_gets(char* buf){ gets(buf); }
#include <stdio.h> #include "portable_io.h" char Prbuf[MAXLLEN]; //将输入输出函数包出来. void portable_puts(char* buf){ while((*buf)!=0){ putchar(*buf); buf++; } } void portable_input_int(int* val){ portable_gets(Prbuf); sscanf(Prbuf, "%d", val); } void portable_gets(char* buf){ fgets(buf, MAXLLEN, stdin); }
Change gets to fgets, because gets is unsafe
Change gets to fgets, because gets is unsafe We had to make a pull request to a project with some unsafe C code to make it more secure. This project was the lucky one. Have fun with the security improvements :)
C
mit
sunzx/TarielBASIC,sunzx/TarielBASIC
1154cd8ae5e2835514a5d890d68d082b7dfe26d1
hardware/arduino/esp8266/cores/esp8266/core_esp8266_noniso.c
hardware/arduino/esp8266/cores/esp8266/core_esp8266_noniso.c
#include <stdlib.h> #include "stdlib_noniso.h" long atol_internal(const char* s) { return 0; } float atof_internal(const char* s) { return 0; } char * itoa (int val, char *s, int radix) { *s = 0; return s; } char * ltoa (long val, char *s, int radix) { *s = 0; return s; } char * utoa (unsigned int val, char *s, int radix) { *s = 0; return s; } char * ultoa (unsigned long val, char *s, int radix) { *s = 0; return s; } char * dtostre (double __val, char *__s, unsigned char __prec, unsigned char __flags) { *__s = 0; return __s; } char * dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) { *__s = 0; return __s; }
#include <stdlib.h> #include "stdlib_noniso.h" extern int ets_sprintf(char*, const char*, ...); #define sprintf ets_sprintf long atol_internal(const char* s) { long result = 0; return result; } float atof_internal(const char* s) { float result = 0; return result; } char * itoa (int val, char *s, int radix) { // todo: radix sprintf(s, "%d", val); return s; } char * ltoa (long val, char *s, int radix) { sprintf(s, "%ld", val); return s; } char * utoa (unsigned int val, char *s, int radix) { sprintf(s, "%u", val); return s; } char * ultoa (unsigned long val, char *s, int radix) { sprintf(s, "%lu", val); return s; } char * dtostre (double __val, char *__s, unsigned char __prec, unsigned char __flags) { *__s = 0; return __s; } char * dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) { *__s = 0; return __s; }
Add stubs for itoa, ltoa
Add stubs for itoa, ltoa
C
lgpl-2.1
leftbrainstrain/Arduino-ESP8266,mateuszdw/Arduino,aichi/Arduino-2,paulmand3l/Arduino,NeuralSpaz/Arduino,piersoft/esp8266-Arduino,myrtleTree33/Arduino,piersoft/esp8266-Arduino,ogahara/Arduino,weera00/Arduino,mateuszdw/Arduino,toddtreece/esp8266-Arduino,Cloudino/Arduino,Protoneer/Arduino,mattvenn/Arduino,paulo-raca/ESP8266-Arduino,andrealmeidadomingues/Arduino,jomolinare/Arduino,benwolfe/esp8266-Arduino,koltegirish/Arduino,aichi/Arduino-2,danielchalef/Arduino,plaintea/esp8266-Arduino,sanyaade-iot/Arduino-1,Protoneer/Arduino,plaintea/esp8266-Arduino,eeijcea/Arduino-1,fungxu/Arduino,myrtleTree33/Arduino,tannewt/Arduino,EmuxEvans/Arduino,piersoft/esp8266-Arduino,leftbrainstrain/Arduino-ESP8266,wdoganowski/Arduino,shiitakeo/Arduino,plaintea/esp8266-Arduino,drpjk/Arduino,paulmand3l/Arduino,probonopd/Arduino,mattvenn/Arduino,Protoneer/Arduino,Alfredynho/AgroSis,fungxu/Arduino,SmartArduino/Arduino-1,EmuxEvans/Arduino,Alfredynho/AgroSis,myrtleTree33/Arduino,eeijcea/Arduino-1,andrealmeidadomingues/Arduino,nkolban/Arduino,Cloudino/Arduino,plaintea/esp8266-Arduino,gonium/Arduino,mangelajo/Arduino,koltegirish/Arduino,paulmand3l/Arduino,sanyaade-iot/Arduino-1,plinioseniore/Arduino,adafruit/ESP8266-Arduino,mboufos/esp8266-Arduino,mangelajo/Arduino,plaintea/esp8266-Arduino,andrealmeidadomingues/Arduino,Cloudino/Cloudino-Arduino-IDE,paulmand3l/Arduino,myrtleTree33/Arduino,paulo-raca/ESP8266-Arduino,SmartArduino/Arduino-1,paulo-raca/ESP8266-Arduino,sanyaade-iot/Arduino-1,gonium/Arduino,aichi/Arduino-2,shiitakeo/Arduino,mattvenn/Arduino,myrtleTree33/Arduino,paulo-raca/ESP8266-Arduino,EmuxEvans/Arduino,shiitakeo/Arduino,Cloudino/Cloudino-Arduino-IDE,radut/Arduino,plinioseniore/Arduino,mangelajo/Arduino,weera00/Arduino,NeuralSpaz/Arduino,gonium/Arduino,jomolinare/Arduino,ogahara/Arduino,mc-hamster/esp8266-Arduino,eeijcea/Arduino-1,piersoft/esp8266-Arduino,ssvs111/Arduino,jomolinare/Arduino,mattvenn/Arduino,Cloudino/Cloudino-Arduino-IDE,SmartArduino/Arduino-1,leftbrainstrain/Arduino-ESP8266,Protoneer/Arduino,benwolfe/esp8266-Arduino,leftbrainstrain/Arduino-ESP8266,mattvenn/Arduino,shiitakeo/Arduino,mc-hamster/esp8266-Arduino,tannewt/Arduino,Cloudino/Cloudino-Arduino-IDE,drpjk/Arduino,andrealmeidadomingues/Arduino,benwolfe/esp8266-Arduino,zenmanenergy/Arduino,SmartArduino/Arduino-1,Alfredynho/AgroSis,danielchalef/Arduino,noahchense/Arduino-1,noahchense/Arduino-1,raimohanska/Arduino,smily77/Arduino,probonopd/Arduino,benwolfe/esp8266-Arduino,gonium/Arduino,probonopd/Arduino,eeijcea/Arduino-1,eeijcea/Arduino-1,danielchalef/Arduino,EmuxEvans/Arduino,nkolban/Arduino,spapadim/Arduino,mboufos/esp8266-Arduino,toddtreece/esp8266-Arduino,ssvs111/Arduino,fungxu/Arduino,Protoneer/Arduino,radut/Arduino,spapadim/Arduino,gonium/Arduino,weera00/Arduino,sanyaade-iot/Arduino-1,spapadim/Arduino,paulmand3l/Arduino,Alfredynho/AgroSis,mateuszdw/Arduino,jomolinare/Arduino,mc-hamster/esp8266-Arduino,Cloudino/Arduino,Cloudino/Cloudino-Arduino-IDE,zenmanenergy/Arduino,nkolban/Arduino,mattvenn/Arduino,EmuxEvans/Arduino,Alfredynho/AgroSis,weera00/Arduino,jomolinare/Arduino,probonopd/Arduino,nkolban/Arduino,spapadim/Arduino,probonopd/Arduino,NeuralSpaz/Arduino,zenmanenergy/Arduino,nkolban/Arduino,mboufos/esp8266-Arduino,Cloudino/Cloudino-Arduino-IDE,gonium/Arduino,benwolfe/esp8266-Arduino,adafruit/ESP8266-Arduino,zenmanenergy/Arduino,andrealmeidadomingues/Arduino,adafruit/ESP8266-Arduino,danielchalef/Arduino,myrtleTree33/Arduino,ogahara/Arduino,eeijcea/Arduino-1,weera00/Arduino,radut/Arduino,fungxu/Arduino,aichi/Arduino-2,spapadim/Arduino,SmartArduino/Arduino-1,fungxu/Arduino,koltegirish/Arduino,Cloudino/Arduino,raimohanska/Arduino,Cloudino/Cloudino-Arduino-IDE,danielchalef/Arduino,mateuszdw/Arduino,Protoneer/Arduino,ssvs111/Arduino,drpjk/Arduino,probonopd/Arduino,raimohanska/Arduino,Cloudino/Arduino,aichi/Arduino-2,sanyaade-iot/Arduino-1,fungxu/Arduino,radut/Arduino,noahchense/Arduino-1,Alfredynho/AgroSis,sanyaade-iot/Arduino-1,paulmand3l/Arduino,mateuszdw/Arduino,wdoganowski/Arduino,noahchense/Arduino-1,EmuxEvans/Arduino,raimohanska/Arduino,ogahara/Arduino,smily77/Arduino,drpjk/Arduino,ssvs111/Arduino,koltegirish/Arduino,NeuralSpaz/Arduino,toddtreece/esp8266-Arduino,ssvs111/Arduino,eeijcea/Arduino-1,drpjk/Arduino,mc-hamster/esp8266-Arduino,noahchense/Arduino-1,wdoganowski/Arduino,ssvs111/Arduino,koltegirish/Arduino,mangelajo/Arduino,mboufos/esp8266-Arduino,ogahara/Arduino,plinioseniore/Arduino,adafruit/ESP8266-Arduino,adafruit/ESP8266-Arduino,smily77/Arduino,radut/Arduino,mc-hamster/esp8266-Arduino,koltegirish/Arduino,plinioseniore/Arduino,weera00/Arduino,paulo-raca/ESP8266-Arduino,SmartArduino/Arduino-1,sanyaade-iot/Arduino-1,paulmand3l/Arduino,shiitakeo/Arduino,leftbrainstrain/Arduino-ESP8266,mateuszdw/Arduino,zenmanenergy/Arduino,plinioseniore/Arduino,leftbrainstrain/Arduino-ESP8266,leftbrainstrain/Arduino-ESP8266,smily77/Arduino,noahchense/Arduino-1,Protoneer/Arduino,shiitakeo/Arduino,mangelajo/Arduino,jomolinare/Arduino,wdoganowski/Arduino,radut/Arduino,gonium/Arduino,nkolban/Arduino,mateuszdw/Arduino,myrtleTree33/Arduino,zenmanenergy/Arduino,drpjk/Arduino,smily77/Arduino,tannewt/Arduino,mattvenn/Arduino,plinioseniore/Arduino,tannewt/Arduino,probonopd/Arduino,aichi/Arduino-2,mangelajo/Arduino,wdoganowski/Arduino,fungxu/Arduino,mboufos/esp8266-Arduino,danielchalef/Arduino,ogahara/Arduino,aichi/Arduino-2,smily77/Arduino,Cloudino/Arduino,smily77/Arduino,koltegirish/Arduino,ssvs111/Arduino,raimohanska/Arduino,paulo-raca/ESP8266-Arduino,adafruit/ESP8266-Arduino,raimohanska/Arduino,spapadim/Arduino,drpjk/Arduino,NeuralSpaz/Arduino,tannewt/Arduino,mangelajo/Arduino,spapadim/Arduino,plinioseniore/Arduino,NeuralSpaz/Arduino,SmartArduino/Arduino-1,raimohanska/Arduino,andrealmeidadomingues/Arduino,adafruit/ESP8266-Arduino,shiitakeo/Arduino,EmuxEvans/Arduino,radut/Arduino,paulo-raca/ESP8266-Arduino,Alfredynho/AgroSis,andrealmeidadomingues/Arduino,wdoganowski/Arduino,danielchalef/Arduino,ogahara/Arduino,tannewt/Arduino,NeuralSpaz/Arduino,tannewt/Arduino,zenmanenergy/Arduino,noahchense/Arduino-1,nkolban/Arduino,jomolinare/Arduino,weera00/Arduino,piersoft/esp8266-Arduino,Cloudino/Arduino,wdoganowski/Arduino
bf4ff33e22ae48df8793db370efb85024443fc43
include/llvm/Bytecode/Reader.h
include/llvm/Bytecode/Reader.h
//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=// // // This functionality is implemented by the lib/Bytecode/Reader library. // This library is used to read VM bytecode files from an iostream. // // Note that performance of this library is _crucial_ for performance of the // JIT type applications, so we have designed the bytecode format to support // quick reading. // //===----------------------------------------------------------------------===// #ifndef LLVM_BYTECODE_READER_H #define LLVM_BYTECODE_READER_H #include <string> #include <vector> class Module; // Parse and return a class... // Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr = 0); Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned BufferSize, std::string *ErrorStr = 0); // ReadArchiveFile - Read bytecode files from the specfied .a file, returning // true on error, or false on success. // bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects, std::string *ErrorStr = 0); #endif
//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=// // // This functionality is implemented by the lib/Bytecode/Reader library. // This library is used to read VM bytecode files from an iostream. // // Note that performance of this library is _crucial_ for performance of the // JIT type applications, so we have designed the bytecode format to support // quick reading. // //===----------------------------------------------------------------------===// #ifndef LLVM_BYTECODE_READER_H #define LLVM_BYTECODE_READER_H #include <string> #include <vector> class Module; // Parse and return a class... // Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr = 0); Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned BufferSize, const std::string &ModuleID, std::string *ErrorStr = 0); // ReadArchiveFile - Read bytecode files from the specfied .a file, returning // true on error, or false on success. // bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects, std::string *ErrorStr = 0); #endif
Add information about the module source
Add information about the module source git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@5837 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm
b0e63575233eace638e73b198167f38705ded905
primitiv/c/api.h
primitiv/c/api.h
/* Copyright 2017 The primitiv Authors. All Rights Reserved. */ #ifndef PRIMITIV_C_API_H_ #define PRIMITIV_C_API_H_ #include <primitiv/config.h> #include <primitiv/c/graph.h> #include <primitiv/c/initializer_impl.h> #include <primitiv/c/model.h> #include <primitiv/c/naive_device.h> #include <primitiv/c/functions.h> #include <primitiv/c/parameter.h> #include <primitiv/c/shape.h> #include <primitiv/c/status.h> #include <primitiv/c/tensor.h> #include <primitiv/c/optimizer_impl.h> // Header files for specific device classes. #ifdef PRIMITIV_USE_EIGEN #include <primitiv/c/eigen_device.h> #endif // PRIMITIV_USE_EIGEN #ifdef PRIMITIV_USE_CUDA #include <primitiv/c/cuda_device.h> #endif // PRIMITIV_USE_CUDA #ifdef PRIMITIV_USE_OPENCL #include <primitiv/c/opencl_device.h> #endif // PRIMITIV_C_API_H_
/* Copyright 2017 The primitiv Authors. All Rights Reserved. */ #ifndef PRIMITIV_C_API_H_ #define PRIMITIV_C_API_H_ #include <primitiv/config.h> #include <primitiv/c/graph.h> #include <primitiv/c/initializer_impl.h> #include <primitiv/c/model.h> #include <primitiv/c/naive_device.h> #include <primitiv/c/functions.h> #include <primitiv/c/parameter.h> #include <primitiv/c/shape.h> #include <primitiv/c/status.h> #include <primitiv/c/tensor.h> #include <primitiv/c/optimizer_impl.h> // Header files for specific device classes. #ifdef PRIMITIV_USE_EIGEN #include <primitiv/c/eigen_device.h> #endif // PRIMITIV_USE_EIGEN #ifdef PRIMITIV_USE_CUDA #include <primitiv/c/cuda_device.h> #endif // PRIMITIV_USE_CUDA #ifdef PRIMITIV_USE_OPENCL #include <primitiv/c/opencl_device.h> #endif // PRIMITIV_USE_OPENCL #endif // PRIMITIV_C_API_H_
Add endif statement to the C API header.
Add endif statement to the C API header.
C
apache-2.0
odashi/primitiv,odashi/primitiv,odashi/primitiv
d484ae979059e596c9fb1d4fb02008f86b0e1bd6
Pinmark/NSURL+Pinmark.h
Pinmark/NSURL+Pinmark.h
// // NSURL+Pinmark.h // Pinmark // // Created by Kyle Stevens on 12/24/13. // Copyright (c) 2013 kilovolt42. All rights reserved. // #import <Foundation/Foundation.h> @interface NSURL (Pinmark) - (NSDictionary *)queryParameters; @end
// // NSURL+Pinmark.h // Pinmark // // Created by Kyle Stevens on 12/24/13. // Copyright (c) 2013 kilovolt42. All rights reserved. // #import <Foundation/Foundation.h> @interface NSURL (Pinmark) /** * Creates a dictionary of the query parameters in which fields are keys for the corresponding values. * Does not support array parameters at this time. * * @return A dictionary of query parameters. */ - (NSDictionary *)queryParameters; @end
Add documentation for NSURL category
Add documentation for NSURL category
C
mit
kilovolt42/Pinmarker,kilovolt42/Pinmarker,kilovolt42/Pinmarker
4b386b1c0380d7d3d2a34828308d0290a350a59e
src/include/enesim_rectangle.h
src/include/enesim_rectangle.h
/* ENESIM - Direct Rendering Library * Copyright (C) 2007-2011 Jorge Luis Zapata * * 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, see <http://www.gnu.org/licenses/>. */ #ifndef ENESIM_RECTANGLE_H_ #define ENESIM_RECTANGLE_H_ /** * @defgroup Enesim_Rectangle_Group Rectangle * @{ * @todo */ typedef struct _Enesim_Rectangle { double x; double y; double w; double h; } Enesim_Rectangle; /** * @} */ #endif
Add a rectangle definition for enesim
Add a rectangle definition for enesim
C
lgpl-2.1
turran/enesim,turran/enesim,turran/enesim,turran/enesim
d1fcb30ab60fc32525798a3992e5db0256f5ce71
src/qblowfish.h
src/qblowfish.h
#ifndef QBLOWFISH_H #define QBLOWFISH_H #include <QByteArray> class QBlowfish { public: QBlowfish(const QByteArray &key); bool init(); // Padding: // // Blowfish works on 8-byte blocks. Padding makes it usable even // in case where the input size is not in exact 8-byte blocks. // // If padding is disabled (the default), encrypt() will work only if the // input size (in bytes) is a multiple of 8. (If it's not a multiple of 8, // encrypt() will return a null bytearray.) // // If padding is enabled, we increase the input length to a multiple of 8 // by padding bytes as per PKCS5 // // If padding was enabled during encryption, it should be enabled during // decryption for correct decryption (and vice versa). void setPaddingEnabled(bool enabled); bool paddingEnabled() const; // Encrypt / decrypt QByteArray encrypted(const QByteArray &clearText); QByteArray decrypted(const QByteArray &cipherText); private: // core encrypt/decrypt methods, encrypts/decrypts in-place void coreEncrypt(char *x); void coreDecrypt(char *x); QByteArray m_key; bool m_initialized; bool m_paddingEnabled; QByteArray m_parray; QByteArray m_sbox1, m_sbox2, m_sbox3, m_sbox4; }; #endif // QBLOWFISH_H
#ifndef QBLOWFISH_H #define QBLOWFISH_H #include <QByteArray> class QBlowfish { public: QBlowfish(const QByteArray &key); bool init(); // Padding: // // Blowfish works on 8-byte blocks. Padding makes it usable even // in case where the input size is not in exact 8-byte blocks. // // If padding is disabled (the default), encrypted() will work only if the // input size (in bytes) is a multiple of 8. (If it's not a multiple of 8, // encrypted() will return a null bytearray.) // // If padding is enabled, we increase the input length to a multiple of 8 // by padding bytes as per PKCS5 // // If padding was enabled during encryption, it should be enabled during // decryption for correct decryption (and vice versa). void setPaddingEnabled(bool enabled); bool paddingEnabled() const; // Encrypt / decrypt QByteArray encrypted(const QByteArray &clearText); QByteArray decrypted(const QByteArray &cipherText); private: // core encrypt/decrypt methods, encrypts/decrypts in-place void coreEncrypt(char *x); void coreDecrypt(char *x); QByteArray m_key; bool m_initialized; bool m_paddingEnabled; QByteArray m_parray; QByteArray m_sbox1, m_sbox2, m_sbox3, m_sbox4; }; #endif // QBLOWFISH_H
Fix comment to reflect the change in the function name
Fix comment to reflect the change in the function name
C
mit
roop/qblowfish,roop/qblowfish
17fec70022c30695ca9a1cbaab4494f92668a317
tests/variable.h
tests/variable.h
#ifndef __VARIABLE_H__ #define __VARAIBLE_H__ typedef struct { double weight; double sum; double sum2; } Variable; #define VARIABLE_INIT { 0.0, 0.0, 0.0 } void variable_init (Variable *variable); void variable_add_weighted (Variable *variable, double value, double weight); void variable_add (Variable *variable, double value); double variable_mean (Variable *variable); double variable_standard_deviation (Variable *variable); void variable_reset (Variable *variable); #endif /* __VARIABLE_H__ */
#ifndef __VARIABLE_H__ #define __VARIABLE_H__ typedef struct { double weight; double sum; double sum2; } Variable; #define VARIABLE_INIT { 0.0, 0.0, 0.0 } void variable_init (Variable *variable); void variable_add_weighted (Variable *variable, double value, double weight); void variable_add (Variable *variable, double value); double variable_mean (Variable *variable); double variable_standard_deviation (Variable *variable); void variable_reset (Variable *variable); #endif /* __VARIABLE_H__ */
Fix another header guard oversight
Fix another header guard oversight Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=741252
C
lgpl-2.1
davidgumberg/gtk,ahodesuka/gtk,davidgumberg/gtk,jadahl/gtk,alexlarsson/gtk,jigpu/gtk,alexlarsson/gtk,ahodesuka/gtk,chergert/gtk,chergert/gtk,ahodesuka/gtk,grubersjoe/adwaita,jigpu/gtk,grubersjoe/adwaita,Lyude/gtk-,davidgumberg/gtk,grubersjoe/adwaita,jadahl/gtk,jigpu/gtk,jadahl/gtk,jigpu/gtk,Lyude/gtk-,davidgumberg/gtk,jadahl/gtk,jigpu/gtk,grubersjoe/adwaita,alexlarsson/gtk,chergert/gtk,jadahl/gtk,ahodesuka/gtk,alexlarsson/gtk,chergert/gtk,Adamovskiy/gtk,Adamovskiy/gtk,alexlarsson/gtk,Adamovskiy/gtk,Lyude/gtk-,alexlarsson/gtk,Adamovskiy/gtk,ahodesuka/gtk,chergert/gtk,jigpu/gtk,Adamovskiy/gtk,Lyude/gtk-,grubersjoe/adwaita,grubersjoe/adwaita,Lyude/gtk-,grubersjoe/adwaita,Adamovskiy/gtk,Lyude/gtk-,Adamovskiy/gtk,Lyude/gtk-,Lyude/gtk-,Adamovskiy/gtk,jadahl/gtk,davidgumberg/gtk,ahodesuka/gtk,chergert/gtk,jadahl/gtk,davidgumberg/gtk,davidgumberg/gtk,ahodesuka/gtk,alexlarsson/gtk,chergert/gtk,jigpu/gtk,davidgumberg/gtk,chergert/gtk,jadahl/gtk,jigpu/gtk,grubersjoe/adwaita,ahodesuka/gtk,alexlarsson/gtk
7ec36884712e027f5c4a9124f5b5994b8b5b4db0
src/bin/e_acpi.h
src/bin/e_acpi.h
#ifdef E_TYPEDEFS /* enum for various event types */ typedef enum _E_Acpi_Type { E_ACPI_TYPE_UNKNOWN = 0, E_ACPI_TYPE_LID, E_ACPI_TYPE_BATTERY, E_ACPI_TYPE_BUTTON, E_ACPI_TYPE_SLEEP, E_ACPI_TYPE_WIFI } E_Acpi_Type; /* struct used to pass to event handlers */ typedef struct _E_Event_Acpi E_Event_Acpi; #else # ifndef E_ACPI_H # define E_ACPI_H struct _E_Event_Acpi { const char *device, *bus_id; int type, data; }; EAPI int e_acpi_init(void); EAPI int e_acpi_shutdown(void); extern EAPI int E_EVENT_ACPI_LID; extern EAPI int E_EVENT_ACPI_BATTERY; extern EAPI int E_EVENT_ACPI_BUTTON; extern EAPI int E_EVENT_ACPI_SLEEP; extern EAPI int E_EVENT_ACPI_WIFI; # endif #endif
#ifdef E_TYPEDEFS /* enum for various event types */ typedef enum _E_Acpi_Type { E_ACPI_TYPE_UNKNOWN = 0, E_ACPI_TYPE_BATTERY, E_ACPI_TYPE_BUTTON, E_ACPI_TYPE_FAN, E_ACPI_TYPE_LID, E_ACPI_TYPE_PROCESSOR, E_ACPI_TYPE_SLEEP, E_ACPI_TYPE_POWER, E_ACPI_TYPE_THERMAL, E_ACPI_TYPE_VIDEO, E_ACPI_TYPE_WIFI } E_Acpi_Type; /* struct used to pass to event handlers */ typedef struct _E_Event_Acpi E_Event_Acpi; #else # ifndef E_ACPI_H # define E_ACPI_H struct _E_Event_Acpi { const char *device, *bus_id; int type, data; }; EAPI int e_acpi_init(void); EAPI int e_acpi_shutdown(void); extern EAPI int E_EVENT_ACPI_LID; extern EAPI int E_EVENT_ACPI_BATTERY; extern EAPI int E_EVENT_ACPI_BUTTON; extern EAPI int E_EVENT_ACPI_SLEEP; extern EAPI int E_EVENT_ACPI_WIFI; # endif #endif
Add some more acpi event types that we will handle.
Add some more acpi event types that we will handle. SVN revision: 48916
C
bsd-2-clause
tizenorg/platform.upstream.enlightenment,tizenorg/platform.upstream.enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,tasn/enlightenment,FlorentRevest/Enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tasn/enlightenment,tasn/enlightenment,FlorentRevest/Enlightenment
dce6cca0fa0c6ef05a203c96588906a399c007ba
tests/regression/04-mutex/56-extern_call_by_ptr_rc.c
tests/regression/04-mutex/56-extern_call_by_ptr_rc.c
#include<pthread.h> extern void foo(int (*callback)()); int glob; pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&mutex2); glob=glob+1; // RACE! pthread_mutex_unlock(&mutex2); return NULL; } int bar() { pthread_mutex_lock(&mutex1); glob=glob+1; // RACE! pthread_mutex_unlock(&mutex1); return 0; } int main() { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); foo(bar); pthread_join (id, NULL); return 0; }
Add regression test for extern function calling/spawning function pointer argument
Add regression test for extern function calling/spawning function pointer argument 04/19 previously used custom_libc although that was actually unnecessary.
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
3af52b4c0ff95af8344cacd16a2cee827d6301cc
source/main.c
source/main.c
#include <stdio.h> int main(void) { return(0); }
#include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include <ncurses.h> struct winsize terminalSize; void initScreen(void) { initscr(); noecho(); nocbreak(); } void closeScreen(void) { endwin(); } void getScreenSize(void) { if (ioctl(0, TIOCGWINSZ, (char *) &terminalSize) < 0) { printf("The program canno't determine terminal size.\r\n\r\n"); exit(1); } } int main(void) { initScreen(); getScreenSize(); move(10,10); printw("Terminal size is %dx%d", terminalSize.ws_col, terminalSize.ws_row); getch(); closeScreen(); return(0); }
Add the initial NCurses support for the program.
Add the initial NCurses support for the program.
C
unlicense
pacmanalx/fastview,pacmanalx/fastview
36cba37a4d0e7ca84753315ed4191b195ab3db21
tests/ctests/error_incr_decr.c
tests/ctests/error_incr_decr.c
int main() { // Issue: 3: error: operand of increment operator not a modifiable lvalue 4--; int array[5]; // Issue: 7: error: operand of increment operator not a modifiable lvalue array--; }
Add incr decr error test
Add incr decr error test
C
mit
ShivamSarodia/ShivyC,ShivamSarodia/ShivyC,ShivamSarodia/ShivyC
87a44bd8909a9961fa4e909d2e199920061d08e0
src/control.h
src/control.h
/** * File: control.h * Author: Alex Savarda */ #ifndef CONTROL_H #define CONTROL_H typedef struct { unsigned int d_srcA; unsigned int d_srcB; unsigned int E_dstM; unsigned int e_Cnd; unsigned int D_icode; unsigned int E_icode; unsigned int M_icode; } controlType; #endif /* CONTROL_H */
/* * File: control.h * Author: Alex Savarda */ #ifndef CONTROL_H #define CONTROL_H typedef struct { unsigned int d_srcA; unsigned int d_srcB; unsigned int E_dstM; unsigned int e_Cnd; unsigned int D_icode; unsigned int E_icode; unsigned int M_icode; } controlType; #endif /* CONTROL_H */
Change header to C style.
Change header to C style.
C
isc
sbennett1990/YESS,sbennett1990/YESS,sbennett1990/YESS
73e7eee167ec59d1b908c59a143ba88ef0dff2ad
xhyve-manager.c
xhyve-manager.c
// System #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> // Preprocessed #define PROGRAM_EXEC 0 #define COMMAND 1 #define MACHINE_NAME 2 // Commands #define LIST_COMMAND "list" void list_machines() { fprintf(stdout, "Here be a list of machines:\n"); fprintf(stdout, " - default\n"); fprintf(stdout, " - different\n"); } void usage(char **argv) { fprintf(stderr, "Usage: %s <command> <virtual-machine-name> \n", argv[PROGRAM_EXEC]); } void run_command(char *command, char *machine_name) { fprintf(stdout, "%s machine %s\n", command, machine_name); } int main(int argc, char **argv) { if (argv[MACHINE_NAME] && argv[COMMAND]) { run_command(argv[COMMAND], argv[MACHINE_NAME]); } else { list_machines(); usage(argv); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); }
/** * xhyve-manager * a simple CLI utility to manage xhyve virtual machines. **/ // System #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> // Preprocessed #define PROGRAM_EXEC 0 #define COMMAND 1 #define MACHINE_NAME 2 // Valid Commands char *commands[] = { "list", "create", "delete", "start" }; void list_machines() { fprintf(stdout, "Here be a list of machines:\n"); fprintf(stdout, " - default\n"); fprintf(stdout, " - different\n"); } void usage(char **argv) { fprintf(stderr, "Usage: %s <command> <virtual-machine-name> \n", argv[PROGRAM_EXEC]); } void run_command(char *command, char *machine_name) { fprintf(stdout, "%s machine %s\n", command, machine_name); } int main(int argc, char **argv) { if (argv[MACHINE_NAME] && argv[COMMAND]) { run_command(argv[COMMAND], argv[MACHINE_NAME]); } else if (!argv[MACHINE_NAME] && argv[COMMAND]) { list_machines(); } else { usage(argv); exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); }
Add array of valid commands.
Add array of valid commands.
C
bsd-3-clause
0x414A/xhyve-manager
1ec8e194eb28bc451abab3624ff2cb85f22f7b6c
test/FrontendC/func-aligned.c
test/FrontendC/func-aligned.c
// RUN: %llvmgcc %s -S -emit-llvm -o - | FileCheck %s // rdar://7270273 void foo() __attribute__((aligned (64))); void foo() { // CHECK: define void @foo() {{.*}} align 64 }
Test case for aligned attribute on function declaration.
Test case for aligned attribute on function declaration. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@83234 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm
025fba5a10df4643626c91c96c8ecf2042b19218
cocos2d-ui/cocos2d-ui.h
cocos2d-ui/cocos2d-ui.h
/* * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (c) 2013 Apportable Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice 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. */ // Cocos2d-UI #import "CCControl.h" #import "CCButton.h" #import "CCScrollView.h" #import "CCTableView.h" #import "CCTextField.h" // CCBReader #import "CCBuilderReader.h"
/* * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (c) 2013 Apportable Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice 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. */ // Cocos2d-UI #import "CCControl.h" #import "CCButton.h" #import "CCScrollView.h" #import "CCTableView.h" #import "CCTextField.h" #import "CCSlider.h" // CCBReader #import "CCBuilderReader.h"
Add CCSlider to the UI headers
Add CCSlider to the UI headers Former-commit-id: ea90510d6f80d76b2f53ba1e2bc469e9304eb642
C
mit
DNESS/cocos2d-objc,richardgroves/cocos2d-iphone,tambarskjelve/cocos2d-objc,jason-puck/cocos2d-iphone,SuPair/cocos2d-objc,yaoxiaoyong/cocos2d-objc,seem-sky/cocos2d-swift,cogddo/cocos2d-objc,oxeron/cocos2d-objc,dnessorga/cocos2d-objc,codepython/cocos2d-objc,codepython/cocos2d-objc,zaneLou/cocos2d-objc,SuPair/cocos2d-objc,codepython/cocos2d-objc,finthamoussu/cocos2d-objc,yaoxiaoyong/cocos2d-objc,SuPair/cocos2d-objc,jason-puck/cocos2d-iphone,cogddo/cocos2d-objc,lpeancovschi/cocos2d-objc,codepython/cocos2d-objc,DNESS/cocos2d-objc,cocos2d/cocos2d-objc,knight2010/cocos2d-objc,dnessorga/cocos2d-objc,lpeancovschi/cocos2d-objc,DNESS/cocos2d-objc,zaneLou/cocos2d-objc,seem-sky/cocos2d-swift,dnessorga/cocos2d-objc,dnessorga/cocos2d-objc,nader-eloshaiker/cocos2d-objc,nader-eloshaiker/cocos2d-objc,liduanw/cocos2d-objc,knight2010/cocos2d-objc,richardgroves/cocos2d-iphone,knight2010/cocos2d-objc,TukekeSoft/cocos2d-spritebuilder,liduanw/cocos2d-objc,liduanw/cocos2d-objc,knight2010/cocos2d-objc,dnessorga/cocos2d-objc,savysoda/cocos2d-objc,SuPair/cocos2d-objc,finthamoussu/cocos2d-objc,cogddo/cocos2d-objc,cocos2d/cocos2d-objc,lpeancovschi/cocos2d-objc,nader-eloshaiker/cocos2d-objc,yaoxiaoyong/cocos2d-objc,TukekeSoft/cocos2d-spritebuilder,finthamoussu/cocos2d-objc,TukekeSoft/cocos2d-spritebuilder,richardgroves/cocos2d-iphone,tambarskjelve/cocos2d-objc,SuPair/cocos2d-objc,finthamoussu/cocos2d-objc,savysoda/cocos2d-objc,seem-sky/cocos2d-swift,tambarskjelve/cocos2d-objc,TukekeSoft/cocos2d-spritebuilder,tambarskjelve/cocos2d-objc,liduanw/cocos2d-objc,savysoda/cocos2d-objc,cogddo/cocos2d-objc,zaneLou/cocos2d-objc,tambarskjelve/cocos2d-objc,savysoda/cocos2d-objc,zaneLou/cocos2d-objc,nader-eloshaiker/cocos2d-objc,yaoxiaoyong/cocos2d-objc,seem-sky/cocos2d-swift,DNESS/cocos2d-objc,liduanw/cocos2d-objc,jason-puck/cocos2d-iphone,yaoxiaoyong/cocos2d-objc,oxeron/cocos2d-objc,lpeancovschi/cocos2d-objc,DNESS/cocos2d-objc
05958a67e44b1b08381db79cf2116db502616704
tests/sv-comp/basic/for_odd_vesal_true-unreach-call.c
tests/sv-comp/basic/for_odd_vesal_true-unreach-call.c
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: __VERIFIER_error(); } return; } void fun() { int i; // Ultimate can't handle i declared in for for (i = 1; i < 1000; i += 2) { __VERIFIER_assert(i < 2000); } // Ultimate benefits from cycle invariant: i % 2 == 1 __VERIFIER_assert(i == 1001); } int main() { fun(); return 0; }
Add Vesal's oddness cycle invariant example
Add Vesal's oddness cycle invariant example
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
27b3c2fae342747e25b76eb82524650fde42ed47
src/compiler_llvm/utils_llvm.h
src/compiler_llvm/utils_llvm.h
/* * Copyright (C) 2011 The Android Open Source Project * * 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 ART_SRC_UTILS_LLVM_H_ #define ART_SRC_UTILS_LLVM_H_ #include "base/stringprintf.h" #include <llvm/Analysis/Verifier.h> #include <stdint.h> #include <string> namespace art { #ifndef NDEBUG #define VERIFY_LLVM_FUNCTION(func) llvm::verifyFunction(func, llvm::PrintMessageAction) #else #define VERIFY_LLVM_FUNCTION(func) #endif inline static std::string ElfFuncName(uint32_t idx) { return StringPrintf("Art%u", static_cast<unsigned int>(idx)); } class CStringLessThanComparator { public: bool operator()(const char* lhs, const char* rhs) const { return (strcmp(lhs, rhs) < 0); } }; } // namespace art #endif // ART_SRC_UTILS_LLVM_H_
/* * Copyright (C) 2011 The Android Open Source Project * * 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 ART_SRC_UTILS_LLVM_H_ #define ART_SRC_UTILS_LLVM_H_ #include "base/stringprintf.h" #include <llvm/Analysis/Verifier.h> #include <stdint.h> #include <string> namespace art { #ifndef NDEBUG #define VERIFY_LLVM_FUNCTION(func) llvm::verifyFunction(func, llvm::AbortProcessAction) #else #define VERIFY_LLVM_FUNCTION(func) #endif inline static std::string ElfFuncName(uint32_t idx) { return StringPrintf("Art%u", static_cast<unsigned int>(idx)); } class CStringLessThanComparator { public: bool operator()(const char* lhs, const char* rhs) const { return (strcmp(lhs, rhs) < 0); } }; } // namespace art #endif // ART_SRC_UTILS_LLVM_H_
Abort LLVM in debug builds when the IR doesn't verify.
Abort LLVM in debug builds when the IR doesn't verify. Change-Id: I71a035b260c895adde21ba90c84afa1f0b0ec997
C
apache-2.0
treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst
bf945fd0e8808702fe10a6375e696b96fb5512f8
insert_mode.c
insert_mode.c
#include "mode.h" #include <ctype.h> #include <termbox.h> #include "buffer.h" #include "gap.h" #include "editor.h" static void insert_mode_entered(editor_t *editor) { editor_status_msg(editor, "-- INSERT --"); } static void insert_mode_key_pressed(editor_t* editor, struct tb_event* ev) { buffer_t *buffer = editor->window->buffer; gapbuf_t *gb = buffer->text; int *cursor = &editor->window->cursor; char ch; switch (ev->key) { case TB_KEY_ESC: case TB_KEY_CTRL_C: editor_status_msg(editor, ""); editor_pop_mode(editor); return; case TB_KEY_BACKSPACE2: if (cursor > 0) { gb_del(gb, 1, (*cursor)--); buffer->dirty = 1; } return; case TB_KEY_ENTER: ch = '\n'; break; case TB_KEY_SPACE: ch = ' '; break; default: ch = ev->ch; break; } gb_putchar(gb, ch, (*cursor)++); buffer->dirty = 1; } static editing_mode_t impl = { insert_mode_entered, insert_mode_key_pressed }; editing_mode_t *insert_mode(void) { return &impl; }
#include "mode.h" #include <ctype.h> #include <termbox.h> #include "buffer.h" #include "gap.h" #include "editor.h" static void insert_mode_entered(editor_t *editor) { editor_status_msg(editor, "-- INSERT --"); } static void insert_mode_key_pressed(editor_t* editor, struct tb_event* ev) { buffer_t *buffer = editor->window->buffer; gapbuf_t *gb = buffer->text; int *cursor = &editor->window->cursor; char ch; switch (ev->key) { case TB_KEY_ESC: case TB_KEY_CTRL_C: editor_status_msg(editor, ""); editor_pop_mode(editor); return; case TB_KEY_BACKSPACE2: if (*cursor > 0) { gb_del(gb, 1, (*cursor)--); buffer->dirty = 1; } return; case TB_KEY_ENTER: ch = '\n'; break; case TB_KEY_SPACE: ch = ' '; break; default: ch = ev->ch; break; } gb_putchar(gb, ch, (*cursor)++); buffer->dirty = 1; } static editing_mode_t impl = { insert_mode_entered, insert_mode_key_pressed }; editing_mode_t *insert_mode(void) { return &impl; }
Fix backspace at start of file.
Fix backspace at start of file.
C
mit
isbadawi/badavi
14e47d26ce9d896bc47e4873175013c529e14e4c
PcapDotNet/src/PcapDotNet.Core/PacketTotalStatistics.h
PcapDotNet/src/PcapDotNet.Core/PacketTotalStatistics.h
#pragma once #include "PcapDeclarations.h" namespace PcapDotNet { namespace Core { /// <summary> /// Statistics on capture from the start of the run. /// </summary> public ref class PacketTotalStatistics sealed : System::IEquatable<PacketTotalStatistics^> { public: /// <summary> /// Number of packets transited on the network. /// </summary> property unsigned int PacketsReceived { unsigned int get(); } /// <summary> /// Number of packets dropped by the driver. /// </summary> property unsigned int PacketsDroppedByDriver { unsigned int get(); } /// <summary> /// Number of packets dropped by the interface. /// Not yet supported. /// </summary> property unsigned int PacketsDroppedByInterface { unsigned int get(); } /// <summary> /// Win32 specific. Number of packets captured, i.e number of packets that are accepted by the filter, that find place in the kernel buffer and therefore that actually reach the application. /// </summary> property unsigned int PacketsCaptured { unsigned int get(); } virtual bool Equals(PacketTotalStatistics^ other); virtual bool Equals(System::Object^ obj) override; virtual int GetHashCode() override; virtual System::String^ ToString() override; internal: PacketTotalStatistics(const pcap_stat& statistics, int statisticsSize); private: unsigned int _packetsReceived; unsigned int _packetsDroppedByDriver; unsigned int _packetsDroppedByInterface; unsigned int _packetsCaptured; }; }}
#pragma once #include "PcapDeclarations.h" namespace PcapDotNet { namespace Core { /// <summary> /// Statistics on capture from the start of the run. /// </summary> public ref class PacketTotalStatistics sealed : System::IEquatable<PacketTotalStatistics^> { public: /// <summary> /// Number of packets transited on the network. /// </summary> property unsigned int PacketsReceived { unsigned int get(); } /// <summary> /// Number of packets dropped by the driver. /// </summary> property unsigned int PacketsDroppedByDriver { unsigned int get(); } // TODO: Update documentation when support is added. /// <summary> /// Number of packets dropped by the interface. /// Not yet supported. /// </summary> property unsigned int PacketsDroppedByInterface { unsigned int get(); } /// <summary> /// Win32 specific. Number of packets captured, i.e number of packets that are accepted by the filter, that find place in the kernel buffer and therefore that actually reach the application. /// </summary> property unsigned int PacketsCaptured { unsigned int get(); } virtual bool Equals(PacketTotalStatistics^ other); virtual bool Equals(System::Object^ obj) override; virtual int GetHashCode() override; virtual System::String^ ToString() override; internal: PacketTotalStatistics(const pcap_stat& statistics, int statisticsSize); private: unsigned int _packetsReceived; unsigned int _packetsDroppedByDriver; unsigned int _packetsDroppedByInterface; unsigned int _packetsCaptured; }; }}
Add a TODO to update PacketsDroppedByInterface documentation when it gets supported.
Add a TODO to update PacketsDroppedByInterface documentation when it gets supported.
C
bsd-3-clause
prvillagra/Pcap.Net,bricknerb/Pcap.Net,OperatorOverload/Pcap.Net,suarez-duran-m/pcap-pade,petredimov/Pcap.Net,giokats/Pcap.Net,OperatorOverload/Pcap.Net,suarez-duran-m/pcap-pade,bricknerb/Pcap.Net,prvillagra/Pcap.Net,bricknerb/Pcap.Net,giokats/Pcap.Net,petredimov/Pcap.Net,suarez-duran-m/pcap-pade,OperatorOverload/Pcap.Net,giokats/Pcap.Net,petredimov/Pcap.Net,prvillagra/Pcap.Net
3ff4727396312ce53c2b78a111bfb8d691148751
cbits/check-mx.c
cbits/check-mx.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <netinet/in.h> #include <resolv.h> int check_mx(char *domain) { u_char nsbuf[4096]; return res_query(domain, ns_c_any, ns_t_mx, nsbuf, sizeof (nsbuf)) > 0; }
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <netinet/in.h> #include <resolv.h> int check_mx(char *domain) { u_char nsbuf[4096]; return res_query(domain, ns_c_in, ns_t_mx, nsbuf, sizeof (nsbuf)) > 0; }
Use C_IN for class of information
Use C_IN for class of information
C
bsd-3-clause
qoelet/check-email,chrisdone/check-email
0737f040b1a4fc0a8edbef63fecce90cb77a487b
include/os/utils.h
include/os/utils.h
//////////////////////////////////////////////////////////////////////////////////////////////// /// /// @file /// @author Kuba Sejdak /// @date 11.12.2016 /// /// @copyright This file is a part of cosmos OS. All rights reserved. /// //////////////////////////////////////////////////////////////////////////////////////////////// #ifndef UTILS_H #define UTILS_H #define REGISTER(type, addr) ((volatile type *) (addr)) #endif
Add macro for defining memory-mapped registers.
lib: Add macro for defining memory-mapped registers.
C
bsd-2-clause
ksejdak/cosmos,ksejdak/cosmos,ksejdak/cosmos