commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
388d4312a910f9dc1af9c2ae95b0811a9ec07dd9
src/xenpong/xenpong.h
src/xenpong/xenpong.h
#if !defined(_XENIFACE_H_) #define _XENIFACE_H_ #include <ntddk.h> #pragma warning(disable:4100 4057) typedef struct _DEVICE_EXTENSION { PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT LowerDeviceObject; PDEVICE_OBJECT Pdo; UNICODE_STRING ifname; IO_REMOVE_LOCK RemoveLock; } DEVICE_EXTENSION, *PDEVICE_EXTENSION; DRIVER_INITIALIZE DriverEntry; DRIVER_UNLOAD DriverUnload; DRIVER_ADD_DEVICE AddDevice; _Dispatch_type_(IRP_MJ_PNP) DRIVER_DISPATCH DispatchPnp; #endif // _XENIFACE_H_
#if !defined(_XENIFACE_H_) #define _XENIFACE_H_ #include <ntddk.h> #pragma warning(disable:4100 4057) typedef struct _DEVICE_EXTENSION { PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT LowerDeviceObject; PDEVICE_OBJECT Pdo; UNICODE_STRING ifname; IO_REMOVE_LOCK RemoveLock; } DEVICE_EXTENSION, *PDEVICE_EXTENSION; DRIVER_INITIALIZE DriverEntry; DRIVER_UNLOAD DriverUnload; DRIVER_ADD_DEVICE AddDevice; _Dispatch_type_(IRP_MJ_PNP) DRIVER_DISPATCH DispatchPnp; NTSTATUS StartDevice( __in PDEVICE_OBJECT DeviceObject, __in PIRP Irp ); NTSTATUS StopDevice( __in PDEVICE_OBJECT DeviceObject, __in PIRP Irp ); #endif // _XENIFACE_H_
Add declarations for StartDevice and StopDevice
Add declarations for StartDevice and StopDevice
C
bsd-2-clause
perf101/xenpong,perf101/xenpong,perf101/xenpong,perf101/xenpong
69c3f107e2c8a2eef56249a87c8e192d8f6abe5c
sys/sparc64/include/ieeefp.h
sys/sparc64/include/ieeefp.h
/* * Written by J.T. Conklin, Apr 6, 1995 * Public domain. * $FreeBSD$ */ #ifndef _MACHINE_IEEEFP_H_ #define _MACHINE_IEEEFP_H_ typedef int fp_except_t; #define FP_X_IMP 0x01 /* imprecise (loss of precision) */ #define FP_X_DZ 0x02 /* divide-by-zero exception */ #define FP_X_UFL 0x04 /* underflow exception */ #define FP_X_OFL 0x08 /* overflow exception */ #define FP_X_INV 0x10 /* invalid operation exception */ typedef enum { FP_RN=0, /* round to nearest representable number */ FP_RZ=1, /* round to zero (truncate) */ FP_RP=2, /* round toward positive infinity */ FP_RM=3 /* round toward negative infinity */ } fp_rnd_t; #endif /* _MACHINE_IEEEFP_H_ */
/* * Written by J.T. Conklin, Apr 6, 1995 * Public domain. * $FreeBSD$ */ #ifndef _MACHINE_IEEEFP_H_ #define _MACHINE_IEEEFP_H_ #include <machine/fsr.h> typedef int fp_except_t; #define FP_X_IMP FSR_NX /* imprecise (loss of precision) */ #define FP_X_DZ FSR_DZ /* divide-by-zero exception */ #define FP_X_UFL FSR_UF /* underflow exception */ #define FP_X_OFL FSR_OF /* overflow exception */ #define FP_X_INV FSR_NV /* invalid operation exception */ typedef enum { FP_RN = FSR_RD_N, /* round to nearest representable number */ FP_RZ = FSR_RD_Z, /* round to zero (truncate) */ FP_RP = FSR_RD_PINF, /* round toward positive infinity */ FP_RM = FSR_RD_NINF /* round toward negative infinity */ } fp_rnd_t; #endif /* _MACHINE_IEEEFP_H_ */
Use the definitions in machine/fsr.h instead of duplicating these magic numbers here (the values need to correspond to the %fsr ones for some libc functions to work right).
Use the definitions in machine/fsr.h instead of duplicating these magic numbers here (the values need to correspond to the %fsr ones for some libc functions to work right).
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
cbca462157dde6080fb77b611fbb8877834d07be
Source/Tests/Collection/FakeWithoutCount.h
Source/Tests/Collection/FakeWithoutCount.h
// OCHamcrest by Jon Reid, https://qualitycoding.org/ // Copyright 2018 hamcrest.org. See LICENSE.txt @import Foundation; NS_ASSUME_NONNULL_BEGIN @interface FakeWithoutCount : NSObject + (id)fake; @end NS_ASSUME_NONNULL_END
// OCHamcrest by Jon Reid, https://qualitycoding.org/ // Copyright 2018 hamcrest.org. See LICENSE.txt @import Foundation; NS_ASSUME_NONNULL_BEGIN @interface FakeWithoutCount : NSObject + (instancetype)fake; @end NS_ASSUME_NONNULL_END
Test only: Correct id to instancetype
Test only: Correct id to instancetype
C
bsd-2-clause
hamcrest/OCHamcrest,hamcrest/OCHamcrest,hamcrest/OCHamcrest
e8f4eed954eaa0c5020d61250b8222c41511f413
test/CodeGen/pr9614.c
test/CodeGen/pr9614.c
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s extern int foo_alias (void) __asm ("foo"); inline int foo (void) { return foo_alias (); } int f(void) { return foo(); } // CHECK-NOT: define // CHECK: define i32 @f() // CHECK: %call = call i32 @foo() // CHECK: ret i32 %call // CHECK-NOT: define
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s extern int foo_alias (void) __asm ("foo"); inline int foo (void) { return foo_alias (); } int f(void) { return foo(); } // CHECK-NOT: define // CHECK: define i32 @f() // CHECK: call i32 @foo() // CHECK-NEXT: ret i32 // CHECK-NOT: define
Fix this tests on the bots.
Fix this tests on the bots. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@143052 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
9710c394fb7c54d91aa9929f9530a9fa78cab8de
tree/treeplayer/inc/TFriendProxy.h
tree/treeplayer/inc/TFriendProxy.h
// @(#)root/treeplayer:$Id$ // Author: Philippe Canal 01/06/2004 /************************************************************************* * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers and al. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TFriendProxy #define ROOT_TFriendProxy #include "TBranchProxyDirector.h" class TTree; namespace ROOT { namespace Internal { class TFriendProxy { protected: TBranchProxyDirector fDirector; // contain pointer to TTree and entry to be read Int_t fIndex; // Index of this tree in the list of friends public: TFriendProxy(); TFriendProxy(TBranchProxyDirector *director, TTree *main, Int_t index); Long64_t GetReadEntry() const; void ResetReadEntry(); void Update(TTree *newmain); }; } // namespace Internal } // namespace ROOT #endif
// @(#)root/treeplayer:$Id$ // Author: Philippe Canal 01/06/2004 /************************************************************************* * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers and al. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TFriendProxy #define ROOT_TFriendProxy #include "TBranchProxyDirector.h" class TTree; namespace ROOT { namespace Internal { class TFriendProxy { protected: TBranchProxyDirector fDirector; // contain pointer to TTree and entry to be read Int_t fIndex; // Index of this tree in the list of friends public: TFriendProxy(); TFriendProxy(TBranchProxyDirector *director, TTree *main, Int_t index); TBranchProxyDirector *GetDirector() { return &fDirector; } Long64_t GetReadEntry() const; void ResetReadEntry(); void Update(TTree *newmain); }; } // namespace Internal } // namespace ROOT #endif
Add accessor to Director of a FriendProxy
Add accessor to Director of a FriendProxy
C
lgpl-2.1
root-mirror/root,olifre/root,olifre/root,olifre/root,root-mirror/root,karies/root,olifre/root,root-mirror/root,olifre/root,karies/root,karies/root,karies/root,olifre/root,root-mirror/root,olifre/root,karies/root,root-mirror/root,karies/root,olifre/root,karies/root,karies/root,root-mirror/root,root-mirror/root,olifre/root,root-mirror/root,olifre/root,karies/root,root-mirror/root,karies/root,karies/root,root-mirror/root,olifre/root,root-mirror/root
ddf88fda672bf43c057eca80334d04be837ad336
src/commands.c
src/commands.c
#include "commands.h" #include <stdio.h> #include <string.h> #include "util.h" static void print_commands_help() { puts(" Commands available:\n"); puts(" :quit \tExit laco"); puts(" :help \tDisplay this list of commands"); } void handle_command(struct LacoState* laco, char* line) { if(laco != NULL && line != NULL) { const char* command = line + 1; if(strcmp(command, "quit") == 0) { laco_kill(laco, 0, "Exiting laco..."); } else if(strcmp(command, "help") == 0) { print_commands_help(); } /* Make it seem like this was an empty line */ line[0] = '\0'; } }
#include "commands.h" #include <stdbool.h> #include <stdio.h> #include "util.h" static const char* quit_matches[] = {"quit"}; static const char* help_matches[] = {"help"}; static void print_commands_help() { puts(" Commands available:\n"); puts(" :quit \tExit laco"); puts(" :help \tDisplay this list of commands"); } static inline bool is_quit(const char* command) { return laco_is_match(quit_matches, command); } static inline bool is_help(const char* command) { return laco_is_match(help_matches, command); } void handle_command(struct LacoState* laco, char* line) { if(laco != NULL && line != NULL) { const char* command = line + 1; if(is_quit(command)) { laco_kill(laco, 0, "Exiting laco..."); } else if(is_help(command)) { print_commands_help(); } /* Make it seem like this was an empty line */ line[0] = '\0'; } }
Use laco_is_match for command handling
Use laco_is_match for command handling
C
bsd-2-clause
sourrust/laco
431357bc5ced7c1ffd6616f681c195ce45c61462
scriptobject.h
scriptobject.h
#ifndef INCLUDED_SCRIPT_OBJECT_H_ #define INCLUDED_SCRIPT_OBJECT_H_ #include "browser.h" #include "npapi-headers/npruntime.h" class EmacsInstance; class ScriptObject : public NPObject { public: static ScriptObject* create(NPP npp); void invalidate(); bool hasMethod(NPIdentifier name); bool invoke(NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); bool enumerate(NPIdentifier **identifiers, uint32_t *identifierCount); static NPObject* allocateThunk(NPP npp, NPClass *aClass); static void deallocateThunk(NPObject *npobj); static void invalidateThunk(NPObject *npobj); static bool hasMethodThunk(NPObject *npobj, NPIdentifier name); static bool invokeThunk(NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); static bool enumerateThunk(NPObject *npobj, NPIdentifier **identifiers, uint32_t *identifierCount); private: ScriptObject(NPP npp); ~ScriptObject(); EmacsInstance* emacsInstance(); NPP npp_; }; #endif // INCLUDED_SCRIPT_OBJECT_H_
#ifndef INCLUDED_SCRIPT_OBJECT_H_ #define INCLUDED_SCRIPT_OBJECT_H_ #include "browser.h" #include "npapi-headers/npruntime.h" #include "util.h" class EmacsInstance; class ScriptObject : public NPObject { public: static ScriptObject* create(NPP npp); void invalidate(); bool hasMethod(NPIdentifier name); bool invoke(NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); bool enumerate(NPIdentifier **identifiers, uint32_t *identifierCount); static NPObject* allocateThunk(NPP npp, NPClass *aClass); static void deallocateThunk(NPObject *npobj); static void invalidateThunk(NPObject *npobj); static bool hasMethodThunk(NPObject *npobj, NPIdentifier name); static bool invokeThunk(NPObject *npobj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); static bool enumerateThunk(NPObject *npobj, NPIdentifier **identifiers, uint32_t *identifierCount); private: ScriptObject(NPP npp); ~ScriptObject(); EmacsInstance* emacsInstance(); NPP npp_; DISALLOW_COPY_AND_ASSIGN(ScriptObject); }; #endif // INCLUDED_SCRIPT_OBJECT_H_
Disable copy and assign on ScriptObject
Disable copy and assign on ScriptObject
C
mit
davidben/embedded-emacs,davidben/embedded-emacs,davidben/embedded-emacs
3cb53ef14172a14cf05f2777847538d492ec8421
RFKeyboardToolbar/RFToolbarButton.h
RFKeyboardToolbar/RFToolbarButton.h
// // RFToolbarButton.h // // Created by Rudd Fawcett on 12/3/13. // Copyright (c) 2013 Rudd Fawcett. All rights reserved. // #import <UIKit/UIKit.h> /** * The block used for each button. */ typedef void (^eventHandlerBlock)(); @interface RFToolbarButton : UIButton /** * Creates a new RFToolbarButton. * * @param title The string to show on the button. * * @return A new button. */ + (instancetype)buttonWithTitle:(NSString *)title; /** * Creates a new RFToolbarButton. * * @param title The string to show on the button. * @param eventHandler The event handler block. * @param controlEvent The type of event. * * @return A new button. */ + (instancetype)buttonWithTitle:(NSString *)title andEventHandler:(eventHandlerBlock)eventHandler forControlEvents:(UIControlEvents)controlEvent; /** * Adds the event handler for the button. * * @param eventHandler The event handler block. * @param controlEvent The type of event. */ - (void)addEventHandler:(eventHandlerBlock)eventHandler forControlEvents:(UIControlEvents)controlEvent; @end
// // RFToolbarButton.h // // Created by Rudd Fawcett on 12/3/13. // Copyright (c) 2013 Rudd Fawcett. All rights reserved. // #import <UIKit/UIKit.h> /** * The block used for each button. */ typedef void (^eventHandlerBlock)(void); @interface RFToolbarButton : UIButton /** * Creates a new RFToolbarButton. * * @param title The string to show on the button. * * @return A new button. */ + (instancetype)buttonWithTitle:(NSString *)title; /** * Creates a new RFToolbarButton. * * @param title The string to show on the button. * @param eventHandler The event handler block. * @param controlEvent The type of event. * * @return A new button. */ + (instancetype)buttonWithTitle:(NSString *)title andEventHandler:(eventHandlerBlock)eventHandler forControlEvents:(UIControlEvents)controlEvent; /** * Adds the event handler for the button. * * @param eventHandler The event handler block. * @param controlEvent The type of event. */ - (void)addEventHandler:(eventHandlerBlock)eventHandler forControlEvents:(UIControlEvents)controlEvent; @end
Fix warning about block declaration semantics
Fix warning about block declaration semantics
C
mit
ruddfawcett/RFKeyboardToolbar
fb2a0e23314d7abf9ab91bda09cc335aed9b1865
config.h
config.h
#ifndef CONFIG_H #define CONFIG_H #define YLE_DOWNLOADER_GUI_VERSION "2.0" #define WINDOWS_YLE_DL_DIR "yle-dl-windows-1.99.7" #endif // CONFIG_H
#ifndef CONFIG_H #define CONFIG_H #define YLE_DOWNLOADER_GUI_VERSION "2.0" #define WINDOWS_YLE_DL_DIR "yle-dl-windows" #endif // CONFIG_H
Change WINDOWS_YLE_DL_DIR to not have a version number.
Change WINDOWS_YLE_DL_DIR to not have a version number.
C
unlicense
hekkup/qyledl,hekkup/qyledl,hekkup/qyledl
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
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
052b3fc55ae2ee20e2ab6d9e29fde8a4fee7a68b
src/pomodoro.h
src/pomodoro.h
// ---------------------------------------------------------------------------- // pomodoro - Defines a model to track progress through the Pomodoro Technique // Copyright (c) 2013 Jonathan Speicher (jon.speicher@gmail.com) // 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 (jon.speicher@gmail.com) // 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 <fgenfb@yahoo.com> 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 <fgenfb@yahoo.com> 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 <msfclipper@yahoo.com> */ #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 <msfclipper@yahoo.com> */ #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
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
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
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
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 <f047d6ac93d5e15bc5478b9d8f9d5417f11532d4@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>
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
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 <guillaume.quintard@gmail.com> * * 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
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
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
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
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
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
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
ade2938ab94b28aa3dd2574bf5752e1e5a8c6641
libavutil/pca.h
libavutil/pca.h
/* * Principal component analysis * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at> * * 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 <michaelni@gmx.at> * * 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
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
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 - bwit@pobox.com //* //* 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 - bwit@pobox.com //* //* 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
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
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
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
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
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
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
be7f76e0718737cf7db3506572d8b933a3da0296
firmware/common/Motor/Motor.h
firmware/common/Motor/Motor.h
/* * Supemeca Never Dies 2017 * \file Motor.h * \date 17/03/2017 * \author Romain Reignier */ #pragma once #include "hal.h" #include "Motors.h" class Motor { friend class Motors; public: enum eDirection { FORWARD, BACKWARD }; static constexpr uint32_t kPwmFrequency{1000000}; static constexpr uint16_t kPwmPeriod{125}; // TODO: change direction security, not too often Motor(PWMDriver* _driver, const uint8_t _channel, bool _isComplementaryChannel = false); void begin(); void stop(); void pwm(int16_t _percentage); void pwmI(int16_t _percentage); virtual void brake() = 0; virtual void changeDirection(eDirection _direction) = 0; virtual void setOutputPinsMode() = 0; protected: PWMDriver* m_driver; uint8_t m_channel; bool m_isComplementaryChannel; PWMConfig m_pwmCfg; };
/* * Supemeca Never Dies 2017 * \file Motor.h * \date 17/03/2017 * \author Romain Reignier */ #pragma once #include "hal.h" #include "Motors.h" class Motor { friend class Motors; public: enum eDirection { FORWARD, BACKWARD }; static constexpr uint32_t kPwmFrequency{10000}; static constexpr uint16_t kPwmPeriod{20}; Motor(PWMDriver* _driver, const uint8_t _channel, bool _isComplementaryChannel = false); void begin(); void stop(); void pwm(int16_t _percentage); void pwmI(int16_t _percentage); virtual void brake() = 0; virtual void changeDirection(eDirection _direction) = 0; virtual void setOutputPinsMode() = 0; protected: PWMDriver* m_driver; uint8_t m_channel; bool m_isComplementaryChannel; PWMConfig m_pwmCfg; };
Reduce PWM frequency to 500 Hz.
Reduce PWM frequency to 500 Hz.
C
apache-2.0
romainreignier/robot2017,romainreignier/robot2017,romainreignier/robot2017,romainreignier/robot2017
f7efdfd7b740d8d59015e14cb62ac6b3e68743da
Source/PureLayout.h
Source/PureLayout.h
// // PureLayout.h // v2.0.2 // https://github.com/smileyborg/PureLayout // // Copyright (c) 2014 Tyler Fox // // This code is distributed under the terms and conditions of the MIT license. // // 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 PureLayout_h #define PureLayout_h #import "ALView+PureLayout.h" #import "NSArray+PureLayout.h" #import "NSLayoutConstraint+PureLayout.h" #endif /* PureLayout_h */
// // PureLayout.h // v2.0.2 // https://github.com/smileyborg/PureLayout // // Copyright (c) 2014 Tyler Fox // // This code is distributed under the terms and conditions of the MIT license. // // 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 PureLayout_h #define PureLayout_h #import "ALView+PureLayout.h" #import "NSArray+PureLayout.h" #import "NSLayoutConstraint+PureLayout.h" #endif /* PureLayout_h */
Add newline to end of file
Add newline to end of file
C
mit
k214k/PureLayout,12207480/PureLayout,liuyujing/PureLayout,PureWiki/PureLayout,Joneze/PureLayout,pivotal-oscar/PureLayout,fhchina/PureLayout,FiftyThree/PureLayout,jiamaozheng/PureLayout,adachic/PureLayout,ppamorim/PureLayout,PureWiki/PureLayout,smileyborg/PureLayout,smileyborg/PureLayout,eleostech/PureLayout,lijie121210/PureLayout,abhilashreddykallepu/PureLayout,sandyway/PureLayout,kompozer/PureLayout,FiftyThree/PureLayout,openaphid/PureLayout,shnuzxw/PureLayout,foxswang/PureLayout,Chunyulo/PureLayout,ethan-fang/PureLayout,imjerrybao/PureLayout,12207480/PureLayout,imjerrybao/PureLayout,tangwei6423471/PureLayout,ernestopino/PureLayout,neonaldo/PureLayout,TongKuo/PureLayout,yushuyi/PureLayout,FelixMLians/PureLayout,tangwei6423471/PureLayout,neonaldo/PureLayout,abhilashreddykallepu/PureLayout,Joneze/PureLayout,k214k/PureLayout,bruce-wmm/PureLayout,ernestopino/PureLayout,lijie121210/PureLayout,foxswang/PureLayout,itper/PureLayout,pfleiner/PureLayout,eugenevinitsky/PureLayout,kompozer/PureLayout,fhchina/PureLayout,bruce-wmm/PureLayout,pivotal-oscar/PureLayout,adachic/PureLayout,yuanhoujun/PureLayout,ppamorim/PureLayout,jiamaozheng/PureLayout,cnbin/PureLayout,sandyway/PureLayout,TongKuo/PureLayout,liuyujing/PureLayout,yushuyi/PureLayout,cnbin/PureLayout,openaphid/PureLayout,Chunyulo/PureLayout
9e8a570d53cb8c545ec0c5fe296bcd6e0f657862
Source/config_lui.h
Source/config_lui.h
// Filename: config_lui.h // Created by: tobspr (28Aug14) // #ifndef CONFIG_LUI_H #define CONFIG_LUI_H #include "pandabase.h" #include "notifyCategoryProxy.h" #include "dconfig.h" // It is convenient to put these here for now. // #if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) // #ifdef BUILDING_LUI // #define EXPCL_LUI __declspec(dllexport) // #define EXPTP_LUI // #else // #define EXPCL_LUI __declspec(dllimport) // #define EXPTP_LUI extern // #endif // #else // #endif #define EXPCL_LUI #define EXPTP_LUI ConfigureDecl(config_lui, EXPCL_LUI, EXPTP_LUI); NotifyCategoryDecl(lui, EXPCL_LUI, EXPTP_LUI); extern EXPCL_LUI void init_lui(); #endif
// Filename: config_lui.h // Created by: tobspr (28Aug14) // #ifndef CONFIG_LUI_H #define CONFIG_LUI_H #include "pandabase.h" #include "notifyCategoryProxy.h" #include "dconfig.h" #define EXPCL_LUI EXPORT_CLASS #define EXPTP_LUI EXPORT_TEMPL ConfigureDecl(config_lui, EXPCL_LUI, EXPTP_LUI); NotifyCategoryDecl(lui, EXPCL_LUI, EXPTP_LUI); extern EXPCL_LUI void init_lui(); #endif
Fix compilation on Linux with latest 1.10
Fix compilation on Linux with latest 1.10
C
mit
tobspr/LUI,tobspr/LUI,tobspr/LUI
a2cbe2b176bc027d46b9c17046e8df49c247c7bd
core/base/inc/TVersionCheck.h
core/base/inc/TVersionCheck.h
// @(#)root/base:$Id$ // Author: Fons Rademakers 9/5/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TVersionCheck #define ROOT_TVersionCheck ////////////////////////////////////////////////////////////////////////// // // // TVersionCheck // // // // Used to check if the shared library or plugin is compatible with // // the current version of ROOT. // // // ////////////////////////////////////////////////////////////////////////// #ifdef R__CXXMODULES #ifndef ROOT_TObject #error "Building with modules currently requires this file to be #included through TObject.h" #endif #endif // R__CXXMODULES #include "RVersion.h" class TVersionCheck { public: TVersionCheck(int versionCode); // implemented in TSystem.cxx }; // FIXME: Due to a modules bug: https://llvm.org/bugs/show_bug.cgi?id=31056 // our .o files get polluted with the gVersionCheck symbol despite it was not // visible in this TU. #ifndef R__CXXMODULES #ifndef __CINT__ static TVersionCheck gVersionCheck(ROOT_VERSION_CODE); #endif #endif #endif
// @(#)root/base:$Id$ // Author: Fons Rademakers 9/5/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TVersionCheck #define ROOT_TVersionCheck ////////////////////////////////////////////////////////////////////////// // // // TVersionCheck // // // // Used to check if the shared library or plugin is compatible with // // the current version of ROOT. // // // ////////////////////////////////////////////////////////////////////////// #ifdef R__CXXMODULES #ifndef ROOT_TObject #error "Building with modules currently requires this file to be #included through TObject.h" #endif #endif // R__CXXMODULES #include "RVersion.h" class TVersionCheck { public: TVersionCheck(int versionCode); // implemented in TSystem.cxx }; // FIXME: Due to a modules bug: https://llvm.org/bugs/show_bug.cgi?id=31056 // our .o files get polluted with the gVersionCheck symbol despite it was not // visible in this TU. #ifndef R__CXXMODULES #ifndef __CINT__ namespace ROOT { static TVersionCheck gVersionCheck(ROOT_VERSION_CODE); } #endif #endif #endif
Move gVersionCheck into `ROOT::` (ROOT-10426):
Move gVersionCheck into `ROOT::` (ROOT-10426): This avoids deserializing the declaration when iterating over globals, which in turn avoids jitting the global needed by static init.
C
lgpl-2.1
olifre/root,karies/root,olifre/root,root-mirror/root,root-mirror/root,root-mirror/root,olifre/root,karies/root,olifre/root,olifre/root,root-mirror/root,karies/root,karies/root,karies/root,root-mirror/root,karies/root,karies/root,karies/root,root-mirror/root,root-mirror/root,root-mirror/root,root-mirror/root,olifre/root,olifre/root,karies/root,root-mirror/root,olifre/root,olifre/root,olifre/root,karies/root,root-mirror/root,olifre/root,karies/root
20f3fbf3c7a108b75c5dc92f0fe1108cc3e9bab5
Josh_Zane_Sebastian/src/main.h
Josh_Zane_Sebastian/src/main.h
struct stack_node { struct stack_node *cdr; int data; char type; } struct subroutine { struct stack_node *nodes; int num_nodes; }
#define T_INT 0 #define T_CHAR 1 #define T_SBRTN 2 struct stack_node { struct stack_node *cdr; union node_data data; } union node_data { struct subroutine srtine; int numval; char type; } struct subroutine { struct stack_node *nodes; int num_nodes; }
Add types, allow for subroutines.
Add types, allow for subroutines.
C
mit
aacoppa/final,aacoppa/final
a8eed7df4a04d3a002a04f517efe46a7f9b5c603
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 "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(uint16_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 "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_
Use uint32_t for compilation unit index instead of uint16_t.
Use uint32_t for compilation unit index instead of uint16_t. Change-Id: If89246e35c16a6b50942e0fe7dcc289234bbdfad
C
apache-2.0
treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst,treadstoneproject/artinst
fac8751ad9ac6eab7f5b86fe5fc82d1ca59a7b2a
src/ehl/isr_written_variable.h
src/ehl/isr_written_variable.h
#ifndef EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H #define EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H #include "rvalue.h" namespace ehl { template<typename T> class isr_written_variable { private: mutable volatile bool modified; volatile T value; public: isr_written_variable() = default; isr_written_variable(T initial_value) :value{as_rvalue(initial_value)} { } isr_written_variable& operator=(isr_written_variable const& other) { value = other.value; modified = true; return *this; } isr_written_variable<T>& operator=(T new_value) { value = as_rvalue(new_value); modified = true; return *this; } operator T() const { modified = false; T v = value; while(modified) { modified = false; v = value; } return v; } }; } #endif //EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
#ifndef EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H #define EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H #include "rvalue.h" namespace ehl { template<typename T> class isr_written_variable { private: mutable volatile bool modified; volatile T value; public: isr_written_variable() = default; isr_written_variable(T initial_value) :value{as_rvalue(initial_value)} { } isr_written_variable& operator=(isr_written_variable const& other) { value = other.value; modified = true; return *this; } isr_written_variable<T>& operator=(T new_value) { value = as_rvalue(new_value); modified = true; return *this; } operator T() const { while(true) { modified = false; T v = value; if(!modified) return v; } } }; } #endif //EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
Refactor to clean up isr written variable
Refactor to clean up isr written variable
C
mit
hiddeninplainsight/EmbeddedHelperLibrary,hiddeninplainsight/EmbeddedHelperLibrary,hiddeninplainsight/EmbeddedHelperLibrary,hiddeninplainsight/EmbeddedHelperLibrary
03951137c1867d52a47b69466ffb9986f60bd9af
wire.h
wire.h
#ifndef OPTITRACK_WIRE_H_ #define OPTITRACK_WIRE_H_ #include <stdint.h> typedef enum { NAT_PING = 0, NAT_PINGRESPONSE = 1, NAT_REQUEST = 2, NAT_RESPONSE = 3, NAT_REQUEST_MODELDEF = 4, NAT_MODELDEF = 5, NAT_REQUEST_FRAMEOFDATA = 6, NAT_FRAMEOFDATA = 7, NAT_MESSAGESTRING = 8, NAT_UNRECOGNIZED_REQUEST = 100 } natnet_msg_id_t; typedef struct { uint16_t type; uint16_t sz; } natnet_msg_header_t; #define MAX_NAMELENGTH 256 typedef struct { char name[MAX_NAMELENGTH]; char app_version[4]; char natnet_version[4]; } natnet_sender_t; #endif//OPTITRACK_WIRE_H_
#ifndef OPTITRACK_WIRE_H_ #define OPTITRACK_WIRE_H_ #include <stdint.h> typedef enum { NAT_PING = 0, NAT_PINGRESPONSE = 1, NAT_REQUEST = 2, NAT_RESPONSE = 3, NAT_REQUEST_MODELDEF = 4, NAT_MODELDEF = 5, NAT_REQUEST_FRAMEOFDATA = 6, NAT_FRAMEOFDATA = 7, NAT_MESSAGESTRING = 8, NAT_UNRECOGNIZED_REQUEST = 100 } natnet_msg_id_t; typedef struct { uint16_t type; uint16_t sz; } natnet_msg_header_t; #define MAX_NAMELENGTH 256 #define MAX_PACKETSIZE 100000 typedef struct { char name[MAX_NAMELENGTH]; unsigned char app_version[4]; unsigned char natnet_version[4]; } natnet_sender_t; typedef struct { natnet_msg_header_t header; union { unsigned char byteData [MAX_PACKETSIZE]; unsigned int intData [MAX_PACKETSIZE / sizeof(unsigned int)]; float floatData[MAX_PACKETSIZE / sizeof(float)]; natnet_sender_t sender; } data; } natnet_packet_t; #endif//OPTITRACK_WIRE_H_
Fix uchar vs. char in natnet_sender_t; add natnet_packet_t
Fix uchar vs. char in natnet_sender_t; add natnet_packet_t
C
bsd-2-clause
cg123/optitrack-depack,cg123/optitrack-depack
3d49470ecd745e1b9eee54a6f4dfdc507029a66b
Pod/Classes/LumberjackLogger.h
Pod/Classes/LumberjackLogger.h
// // LumberjackLogger.h // Pods // // Created by jiakai lian on 29/09/2015. // // #import <Foundation/Foundation.h> #import <CocoaLumberjack/CocoaLumberjack.h> //If you set the log level to DDLogLevelError, then you will only see Error statements. //If you set the log level to DDLogLevelWarn, then you will only see Error and Warn statements. //If you set the log level to DDLogLevelInfo, you'll see Error, Warn and Info statements. //If you set the log level to DDLogLevelDebug, you'll see Error, Warn, Info and Debug statements. //If you set the log level to DDLogLevelVerbose, you'll see all DDLog statements. //If you set the log level to DDLogLevelOff, you won't see any DDLog statements. #ifdef DEBUG static const DDLogLevel ddLogLevel = DDLogLevelVerbose; #else static const DDLogLevel ddLogLevel = DDLogLevelWarn; #endif @interface LumberjackLogger : NSObject @end
// // LumberjackLogger.h // Pods // // Created by jiakai lian on 29/09/2015. // // #import <Foundation/Foundation.h> #import <CocoaLumberjack/CocoaLumberjack.h> //If you set the log level to DDLogLevelError, then you will only see Error statements. //If you set the log level to DDLogLevelWarn, then you will only see Error and Warn statements. //If you set the log level to DDLogLevelInfo, you'll see Error, Warn and Info statements. //If you set the log level to DDLogLevelDebug, you'll see Error, Warn, Info and Debug statements. //If you set the log level to DDLogLevelVerbose, you'll see all DDLog statements. //If you set the log level to DDLogLevelOff, you won't see any DDLog statements. #ifdef DEBUG static const DDLogLevel ddLogLevel = DDLogLevelVerbose; #else static const DDLogLevel ddLogLevel = DDLogLevelWarning; #endif @interface LumberjackLogger : NSObject @end
Update the release log level
Update the release log level
C
mit
jiakai-lian/LumberjackLogger
09461ff2d6756f990eac8d26fd94b2d0bbe15e78
core/rgb_color.h
core/rgb_color.h
#ifndef TRN_RGB_COLOR_H #define TRN_RGB_COLOR_H #include <stdbool.h> typedef struct { float red; float green; float blue; } TrnColor; extern TrnColor const TRN_WHITE; extern TrnColor const TRN_RED; extern TrnColor const TRN_GREEN; extern TrnColor const TRN_BLUE; extern TrnColor const TRN_YELLOW; extern TrnColor const TRN_ORANGE; extern TrnColor const TRN_TURQUOISE; extern TrnColor const TRN_PURPLE; extern TrnColor const TRN_CYAN; bool trn_color_equal(TrnColor const left, TrnColor const right); #endif
#ifndef TRN_COLOR_H #define TRN_COLOR_H #include <stdbool.h> typedef struct { float red; float green; float blue; } TrnColor; extern TrnColor const TRN_WHITE; extern TrnColor const TRN_RED; extern TrnColor const TRN_GREEN; extern TrnColor const TRN_BLUE; extern TrnColor const TRN_YELLOW; extern TrnColor const TRN_ORANGE; extern TrnColor const TRN_TURQUOISE; extern TrnColor const TRN_PURPLE; extern TrnColor const TRN_CYAN; bool trn_color_equal(TrnColor const left, TrnColor const right); #endif
Make include guard name for color.h be compliant with our standard
Make include guard name for color.h be compliant with our standard
C
bsd-3-clause
sed-pro-inria/tetrinria,sed-pro-inria/tetrinria,sed-pro-inria/tetrinria
89bbc645af1622ffc4a7f1cc7e4509f2ca663139
adsbus/resolve.c
adsbus/resolve.c
#include <netdb.h> #include "asyncaddrinfo.h" #include "peer.h" #include "resolve.h" void resolve_init() { asyncaddrinfo_init(2); } void resolve_cleanup() { asyncaddrinfo_cleanup(); } void resolve(struct peer *peer, const char *node, const char *service, int flags) { struct addrinfo hints = { .ai_flags = AI_V4MAPPED | AI_ADDRCONFIG | flags, .ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM, }; peer->fd = asyncaddrinfo_resolve(node, service, &hints); peer_epoll_add(peer, EPOLLIN); } int resolve_result(struct peer *peer, struct addrinfo **addrs) { int err = asyncaddrinfo_result(peer->fd, addrs); peer->fd = -1; return err; }
#include <netdb.h> #include "asyncaddrinfo.h" #include "peer.h" #include "resolve.h" void resolve_init() { asyncaddrinfo_init(2); } void resolve_cleanup() { asyncaddrinfo_cleanup(); } void resolve(struct peer *peer, const char *node, const char *service, int flags) { struct addrinfo hints = { .ai_flags = AI_V4MAPPED | flags, .ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM, }; peer->fd = asyncaddrinfo_resolve(node, service, &hints); peer_epoll_add(peer, EPOLLIN); } int resolve_result(struct peer *peer, struct addrinfo **addrs) { int err = asyncaddrinfo_result(peer->fd, addrs); peer->fd = -1; return err; }
Remove AI_ADDRCONFIG, since the netlink socket is missing CLOEXEC and gets inherited by children.
Remove AI_ADDRCONFIG, since the netlink socket is missing CLOEXEC and gets inherited by children.
C
apache-2.0
flamingcowtv/adsb-tools,flamingcowtv/adsb-tools,flamingcowtv/adsb-tools,flamingcowtv/adsb-tools
506d8e88ab8c28f052697127fb6ccdcc5a44649a
libedataserverui/gtk-compat.h
libedataserverui/gtk-compat.h
#ifndef __GTK_COMPAT_H__ #define __GTK_COMPAT_H__ #include <gtk/gtk.h> /* Provide a compatibility layer for accessor functions introduced * in GTK+ 2.22 which we need to build with sealed GDK. * That way it is still possible to build with GTK+ 2.20. */ #if !GTK_CHECK_VERSION(2, 21, 0) #define gdk_drag_context_get_actions(context) (context)->actions #define gdk_drag_context_get_suggested_action(context) (context)->suggested_action #define gdk_drag_context_get_selected_action(context) (context)->action #endif /* GTK_CHECK_VERSION(2, 21, 0) */ #endif /* __GTK_COMPAT_H__ */
#ifndef __GTK_COMPAT_H__ #define __GTK_COMPAT_H__ #include <gtk/gtk.h> /* Provide a compatibility layer for accessor functions introduced * in GTK+ 2.22 which we need to build with sealed GDK. * That way it is still possible to build with GTK+ 2.20. */ #if !GTK_CHECK_VERSION(2,21,2) #define gdk_drag_context_get_actions(context) (context)->actions #define gdk_drag_context_get_suggested_action(context) (context)->suggested_action #define gdk_drag_context_get_selected_action(context) (context)->action #endif /* GTK_CHECK_VERSION(2, 21, 0) */ #endif /* __GTK_COMPAT_H__ */
Set the GTK+ backward compatibility check to 2.21.2.
Set the GTK+ backward compatibility check to 2.21.2.
C
lgpl-2.1
Distrotech/evolution-data-server,tintou/evolution-data-server,tintou/evolution-data-server,tintou/evolution-data-server,matzipan/evolution-data-server,Distrotech/evolution-data-server,Distrotech/evolution-data-server,gcampax/evolution-data-server,matzipan/evolution-data-server,gcampax/evolution-data-server,tintou/evolution-data-server,gcampax/evolution-data-server,Distrotech/evolution-data-server,matzipan/evolution-data-server,matzipan/evolution-data-server,matzipan/evolution-data-server,Distrotech/evolution-data-server,gcampax/evolution-data-server
cc884148c3ba9903d9d2355cfd31ddbba3a2b77d
MatrixSDK/Data/ReplyEvent/Parser/MXReplyEventParser.h
MatrixSDK/Data/ReplyEvent/Parser/MXReplyEventParser.h
/* Copyright 2019 The Matrix.org Foundation C.I.C 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. */ #import <Foundation/Foundation.h> #import "MXReplyEventParts.h" #import "MXEvent.h" NS_ASSUME_NONNULL_BEGIN /** Reply event parser. */ @interface MXReplyEventParser : NSObject - (MXReplyEventParts*)parse:(MXEvent*)replyEvent; @end NS_ASSUME_NONNULL_END
/* Copyright 2019 The Matrix.org Foundation C.I.C 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. */ #import <Foundation/Foundation.h> #import "MXReplyEventParts.h" #import "MXEvent.h" NS_ASSUME_NONNULL_BEGIN /** Reply event parser. */ @interface MXReplyEventParser : NSObject - (nullable MXReplyEventParts*)parse:(MXEvent*)replyEvent; @end NS_ASSUME_NONNULL_END
Make reply parser result optional
Make reply parser result optional
C
apache-2.0
matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk,matrix-org/matrix-ios-sdk
5c02865845248547ea33362877291f5b70c876c4
Perspective/Perspective/Perspective-Bridging-Header.h
Perspective/Perspective/Perspective-Bridging-Header.h
// // Use this file to import your target's public headers that you would like to expose to Swift. //
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import <Parse/Parse.h> #import <Bolts/Bolts.h> #import <AWSiOSSDKv2/AWSCore.h> #import <AWSiOSSDKv2/S3.h> #import <AWSiOSSDKv2/DynamoDB.h> #import <AWSiOSSDKv2/SQS.h> #import <AWSiOSSDKv2/SNS.h>
Add imports to Bridging Header.
Add imports to Bridging Header.
C
mit
dlrifkin/Perspective-1.0,thedanpan/Perspective
c938d475630c08a0d695f29b863250ae0ea73b5d
src/qt/macdockiconhandler.h
src/qt/macdockiconhandler.h
#ifndef MACDOCKICONHANDLER_H #define MACDOCKICONHANDLER_H #include <QtCore/QObject> class QMenu; class QIcon; class QWidget; class objc_object; /** Macintosh-specific dock icon handler. */ class MacDockIconHandler : public QObject { Q_OBJECT public: ~MacDockIconHandler(); QMenu *dockMenu(); void setIcon(const QIcon &icon); static MacDockIconHandler *instance(); void handleDockIconClickEvent(); signals: void dockIconClicked(); public slots: private: MacDockIconHandler(); objc_object *m_dockIconClickEventHandler; QWidget *m_dummyWidget; QMenu *m_dockMenu; }; #endif // MACDOCKICONCLICKHANDLER_H
#ifndef MACDOCKICONHANDLER_H #define MACDOCKICONHANDLER_H #include <QtCore/QObject> class QMenu; class QIcon; class QWidget; #ifdef __OBJC__ @class DockIconClickEventHandler; #else class DockIconClickEventHandler; #endif /** Macintosh-specific dock icon handler. */ class MacDockIconHandler : public QObject { Q_OBJECT public: ~MacDockIconHandler(); QMenu *dockMenu(); void setIcon(const QIcon &icon); static MacDockIconHandler *instance(); void handleDockIconClickEvent(); signals: void dockIconClicked(); public slots: private: MacDockIconHandler(); DockIconClickEventHandler *m_dockIconClickEventHandler; QWidget *m_dummyWidget; QMenu *m_dockMenu; }; #endif // MACDOCKICONCLICKHANDLER_H
Fix for legacy QT compatibility
Fix for legacy QT compatibility
C
mit
koharjidan/sexcoin,lavajumper/sexcoin,lavajumper/sexcoin,koharjidan/sexcoin,sexcoin-project/sexcoin,sexcoin-project/sexcoin,lavajumper/sexcoin,koharjidan/sexcoin,lavajumper/sexcoin,sexcoin-project/sexcoin,lavajumper/sexcoin,sexcoin-project/sexcoin,sexcoin-project/sexcoin,sexcoin-project/sexcoin,koharjidan/sexcoin,lavajumper/sexcoin