commit
stringlengths
40
40
old_file
stringlengths
4
112
new_file
stringlengths
4
112
old_contents
stringlengths
0
2.05k
new_contents
stringlengths
28
3.9k
subject
stringlengths
17
736
message
stringlengths
18
4.78k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
111k
9088e400d3196d691980e36b908548cefcbcd3e0
include/prd-fw-msg.h
include/prd-fw-msg.h
/* Copyright 2017 IBM Corp. * * 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 __PRD_FW_MSG_H #define __PRD_FW_MSG_H #include <types.h> /* Messaging structure for the opaque channel between OPAL and HBRT. This * format is used for the firmware_request and firmware_notify interfaces */ enum { PRD_FW_MSG_TYPE_REQ_NOP = 0, PRD_FW_MSG_TYPE_RESP_NOP = 1, }; struct prd_fw_msg { __be64 type; }; #define PRD_FW_MSG_BASE_SIZE sizeof(__be64) #endif /* __PRD_FW_MSG_H */
/* Copyright 2017 IBM Corp. * * 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 __PRD_FW_MSG_H #define __PRD_FW_MSG_H #include <types.h> /* Messaging structure for the opaque channel between OPAL and HBRT. This * format is used for the firmware_request and firmware_notify interfaces */ enum { PRD_FW_MSG_TYPE_REQ_NOP = 0, PRD_FW_MSG_TYPE_RESP_NOP = 1, PRD_FW_MSG_TYPE_RESP_GENERIC = 2, PRD_FW_MSG_TYPE_REQ_HCODE_UPDATE = 3, PRD_FW_MSG_TYPE_HBRT_FSP = 4, PRD_FW_MSG_TYPE_ERROR_LOG = 5, PRD_FW_MSG_TYPE_FSP_HBRT = 6, }; struct prd_fw_msg { __be64 type; union { struct { __be64 status; } generic_resp; }; }; #define PRD_FW_MSG_BASE_SIZE sizeof(__be64) #endif /* __PRD_FW_MSG_H */
Add generic response structure inside prd_fw_msg
prd: Add generic response structure inside prd_fw_msg This patch adds generic response structure. Also sync prd_fw_msg type macros with hostboot. Next patch makes use of this structure/macro. CC: Jeremy Kerr <[email protected]> Signed-off-by: Vasant Hegde <[email protected]> Signed-off-by: Stewart Smith <[email protected]>
C
apache-2.0
open-power/skiboot,open-power/skiboot,shenki/skiboot,shenki/skiboot,shenki/skiboot,shenki/skiboot,qemu/skiboot,shenki/skiboot,stewart-ibm/skiboot,qemu/skiboot,qemu/skiboot,legoater/skiboot,legoater/skiboot,open-power/skiboot,open-power/skiboot,open-power/skiboot,qemu/skiboot,qemu/skiboot,stewart-ibm/skiboot,legoater/skiboot,legoater/skiboot,legoater/skiboot,stewart-ibm/skiboot
4b9d0d59b5436e3fc6ffe3452147e226277a3edf
program/system/mission.c
program/system/mission.c
#include "QuadCopterConfig.h" #include "mavlink.h" #define MAV_MAX_LEN 263 struct waypoint_t mission_wp_list = {0}; int waypoint_cnt = 0; int cur_waypoint = 0; mavlink_message_t msg; uint8_t buf[MAV_MAX_LEN]; void mission_read_waypoint_list() { } void mission_write_waypoint_list() { } void mission_clear_waypoint() { mavlink_msg_mission_ack_pack(1, 200, &msg, 255, 0, 0); send_package(buf, &msg); } void mission_set_new_current_waypoint() { }
#include "QuadCopterConfig.h" #include "mavlink.h" #define MAV_MAX_LEN 263 struct waypoint_t mission_wp_list = {0}; int waypoint_cnt = 0; int cur_waypoint = 0; mavlink_message_t msg; uint8_t buf[MAV_MAX_LEN]; void push_waypoint_node(struct waypoint_t *waypoint) { } void free_waypoint_list(struct waypoint_t *waypoint) { } void mission_read_waypoint_list() { } void mission_write_waypoint_list() { } void mission_clear_waypoint() { mavlink_msg_mission_ack_pack(1, 200, &msg, 255, 0, 0); send_package(buf, &msg); } void mission_set_new_current_waypoint() { }
Create the waypoint structure operating function prototype
Create the waypoint structure operating function prototype
C
mit
ming6842/firmware,ming6842/firmware-new,ming6842/firmware-new,UrsusPilot/firmware,ming6842/firmware-new,UrsusPilot/firmware,fboris/firmware,fboris/firmware,UrsusPilot/firmware,ming6842/firmware,ming6842/firmware,fboris/firmware
3cbe36b63ebb3f5e782aac56c95e15018abf6cda
scripts/freetype/slimftoptions.h
scripts/freetype/slimftoptions.h
/* custom ftoption.h which selects the minimum features needed by mupdf */ #include <freetype/config/ftoption.h> #undef FT_CONFIG_OPTION_USE_LZW #undef FT_CONFIG_OPTION_USE_ZLIB #undef FT_CONFIG_OPTION_USE_BZIP2 #undef FT_CONFIG_OPTION_USE_PNG #undef FT_CONFIG_OPTION_USE_HARFBUZZ #undef FT_CONFIG_OPTION_MAC_FONTS #undef FT_CONFIG_OPTION_INCREMENTAL #undef TT_CONFIG_OPTION_EMBEDDED_BITMAPS #undef TT_CONFIG_OPTION_SFNT_NAMES #undef TT_CONFIG_OPTION_GX_VAR_SUPPORT #undef TT_CONFIG_OPTION_BDF #undef T1_CONFIG_OPTION_NO_AFM #undef T1_CONFIG_OPTION_NO_MM_SUPPORT #undef CFF_CONFIG_OPTION_OLD_ENGINE
/* custom ftoption.h which selects the minimum features needed by mupdf */ #include <freetype/config/ftoption.h> #undef FT_CONFIG_OPTION_USE_LZW #undef FT_CONFIG_OPTION_USE_ZLIB #undef FT_CONFIG_OPTION_USE_BZIP2 #undef FT_CONFIG_OPTION_USE_PNG #undef FT_CONFIG_OPTION_USE_HARFBUZZ #undef FT_CONFIG_OPTION_MAC_FONTS #undef FT_CONFIG_OPTION_INCREMENTAL #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT #undef TT_CONFIG_OPTION_EMBEDDED_BITMAPS #undef TT_CONFIG_OPTION_SFNT_NAMES #undef TT_CONFIG_OPTION_GX_VAR_SUPPORT #undef TT_CONFIG_OPTION_BDF #undef T1_CONFIG_OPTION_NO_AFM #undef T1_CONFIG_OPTION_NO_MM_SUPPORT #undef CFF_CONFIG_OPTION_OLD_ENGINE
Disable freetype stream support, avoiding FILE interface.
Disable freetype stream support, avoiding FILE interface.
C
agpl-3.0
ArtifexSoftware/mupdf,ccxvii/mupdf,TamirEvan/mupdf,ccxvii/mupdf,sebras/mupdf,TamirEvan/mupdf,fluks/mupdf-x11-bookmarks,fluks/mupdf-x11-bookmarks,fluks/mupdf-x11-bookmarks,ArtifexSoftware/mupdf,TamirEvan/mupdf,poor-grad-student/mupdf,poor-grad-student/mupdf,fluks/mupdf-x11-bookmarks,fluks/mupdf-x11-bookmarks,fluks/mupdf-x11-bookmarks,ccxvii/mupdf,TamirEvan/mupdf,muennich/mupdf,TamirEvan/mupdf,poor-grad-student/mupdf,ArtifexSoftware/mupdf,sebras/mupdf,ccxvii/mupdf,muennich/mupdf,ccxvii/mupdf,muennich/mupdf,TamirEvan/mupdf,ArtifexSoftware/mupdf,sebras/mupdf,muennich/mupdf,poor-grad-student/mupdf,muennich/mupdf,ArtifexSoftware/mupdf,muennich/mupdf,fluks/mupdf-x11-bookmarks,ArtifexSoftware/mupdf,sebras/mupdf,muennich/mupdf,ArtifexSoftware/mupdf,TamirEvan/mupdf,poor-grad-student/mupdf,poor-grad-student/mupdf,ArtifexSoftware/mupdf,ccxvii/mupdf,sebras/mupdf,sebras/mupdf,TamirEvan/mupdf
afe9df97488c789740212a40fdca119e4845308c
src/condor_includes/condor_fix_unistd.h
src/condor_includes/condor_fix_unistd.h
#ifndef FIX_UNISTD_H #define FIX_UNISTD_H #include <unistd.h> /* For some reason the g++ include files on Ultrix 4.3 fail to provide these prototypes, even though the Ultrix 4.2 versions did... Once again, OSF1 also chokes, unless _AES_SOURCE(?) is defined JCP */ #if defined(ULTRIX43) || defined(SUNOS41) || defined(OSF1) #if defined(__cplusplus) extern "C" { #endif #if defined(SUNOS41) || defined(ULTRIX43) typedef unsigned long ssize_t; #endif #if defined(__STDC__) || defined(__cplusplus) int symlink( const char *, const char * ); void *sbrk( ssize_t ); int gethostname( char *, int ); #else int symlink(); char *sbrk(); int gethostname(); #endif #if defined(__cplusplus) } #endif #endif /* ULTRIX43 */ #endif
#ifndef FIX_UNISTD_H #define FIX_UNISTD_H #if defined(SUNOS41) # define read _hide_read # define write _hide_write #endif #include <unistd.h> #if defined(SUNOS41) # undef read # undef write #endif /* For some reason the g++ include files on Ultrix 4.3 fail to provide these prototypes, even though the Ultrix 4.2 versions did... Once again, OSF1 also chokes, unless _AES_SOURCE(?) is defined JCP */ #if defined(ULTRIX43) || defined(SUNOS41) || defined(OSF1) #if defined(__cplusplus) extern "C" { #endif #if defined(SUNOS41) || defined(ULTRIX43) typedef unsigned long ssize_t; #endif #if defined(__STDC__) || defined(__cplusplus) int symlink( const char *, const char * ); void *sbrk( ssize_t ); int gethostname( char *, int ); # if defined(SUNOS41) ssize_t read( int, void *, size_t ); ssize_t write( int, const void *, size_t ); # endif #else int symlink(); char *sbrk(); int gethostname(); #endif #if defined(__cplusplus) } #endif #endif /* ULTRIX43 */ #endif
Fix up prototypes for read() and write() on Suns.
Fix up prototypes for read() and write() on Suns.
C
apache-2.0
djw8605/condor,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/htcondor,djw8605/condor,bbockelm/condor-network-accounting,djw8605/condor,mambelli/osg-bosco-marco,djw8605/htcondor,djw8605/htcondor,neurodebian/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,djw8605/condor,djw8605/condor,djw8605/htcondor,clalancette/condor-dcloud,djw8605/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,clalancette/condor-dcloud,djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,neurodebian/htcondor,djw8605/condor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,neurodebian/htcondor,htcondor/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,djw8605/htcondor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,neurodebian/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,htcondor/htcondor,clalancette/condor-dcloud,clalancette/condor-dcloud,djw8605/condor,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting
4161a3f63956e7a80939e3ab957abf83a8c5c6c4
problem_2/solution.c
problem_2/solution.c
#include <stdio.h> int main(int argc, char *argv[]){ int s, a, b, c; s = 0; a = 1; b = 1; c = a + b; while(c < 4000000L){ s += c; a = b + c; b = a + c; c = a + b; } printf("%d\n", s); }
Add C implementation for problem 2
Add C implementation for problem 2
C
mit
mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler
6d77e4be436f17438dc8b8d12c75b2382040f76d
src2/hcidumpinternal.h
src2/hcidumpinternal.h
#ifndef hcidumpinternal_H #define hcidumpinternal_H #include <stdbool.h> #include <stdint.h> typedef struct beacon_info { char uuid[20]; int32_t code; int32_t manufacturer; int32_t major; int32_t minor; int32_t power; int32_t calibrated_power; int32_t rssi; int64_t time; } beacon_info; // The callback function invoked for each beacon event seen by hcidumpinternal // const char * uuid, int32_t code, int32_t manufacturer, int32_t major, int32_t minor, int32_t power, int32_t rssi, int64_t time typedef bool (*beacon_event)(const beacon_info *); // The function hcidumpinternal exports int32_t scan_frames(int32_t dev, beacon_event callback); #endif
#ifndef hcidumpinternal_H #define hcidumpinternal_H #include <stdbool.h> #include <stdint.h> typedef struct beacon_info { char uuid[36]; int32_t code; int32_t manufacturer; int32_t major; int32_t minor; int32_t power; int32_t calibrated_power; int32_t rssi; int64_t time; } beacon_info; // The callback function invoked for each beacon event seen by hcidumpinternal // const char * uuid, int32_t code, int32_t manufacturer, int32_t major, int32_t minor, int32_t power, int32_t rssi, int64_t time typedef bool (*beacon_event)(const beacon_info *); // The function hcidumpinternal exports int32_t scan_frames(int32_t dev, beacon_event callback); #endif
Correct the allowed size of the uuid code
Correct the allowed size of the uuid code
C
apache-2.0
starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser,starksm64/NativeRaspberryPiBeaconParser
d2db26f1c08242b61709d6c297ad28e02acd7abd
Wangscape/noise/module/codecs/CornerCombinerBaseWrapperCodec.h
Wangscape/noise/module/codecs/CornerCombinerBaseWrapperCodec.h
#pragma once #include <spotify/json.hpp> #include <noise/noise.h> #include "noise/module/Wrapper.h" #include "noise/module/CornerCombinerBase.h" namespace spotify { namespace json { template<> struct default_codec_t<noise::module::Wrapper<noise::module::CornerCombinerBase>> { using CornerCombinerBaseWrapper = noise::module::Wrapper<noise::module::CornerCombinerBase>; static codec::object_t<CornerCombinerBaseWrapper> codec() { auto codec = codec::object<CornerCombinerBaseWrapper>(); codec.required("type", codec::eq<std::string>("CornerCombinerBase")); codec.optional("Power", [](CornerCombinerBase CornerCombinerBaseWrapper& mw) {return mw.module.GetPower(); }, [](CornerCombinerBaseWrapper& mw, double power) {mw.module.SetPower(power); }); return codec; } }; } }
#pragma once #include <spotify/json.hpp> #include <noise/noise.h> #include "noise/module/Wrapper.h" #include "noise/module/CornerCombinerBase.h" namespace spotify { namespace json { template<> struct default_codec_t<noise::module::Wrapper<noise::module::CornerCombinerBase>> { using CornerCombinerBaseWrapper = noise::module::Wrapper<noise::module::CornerCombinerBase>; static codec::object_t<CornerCombinerBaseWrapper> codec() { auto codec = codec::object<CornerCombinerBaseWrapper>(); codec.required("type", codec::eq<std::string>("CornerCombinerBase")); codec.optional("Power", [](const CornerCombinerBaseWrapper& mw) {return mw.module.GetPower(); }, [](CornerCombinerBaseWrapper& mw, double power) {mw.module.SetPower(power); }); return codec; } }; } }
Fix find&replace error in CornerCombinerBase codec
Fix find&replace error in CornerCombinerBase codec
C
mit
Wangscape/Wangscape,serin-delaunay/Wangscape,Wangscape/Wangscape,serin-delaunay/Wangscape,Wangscape/Wangscape
8487e6a94258271b4036dcc62de05a2940d7d436
snake.c
snake.c
#include <stdlib.h> /** * @author: Hendrik Werner */ #define BOARD_HEIGHT 50 #define BOARD_WIDTH 50 typedef struct Position { int row; int col; } Position; typedef enum Cell { EMPTY ,SNAKE ,FOOD } Cell; typedef Cell Board[BOARD_HEIGHT][BOARD_WIDTH]; typedef enum Direction {LEFT, UP, RIGHT, DOWN} Direction; int main() { return EXIT_SUCCESS; }
#include <stdlib.h> /** * @author: Hendrik Werner */ #define BOARD_HEIGHT 50 #define BOARD_WIDTH 50 typedef struct Position { int row; int col; } Position; typedef enum Cell { EMPTY ,SNAKE ,FOOD } Cell; typedef Cell Board[BOARD_HEIGHT][BOARD_WIDTH]; typedef enum Direction {LEFT, UP, RIGHT, DOWN} Direction; /** * Represent a cell using a character. * * @return A character representing the content of the cell provided. */ char representCell(const Cell c) { switch (c) { case SNAKE: return 'S'; case FOOD: return 'F'; default: return '.'; } } int main() { return EXIT_SUCCESS; }
Add a function to represents cells as characters.
Add a function to represents cells as characters.
C
mit
Hendrikto/Snake
8edeac350ffa63e48ea86a1284111061fd3256a7
MoblicoSDK/Services/MLCSettingsService.h
MoblicoSDK/Services/MLCSettingsService.h
/* Copyright 2012 Moblico Solutions LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or 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 <MoblicoSDK/MLCService.h> @class MLCSettings; NS_ASSUME_NONNULL_BEGIN typedef void(^MLCSettingsServiceCompletionHandler)(id _Nullable MLCSettings, NSError * _Nullable error, NSHTTPURLResponse * _Nullable response); @interface MLCSettingsService : MLCService + (instancetype)readSettings:(MLCSettingsServiceCompletionHandler)handler; + (MLCSettings *)settings; + (void)overrideSettings:(NSDictionary *)settings; @end @interface MLCSettings : NSObject - (nullable id)objectForKey:(NSString *)key; - (nullable id)objectForKeyedSubscript:(NSString *)key; @end NS_ASSUME_NONNULL_END
/* Copyright 2012 Moblico Solutions LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or 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 <MoblicoSDK/MLCService.h> @class MLCSettings; NS_ASSUME_NONNULL_BEGIN typedef void(^MLCSettingsServiceCompletionHandler)(id _Nullable MLCSettings, NSError * _Nullable error, NSHTTPURLResponse * _Nullable response); @interface MLCSettingsService : MLCService + (instancetype)readSettings:(MLCSettingsServiceCompletionHandler)handler; + (MLCSettings *)settings; + (void)overrideSettings:(nullable NSDictionary *)settings; @end @interface MLCSettings : NSObject - (nullable id)objectForKey:(NSString *)key; - (nullable id)objectForKeyedSubscript:(NSString *)key; @end NS_ASSUME_NONNULL_END
Allow overrideSettings to take a nil value.
Allow overrideSettings to take a nil value.
C
apache-2.0
Moblico/MoblicoSDK-iOS
77567b0280eb5f326b0860096f473bb69064e672
iOSNativeiPadApp/EdKeyNote/EdKeyNote/EdKeyNote/EKNAppDelegate.h
iOSNativeiPadApp/EdKeyNote/EdKeyNote/EdKeyNote/EKNAppDelegate.h
// // EKNAppDelegate.h // EdKeyNote // // Created by canviz on 9/22/14. // Copyright (c) 2014 canviz. All rights reserved. // #import <UIKit/UIKit.h> #import "EKNDeskTopViewController.h" #import "EKNLoginViewController.h" @interface EKNAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) EKNLoginViewController *viewController; @property (strong, nonatomic) UINavigationController *naviController; @end
// // EKNAppDelegate.h // EdKeyNote // // Created by canviz on 9/22/14. // Copyright (c) 2014 canviz. All rights reserved. // #import <UIKit/UIKit.h> #import "EKNLoginViewController.h" @interface EKNAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) EKNLoginViewController *viewController; @property (strong, nonatomic) UINavigationController *naviController; @end
Remove the import for EKNDeskTopViewController.h
Remove the import for EKNDeskTopViewController.h
C
apache-2.0
weshackett/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,weshackett/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,weshackett/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,weshackett/Property-Inspection-Code-Sample,weshackett/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,weshackett/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample
4c835203b2e41aa8b7c61c9e1daaf9a6c4bfb6eb
Mac/mwerks/mwerks_plugin_config.h
Mac/mwerks/mwerks_plugin_config.h
/* ** Config file for dynamically-loaded ppc/cfm68k plugin modules. */ /* #define USE_GUSI1 /* Stdio implemented with GUSI */ #define USE_GUSI2 /* Stdio implemented with GUSI */ #define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */ #define USE_MSL /* Use MSL libraries */ #ifdef USE_MSL #define MSL_USE_PRECOMPILED_HEADERS 0 /* Don't use precomp headers: we include our own */ #include <ansi_prefix.mac.h> #endif
/* ** Config file for dynamically-loaded ppc/cfm68k plugin modules. */ /* #define USE_GUSI1 /* Stdio implemented with GUSI */ #define USE_GUSI2 /* Stdio implemented with GUSI */ #if defined(USE_GUSI1) || defined(USE_GUSI2) #define USE_GUSI #endif #define WITH_THREAD /* Use thread support (needs GUSI 2, not GUSI 1) */ #define USE_MSL /* Use MSL libraries */ #ifdef USE_MSL #define MSL_USE_PRECOMPILED_HEADERS 0 /* Don't use precomp headers: we include our own */ #include <ansi_prefix.mac.h> #endif
Define USE_GUSI if USE_GUSI1 or USE_GUSI2 is defined.
Define USE_GUSI if USE_GUSI1 or USE_GUSI2 is defined.
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
d82e2c1a1f7373fe89ce854d94915ad420596aa2
include/clang/Sema/CodeCompleteOptions.h
include/clang/Sema/CodeCompleteOptions.h
//===---- CodeCompleteOptions.h - Code Completion Options -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_SEMA_CODECOMPLETEOPTIONS_H #define LLVM_CLANG_SEMA_CODECOMPLETEOPTIONS_H /// Options controlling the behavior of code completion. class CodeCompleteOptions { public: ///< Show macros in code completion results. unsigned IncludeMacros : 1; ///< Show code patterns in code completion results. unsigned IncludeCodePatterns : 1; ///< Show top-level decls in code completion results. unsigned IncludeGlobals : 1; ///< Show brief documentation comments in code completion results. unsigned IncludeBriefComments : 1; CodeCompleteOptions() : IncludeMacros(0), IncludeCodePatterns(0), IncludeGlobals(1), IncludeBriefComments(0) { } }; #endif
//===---- CodeCompleteOptions.h - Code Completion Options -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_SEMA_CODECOMPLETEOPTIONS_H #define LLVM_CLANG_SEMA_CODECOMPLETEOPTIONS_H /// Options controlling the behavior of code completion. class CodeCompleteOptions { public: /// Show macros in code completion results. unsigned IncludeMacros : 1; /// Show code patterns in code completion results. unsigned IncludeCodePatterns : 1; /// Show top-level decls in code completion results. unsigned IncludeGlobals : 1; /// Show brief documentation comments in code completion results. unsigned IncludeBriefComments : 1; CodeCompleteOptions() : IncludeMacros(0), IncludeCodePatterns(0), IncludeGlobals(1), IncludeBriefComments(0) { } }; #endif
Fix comments: these are not trailing comments
Fix comments: these are not trailing comments git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@174197 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
1b374d72764837fb898f9b0aa4f2c83785818198
halley/net/include/halley/net/imessage.h
halley/net/include/halley/net/imessage.h
#pragma once #include <gsl/gsl_byte> #include <gsl/span> namespace Halley { class IMessage { public: virtual ~IMessage() {} virtual size_t getSerializedSize() = 0; virtual void serializeTo(gsl::span<gsl::byte> dst) = 0; }; }
#pragma once #include <gsl/gsl> namespace Halley { class IMessage { public: virtual ~IMessage() {} virtual size_t getSerializedSize() = 0; virtual void serializeTo(gsl::span<gsl::byte> dst) = 0; }; }
Change include to fix compilation.
Change include to fix compilation.
C
apache-2.0
amzeratul/halley,amzeratul/halley,amzeratul/halley
f858f7f3804ea20b80a38dab9b1b2d098e1df2a1
include/llvm/Transforms/Instrumentation.h
include/llvm/Transforms/Instrumentation.h
//===- Transforms/Instrumentation.h - Instrumentation passes ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This files defines constructor functions for instrumentation passes. // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_H #define LLVM_TRANSFORMS_INSTRUMENTATION_H namespace llvm { class Pass; //===----------------------------------------------------------------------===// // Support for inserting LLVM code to print values at basic block and function // exits. // Pass *createTraceValuesPassForFunction(); // Just trace function entry/exit Pass *createTraceValuesPassForBasicBlocks(); // Trace BB's and methods } // End llvm namespace #endif
//===- Transforms/Instrumentation.h - Instrumentation passes ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This files defines constructor functions for instrumentation passes. // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_H #define LLVM_TRANSFORMS_INSTRUMENTATION_H namespace llvm { class ModulePass; class FunctionPass; // Reoptimizer support pass: add instrumentation calls to back-edges of loops ModulePass *createLoopInstrumentationPass (); // Reoptimizer support pass: combine multiple back-edges w/ same target into one FunctionPass *createCombineBranchesPass(); // Reoptimizer support pass: emit table of global functions FunctionPass *createEmitFunctionTablePass (); //===----------------------------------------------------------------------===// // Support for inserting LLVM code to print values at basic block and function // exits. // // Just trace function entry/exit FunctionPass *createTraceValuesPassForBasicBlocks(); // Trace BB's and methods FunctionPass *createTraceValuesPassForFunction(); } // End llvm namespace #endif
Add accessor function prototypes for reoptimizer support passes. Make accessors return FunctionPass* as appropriate.
Add accessor function prototypes for reoptimizer support passes. Make accessors return FunctionPass* as appropriate. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@16619 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm
dac047db615cb36da26e5502fb430771166f251f
ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h
ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h
#define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040" #define MICROPY_HW_MCU_NAME "rp2040" #define MICROPY_HW_NEOPIXEL (&pin_GPIO16) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) #define DEFAULT_SPI_BUS_SCK (&pin_GPIO18) #define DEFAULT_SPI_BUS_MOSI (&pin_GPIO19) #define DEFAULT_SPI_BUS_MISO (&pin_GPIO20) // #define DEFAULT_UART_BUS_RX (&pin_PA11) // #define DEFAULT_UART_BUS_TX (&pin_PA10) // Flash chip is GD25Q32 connected over QSPI #define TOTAL_FLASH_SIZE (4 * 1024 * 1024)
#define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040" #define MICROPY_HW_MCU_NAME "rp2040" #define MICROPY_HW_NEOPIXEL (&pin_GPIO16) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) #define DEFAULT_SPI_BUS_SCK (&pin_GPIO18) #define DEFAULT_SPI_BUS_MOSI (&pin_GPIO19) #define DEFAULT_SPI_BUS_MISO (&pin_GPIO20) // #define DEFAULT_UART_BUS_RX (&pin_PA11) // #define DEFAULT_UART_BUS_TX (&pin_PA10) // Flash chip is GD25Q64 connected over QSPI #define TOTAL_FLASH_SIZE (8 * 1024 * 1024)
Update Feather RP2040 to 8MB
Update Feather RP2040 to 8MB
C
mit
adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython,adafruit/circuitpython
b949183f1deda980e0ff77e067dc8d1eed2775c8
serial.h
serial.h
#ifndef _SERIAL_H_ #define _SERIAL_H_ #include "hardware/packet.h" #define SERIAL_SUCCESS 1 #define SERIAL_ERROR !SERIAL_SUCCESS unsigned int serial_connect(char device[]); unsigned int serial_transmit(struct Packet packet); unsigned int serial_close(); #endif
#ifndef _SERIAL_H_ #define _SERIAL_H_ #include "hardware/packet.h" #define SERIAL_SUCCESS 1 #define SERIAL_ERROR (!SERIAL_SUCCESS) unsigned int serial_connect(char device[]); unsigned int serial_transmit(struct Packet packet); unsigned int serial_close(); #endif
Add brackets around SERIAL_ERROR definition for compatibility
Add brackets around SERIAL_ERROR definition for compatibility
C
agpl-3.0
jackwilsdon/lightcontrol,jackwilsdon/lightcontrol
b483dd161b054adcff933fd073550bf8f7cc1c47
include/pector/malloc_allocator_compat.h
include/pector/malloc_allocator_compat.h
#ifndef PECTOR_MALLOC_ALLOCATOR_COMPAT_H #define PECTOR_MALLOC_ALLOCATOR_COMPAT_H #ifdef __APPLE__ #include <malloc/malloc.h> #else #include <malloc.h> #endif #if defined __GNUC__ || defined _WIN32 || defined __APPLE__ #define PT_SIZE_AWARE_COMPAT #if defined __GNUC__ && !defined _WIN32 && !defined __APPLE__ #define PT_MALLOC_USABLE_SIZE(p) malloc_usable_size(p) #elif defined _WIN32 #define PT_MALLOC_USABLE_SIZE(p) _msize(p) #elif defined __APPLE__ #define PTçMALLOC_USABLE_SIZE(p) malloc_size(p) #endif #endif // defined __GNUC__ || defined _WIN32 || defined __APPLE__ #endif
#ifndef PECTOR_MALLOC_ALLOCATOR_COMPAT_H #define PECTOR_MALLOC_ALLOCATOR_COMPAT_H #ifdef __APPLE__ #include <malloc/malloc.h> #else #include <malloc.h> #endif #if defined __GNUC__ || defined _WIN32 || defined __APPLE__ || defined __FreeBSD__ #define PT_SIZE_AWARE_COMPAT #if defined _WIN32 #define PT_MALLOC_USABLE_SIZE(p) _msize(p) #elif defined __APPLE__ #define PT_MALLOC_USABLE_SIZE(p) malloc_size(p) #elif defined __GNUC__ || defined __FreeBSD__ #define PT_MALLOC_USABLE_SIZE(p) malloc_usable_size(p) #endif #endif // defined __GNUC__ || defined _WIN32 || defined __APPLE__ #endif
Add FreeBSD as platform supporting malloc_usable_size
Add FreeBSD as platform supporting malloc_usable_size
C
lgpl-2.1
pjump/pector,aguinet/pector,pjump/pector,aguinet/pector
1f8565900ffd65dc10e7d0341e29f284c480deab
src/include/TVector.h
src/include/TVector.h
/****************************** * AUTHOR : GUSTAVO MARTINS * USE AS YOU WISH * DATE : 11/25/2015 * LANG : ANSI C * DESCR : A VERY SIMPLE * 3D VECTOR LIBRARY ******************************/ #ifndef TVECTOR_H #define TVECTOR_H typedef struct SVector *TVector; TVector createVector(double x, double y, double z); TVector createNullVector(); void freeVector(TVector vec); double getX(TVector vec); double getY(TVector vec); double getZ(TVector vec); void setX(TVector vec, double x); void setY(TVector vec, double y); void setZ(TVector vec, double z); double getLength(TVector vec); void normalizeVector(TVector vec); double doDotProduct(TVector vecA, TVector vecB, double angle); TVector doScalarProduct(TVector vec, double scalar); TVector doCrossProduct(TVector vecA, TVector vecB); TVector doNormalize(TVector vec); TVector createCopyVector(TVector vec); #endif
/****************************** * AUTHOR : GUSTAVO MARTINS * USE AS YOU WISH * DATE : 11/25/2015 * LANG : ANSI C * DESCR : A VERY SIMPLE * 3D VECTOR LIBRARY ******************************/ #ifndef TVECTOR_H #define TVECTOR_H typedef struct SVector *TVector; TVector createVector(double x, double y, double z); TVector createNullVector(); void freeVector(TVector vec); double getX(TVector vec); double getY(TVector vec); double getZ(TVector vec); void setX(TVector vec, double x); void setY(TVector vec, double y); void setZ(TVector vec, double z); double getLength(TVector vec); void normalizeVector(TVector vec); double doDotProduct(TVector vecA, TVector vecB, double angle); TVector doScalarProduct(TVector vec, double scalar); TVector doCrossProduct(TVector vecA, TVector vecB); TVector doSum(TVector vecA, TVector vecB); TVector doSub(TVector vecA, TVector vecB); TVector doNormalize(TVector vec); TVector createCopyVector(TVector vec); #endif
Add new functions to header
Add new functions to header
C
mit
gugamm/Simple-Vector-Library
2e91ae16b74c9fe73444347640ff7a1545809844
example1.c
example1.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "suspect.h" suspect_context("Euler's Method", suspect_test("Predicts y_{n+1} to within the expected threshhold", suspect_assert("Expected 1 < 0", -1 < 0); ) suspect_test("Does not explode", suspect_assert("Expected -1 < 0", -1 < 0); ) suspect_test("Knows about Tony", suspect_assert("Tony is a dork", 2 < 1); ) )
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "suspect.h" suspect_context("Euler's Method", suspect_test("Expect actual to be within epsilon of target", float actual = 5.426; float epsilon = 0.01; float target = 5.00; suspect_epsilon(actual,epsilon,target); ) suspect_test("Does not explode", suspect_assert("Expected -1 < 0", -1 < 0); ) suspect_test("Knows about Tony", suspect_assert("Tony is a dork", 2 < 1); ) )
Include use case of epsilon
Include use case of epsilon
C
mit
robertdfrench/Suspect
63aed9a9b6c82e1c9114784721c9a2edff7d0e68
ch1/ex3/farh_to_celsius_v2.c
ch1/ex3/farh_to_celsius_v2.c
#include <stdio.h> float K_5_BY_9 = 5.0 / 9.0; float K_32 = 32; int main(void) { float fahr, celsius; int lower, upper, step; lower = 0; upper = 300; step = 20; printf("|-----------|\n"); printf("|%4s|%6s|\n", "F", "C"); printf("|-----------|\n"); fahr = lower; while (fahr <= upper) { celsius = K_5_BY_9 * (fahr - K_32); printf("|%4.0f|%6.1f|\n", fahr, celsius); fahr = fahr + step; } printf("|-----------|\n"); return 0; }
#include <stdio.h> float K_5_BY_9 = 5.0 / 9.0; float K_32 = 32; int SUCCESS = 0; int main(void) { float fahrenheit, celsius; int lower, upper, step; lower = 0; upper = 300; step = 20; printf("|-----------|\n"); printf("|%4s|%6s|\n", "F", "C"); printf("|-----------|\n"); fahrenheit = lower; while (fahrenheit <= upper) { celsius = K_5_BY_9 * (fahrenheit - K_32); printf("|%4.0f|%6.1f|\n", fahrenheit, celsius); fahrenheit = fahrenheit + step; } printf("|-----------|\n"); return SUCCESS; }
Update ch1/ex3 v2 exercise with more readable code
Update ch1/ex3 v2 exercise with more readable code
C
bsd-3-clause
rmk135/the-c-programming-language
21465b20594432e4d73b5eaa75e34ef00761face
subversion/libsvn_fs/txn.h
subversion/libsvn_fs/txn.h
/* node.h : interface to node functions, private to libsvn_fs * * ==================================================================== * Copyright (c) 2000 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * ==================================================================== */ #ifndef SVN_LIBSVN_FS_TXN_H #define SVN_LIBSVN_FS_TXN_H /* Create a new `transactions' table for the new filesystem FS. FS->env must already be open; this sets FS->nodes. */ svn_error_t *svn_fs__create_transactions (svn_fs_t *fs); /* Open the existing `transactions' table for the filesystem FS. FS->env must already be open; this sets FS->nodes. */ svn_error_t *svn_fs__open_transactions (svn_fs_t *fs); /* Return a pointer to the ID of TXN. The return value is live for as long as TXN is. */ char *svn_fs__txn_id (svn_fs_txn_t *txn); #endif /* SVN_LIBSVN_FS_TXN_H */ /* * local variables: * eval: (load-file "../svn-dev.el") * end: */
/* txn.h : interface to Subversion transactions, private to libsvn_fs * * ==================================================================== * Copyright (c) 2000 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://subversion.tigris.org/license-1.html. * If newer versions of this license are posted there, you may use a * newer version instead, at your option. * ==================================================================== */ #ifndef SVN_LIBSVN_FS_TXN_H #define SVN_LIBSVN_FS_TXN_H /* Create a new `transactions' table for the new filesystem FS. FS->env must already be open; this sets FS->nodes. */ svn_error_t *svn_fs__create_transactions (svn_fs_t *fs); /* Open the existing `transactions' table for the filesystem FS. FS->env must already be open; this sets FS->nodes. */ svn_error_t *svn_fs__open_transactions (svn_fs_t *fs); /* Return a pointer to the ID of TXN. The return value is live for as long as TXN is. */ char *svn_fs__txn_id (svn_fs_txn_t *txn); #endif /* SVN_LIBSVN_FS_TXN_H */ /* * local variables: * eval: (load-file "../svn-dev.el") * end: */
Fix descriptive comment at top of file.
Fix descriptive comment at top of file.
C
apache-2.0
jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion
8a6513105010a0e334ccf8cf3f4c017abf2b44ae
src/sail/game_struct.h
src/sail/game_struct.h
/* * Copyright (C) 2015 Luke San Antonio * All rights reserved. */ #pragma once #include "../common/id_map.hpp" #include "boat.h" #include "../collisionlib/motion.h" namespace redc { namespace sail { struct Player { std::string name; bool spawned; Hull_Desc boat_config; collis::Motion boat_motion; }; struct Game { ID_Map<Player> players; }; } }
/* * Copyright (C) 2015 Luke San Antonio * All rights reserved. */ #pragma once #include "../common/id_map.hpp" #include "boat.h" #include "../collisionlib/motion.h" namespace redc { namespace sail { struct Player { std::string name; bool spawned; Hull_Desc boat_config; collis::Motion boat_motion; void* userdata; }; struct Game { ID_Map<Player> players; }; } }
Add user data to Game struct
Add user data to Game struct
C
bsd-3-clause
RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine
e084ce3506c805a4667aa2d32ef249c5754244cc
ext/libxml/ruby_xml_state.c
ext/libxml/ruby_xml_state.c
/* $Id$ */ #include "ruby_libxml.h" VALUE cXMLState; VALUE LIBXML_STATE = Qnil; static int dummy = 0; void ruby_xml_state_free(int dummy) { xmlCleanupParser(); LIBXML_STATE = Qnil; } VALUE ruby_xml_state_alloc() { #ifdef DEBUG fprintf(stderr, "Allocating state"); #endif xmlInitParser(); return Data_Wrap_Struct(cXMLState, NULL, ruby_xml_state_free, &dummy); } // Rdoc needs to know #ifdef RDOC_NEVER_DEFINED mXML = rb_define_module("XML"); #endif void ruby_init_state(void) { VALUE rb_mSingleton; cXMLState = rb_define_class_under(mXML, "State", rb_cObject); /* Mixin singleton so only one xml state object can be created. */ rb_require("singleton"); rb_mSingleton = rb_const_get(rb_cObject, rb_intern("Singleton")); rb_include_module(cXMLState, rb_mSingleton); rb_define_alloc_func(cXMLState, ruby_xml_state_alloc); /* Create one instance of the state object that is used to initalize and cleanup libxml. Then register it with the garbage collector so its not freed until the process exists.*/ LIBXML_STATE = rb_class_new_instance(0, NULL, cXMLState); rb_global_variable(&LIBXML_STATE); }
/* $Id$ */ #include "ruby_libxml.h" VALUE cXMLState; VALUE LIBXML_STATE = Qnil; static int dummy = 0; void ruby_xml_state_free(int dummy) { xmlCleanupParser(); LIBXML_STATE = Qnil; } VALUE ruby_xml_state_alloc(VALUE klass) { #ifdef DEBUG fprintf(stderr, "Allocating state"); #endif xmlInitParser(); return Data_Wrap_Struct(cXMLState, NULL, ruby_xml_state_free, &dummy); } // Rdoc needs to know #ifdef RDOC_NEVER_DEFINED mXML = rb_define_module("XML"); #endif void ruby_init_state(void) { VALUE rb_mSingleton; cXMLState = rb_define_class_under(mXML, "State", rb_cObject); /* Mixin singleton so only one xml state object can be created. */ rb_require("singleton"); rb_mSingleton = rb_const_get(rb_cObject, rb_intern("Singleton")); rb_include_module(cXMLState, rb_mSingleton); rb_define_alloc_func(cXMLState, ruby_xml_state_alloc); /* Create one instance of the state object that is used to initalize and cleanup libxml. Then register it with the garbage collector so its not freed until the process exists.*/ LIBXML_STATE = rb_class_new_instance(0, NULL, cXMLState); rb_global_variable(&LIBXML_STATE); }
Fix declaration of alloc function.
Fix declaration of alloc function.
C
mit
sferik/libxml-ruby,xml4r/libxml-ruby,sferik/libxml-ruby,sferik/libxml-ruby,xml4r/libxml-ruby,sferik/libxml-ruby,increments/libxml-ruby,xml4r/libxml-ruby,sferik/libxml-ruby,sferik/libxml-ruby,increments/libxml-ruby,increments/libxml-ruby
e481844fb1bada30eff2e2b17fe0e1a7d933bbfa
src/mikpeer.c
src/mikpeer.c
#include <miknet/miknet.h> int mikpeer (miknode_t *n) { int sock, i, pos = 0; struct sockaddr_storage addr; socklen_t addrlen; sock = accept(n->tcp, (struct sockaddr *)&addr, &addrlen); if (sock < 0) return mik_debug(ERR_SOCKET); if (n->peerc >= n->peermax) { close(sock); return ERR_PEER_MAX; } n->peerc++; for (i = 0; i < n->peermax; ++i) { if (n->peers[i].state == MIK_DISC) { pos = i; break; } } n->peers[pos].state = MIK_CONN; n->peers[pos].tcp = sock; n->peers[pos].addr = addr; n->peers[pos].addrlen = addrlen; n->peers[pos].sent = 0; n->peers[pos].recvd = 0; return 0; } int mikpeer_close (mikpeer_t *p) { close(p->tcp); memset(&p->addr, 0, sizeof(struct sockaddr_storage)); p->state = MIK_DISC; p->tcp = 0; p->addrlen = 0; p->sent = 0; p->recvd = 0; return 0; }
Create a constructor and deconstructor for the peer structure.
Create a constructor and deconstructor for the peer structure. Peers are created over the SOCK_STREAM socket, and so that is preferred. The array which holds all the peers of a node, node.peers, determines whether a slot is empty or occupied by the state of the peer. MIK_CONN is active, and MIK_DISC is an empty slot.
C
mit
PaytonTurnage/Miknet,turnage/Miknet
733710b2daccb85fb0e48a0a4dd98ca10f6e6c9d
src/keyimpl.h
src/keyimpl.h
#pragma once #include "jwtxx/jwt.h" #include <string> namespace JWTXX { struct Key::Impl { virtual std::string sign(const void* data, size_t size) const = 0; virtual bool verify(const void* data, size_t size, const std::string& signature) const = 0; }; }
#pragma once #include "jwtxx/jwt.h" #include <string> namespace JWTXX { struct Key::Impl { virtual ~Impl() {} virtual std::string sign(const void* data, size_t size) const = 0; virtual bool verify(const void* data, size_t size, const std::string& signature) const = 0; }; }
Fix memory leak in key implementations.
Fix memory leak in key implementations.
C
mit
RealImage/jwtxx,RealImage/jwtxx,madf/jwtxx,madf/jwtxx
0616049f570ad86c7d9e4064029d1340f32a4763
src/logging.h
src/logging.h
#pragma once #include <cstdio> namespace happyntrain { #define LOG(message, level, ...) \ printf("[" level "] %s-%d " message "\n", __FILE__, __LINE__, ##__VA_ARGS__); #define INFO(message, ...) LOG(message, "INFO", ##__VA_ARGS__); #define DEBUG(message, ...) LOG(message, "DEBUG", ##__VA_ARGS__); #define ERROR(message, ...) LOG(message, "ERROR", ##__VA_ARGS__); // end happyntrain }
#pragma once #include <cstdio> namespace happyntrain { #define LOG(message, level, ...) \ printf("[%5s] %s-%d " message "\n", level, __FILENAME__, __LINE__, \ ##__VA_ARGS__); #define INFO(message, ...) LOG(message, "INFO", ##__VA_ARGS__); #define DEBUG(message, ...) LOG(message, "DEBUG", ##__VA_ARGS__); #define ERROR(message, ...) \ LOG("\x1b[31m" message "\x1b[0m", "ERROR", ##__VA_ARGS__); // end happyntrain }
Add color for error log
Add color for error log
C
mit
emengjzs/happyntrain
a8b18b5159236f5b68e875ddf9ff0d52a0f8ea3c
swaybg/main.c
swaybg/main.c
#include <stdio.h> #include <stdlib.h> #include <wayland-client.h> #include <time.h> #include "client.h" #include "log.h" struct client_state *state; void sway_terminate(void) { client_teardown(state); exit(1); } int main(int argc, char **argv) { init_log(L_INFO); state = client_setup(); uint8_t r = 0, g = 0, b = 0; long last_ms = 0; int rs; do { struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); long ms = round(spec.tv_nsec / 1.0e6); cairo_set_source_rgb(state->cairo, r, g, b); cairo_rectangle(state->cairo, 0, 0, 100, 100); cairo_fill(state->cairo); rs = client_render(state); if (ms - last_ms > 100) { r++; if (r == 0) { g++; if (g == 0) { b++; } } ms = last_ms; } } while (rs); client_teardown(state); return 0; }
#include <stdio.h> #include <stdlib.h> #include <wayland-client.h> #include <time.h> #include "client.h" #include "log.h" struct client_state *state; void sway_terminate(void) { client_teardown(state); exit(1); } int main(int argc, char **argv) { init_log(L_INFO); if (!(state = client_setup())) { return -1; } uint8_t r = 0, g = 0, b = 0; long last_ms = 0; int rs; do { struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); long ms = round(spec.tv_nsec / 1.0e6); cairo_set_source_rgb(state->cairo, r, g, b); cairo_rectangle(state->cairo, 0, 0, 100, 100); cairo_fill(state->cairo); rs = client_render(state); if (ms - last_ms > 100) { r++; if (r == 0) { g++; if (g == 0) { b++; } } ms = last_ms; } } while (rs); client_teardown(state); return 0; }
Check the client_setup() return value
Check the client_setup() return value
C
mit
4e554c4c/sway,SirCmpwn/sway,crondog/sway,crondog/sway,taiyu-len/sway,mikkeloscar/sway,colemickens/sway,ptMuta/sway,johalun/sway,4e554c4c/sway,taiyu-len/sway,mikkeloscar/sway,sleep-walker/sway,ascent12/sway,sleep-walker/sway,1ace/sway,taiyu-len/sway,1ace/sway,colemickens/sway,christophgysin/sway,christophgysin/sway,1ace/sway,ascent12/sway,colemickens/sway,ascent12/sway
037b274e82319843bc95d709b9e6261f7de39c4e
tests/auto/qgsttest.h
tests/auto/qgsttest.h
/* Copyright (C) 2010 George Kiagiadakis <[email protected]> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QGSTTEST_H #define QGSTTEST_H #include <QtTest/QtTest> #include <gst/gst.h> class QGstTest : public QObject { Q_OBJECT private Q_SLOTS: void initTestCase() { gst_init(NULL, NULL); } void cleanupTestCase() { gst_deinit(); } }; #endif
/* Copyright (C) 2010 George Kiagiadakis <[email protected]> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QGSTTEST_H #define QGSTTEST_H #include <QtTest/QtTest> #include <QGst/Global> #include <gst/gst.h> class QGstTest : public QObject { Q_OBJECT private Q_SLOTS: void initTestCase() { QGst::init(); } void cleanupTestCase() { QGst::cleanup(); } }; #endif
Use QGst::init/cleanup in the tests to properly register the ValueVTables for the gstreamer types.
Use QGst::init/cleanup in the tests to properly register the ValueVTables for the gstreamer types.
C
lgpl-2.1
freedesktop-unofficial-mirror/gstreamer__qt-gstreamer,cyndis/qtgstreamer,detrout/qt-gstreamer,ylatuya/qt-gstreamer,GStreamer/qt-gstreamer,ylatuya/qt-gstreamer,freedesktop-unofficial-mirror/gstreamer__qt-gstreamer,GStreamer/qt-gstreamer,cyndis/qtgstreamer,iperry/qt-gstreamer,shadeslayer/qtgstreamer,iperry/qt-gstreamer,shadeslayer/qtgstreamer,freedesktop-unofficial-mirror/gstreamer__qt-gstreamer,knuesel/qt-gstreamer,dejunk/gstreamer,iperry/qt-gstreamer,cyndis/qtgstreamer,tswindell/qt-gstreamer,tswindell/qt-gstreamer,dejunk/gstreamer,dejunk/gstreamer,comicfans/libqtgstreamer,knuesel/qt-gstreamer,detrout/qt-gstreamer,nasserGanjali/QtGStreamer,comicfans/libqtgstreamer,GStreamer/qt-gstreamer,shadeslayer/qtgstreamer,nasserGanjali/QtGStreamer,tswindell/qt-gstreamer,knuesel/qt-gstreamer,nasserGanjali/QtGStreamer,comicfans/libqtgstreamer,ylatuya/qt-gstreamer,detrout/qt-gstreamer
b06fe693bbf13c9a8205eb03b3e12e6f87adc1c0
lib/asan/lit_tests/TestCases/no_asan_gen_globals.c
lib/asan/lit_tests/TestCases/no_asan_gen_globals.c
// Make sure __asan_gen_* strings do not end up in the symbol table. // RUN: %clang_asan %s -o %t.exe // RUN: nm %t.exe | grep __asan_gen_ || exit 0 int x, y, z; int main() { return 0; }
Make sure none of the __asan_gen_ global strings end up in the symbol table, add a test.
[ASan] Make sure none of the __asan_gen_ global strings end up in the symbol table, add a test. This should fix http://llvm.org/bugs/show_bug.cgi?id=17976 Another test checking for the global variables' locations and prefixes on Darwin will be committed separately. git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@198017 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
9773a97828cdec169d3e9c09326ed9b99cef25c6
problem_001.c
problem_001.c
/* * Multiples of 3 and 5 * * If we list all the natural numbers below 10 that are multiples of 3 or 5, * we get 3, 5, 6 and 9. The sum of these multiples is 23. * * Find the sum of all the multiples of 3 or 5 below 1000 */ #include <stdio.h> int main(void) { int sum = 0, i = 0; while (i < 1000) { if (i % 3 == 0 || i % 5 == 0) sum += i; i++; } printf("%i\n", sum); return 0; }
Add solution for problem 1
Add solution for problem 1
C
bsd-2-clause
skreuzer/euler
b26d114c3d5d3973fe85085f61e86efa6680260f
lib/quagga/src/common.h
lib/quagga/src/common.h
/* * OLSRd Quagga plugin * * Copyright (C) 2006-2008 Immo 'FaUl' Wehrenberg <[email protected]> * Copyright (C) 2007-2010 Vasilis Tsiligiannis <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation or - at your option - under * the terms of the GNU General Public Licence version 2 but can be * linked to any BSD-Licenced Software with public available sourcecode * */ /* ------------------------------------------------------------------------- * File : common.h * Description : common header file * ------------------------------------------------------------------------- */ #define OPTION_EXPORT 1 /* Zebra route types */ #define ZEBRA_ROUTE_OLSR 11 #define ZEBRA_ROUTE_MAX 13 struct zebra { char status; // internal status char options; // internal options int sock; // Socket to zebra... char redistribute[ZEBRA_ROUTE_MAX]; char distance; char flags; char *sockpath; unsigned int port; char version; }; extern struct zebra zebra; /* * Local Variables: * c-basic-offset: 2 * indent-tabs-mode: nil * End: */
/* * OLSRd Quagga plugin * * Copyright (C) 2006-2008 Immo 'FaUl' Wehrenberg <[email protected]> * Copyright (C) 2007-2010 Vasilis Tsiligiannis <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation or - at your option - under * the terms of the GNU General Public Licence version 2 but can be * linked to any BSD-Licenced Software with public available sourcecode * */ /* ------------------------------------------------------------------------- * File : common.h * Description : common header file * ------------------------------------------------------------------------- */ #define OPTION_EXPORT 1 /* Zebra route types */ #define ZEBRA_ROUTE_OLSR 11 #define ZEBRA_ROUTE_MAX 13 struct zebra { unsigned char status; unsigned char options; int sock; unsigned char redistribute[ZEBRA_ROUTE_MAX]; unsigned char distance; unsigned char flags; char *sockpath; unsigned int port; unsigned char version; }; extern struct zebra zebra; /* * Local Variables: * c-basic-offset: 2 * indent-tabs-mode: nil * End: */
Change some char type variables to unsigned char
Change some char type variables to unsigned char
C
bsd-3-clause
tdz/olsrd,duydb2/olsr,ninuxorg/olsrd,tdz/olsrd,servalproject/olsr,diogomg/olsrd-binary-heap,zioproto/olsrd-gsoc2012,duydb2/olsr,zioproto/olsrd,servalproject/olsr,ninuxorg/olsrd,acinonyx/olsrd,diogomg/olsrd-binary-heap,diogomg/olsrd,duydb2/olsr,diogomg/olsrd,servalproject/olsr,sebkur/olsrd,sebkur/olsrd,zioproto/olsrd-gsoc2012,zioproto/olsrd,nolith/olsrd,acinonyx/olsrd,servalproject/olsr,diogomg/olsrd,zioproto/olsrd,tdz/olsrd,nolith/olsrd,cholin/olsrd,duydb2/olsr,diogomg/olsrd-binary-heap,sebkur/olsrd,diogomg/olsrd,cholin/olsrd,zioproto/olsrd-gsoc2012,sebkur/olsrd,cholin/olsrd,sebkur/olsrd,diogomg/olsrd,zioproto/olsrd-gsoc2012,ninuxorg/olsrd,diogomg/olsrd-binary-heap,servalproject/olsr,duydb2/olsr,duydb2/olsr,zioproto/olsrd-gsoc2012,diogomg/olsrd-binary-heap,nolith/olsrd,duydb2/olsr,nolith/olsrd,tdz/olsrd,sebkur/olsrd,tdz/olsrd,zioproto/olsrd-gsoc2012,acinonyx/olsrd,acinonyx/olsrd,diogomg/olsrd,diogomg/olsrd,cholin/olsrd,ninuxorg/olsrd,acinonyx/olsrd,zioproto/olsrd,servalproject/olsr,nolith/olsrd,cholin/olsrd,zioproto/olsrd,duydb2/olsr,diogomg/olsrd-binary-heap,ninuxorg/olsrd,diogomg/olsrd-binary-heap
2bc02ed37549e09ff449860a73aa03b326910f07
bikepath/GeocodeItem.h
bikepath/GeocodeItem.h
// // GeocodeItem.h // bikepath // // Created by Farheen Malik on 8/19/14. // Copyright (c) 2014 Bike Path. All rights reserved. // #import <Foundation/Foundation.h> @interface GeocodeItem : NSObject @end
// // GeocodeItem.h // bikepath // // Created by Farheen Malik on 8/19/14. // Copyright (c) 2014 Bike Path. All rights reserved. // #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> #import <GoogleMaps/GoogleMaps.h> @interface GeocodeItem : NSObject @property NSString *latitude; @property NSString *longitude; @property CLLocation *position; @property NSString *address; @property (readonly) NSDate *creationDate; @end
Add address property to object
Add address property to object
C
apache-2.0
hushifei/bike-path,red-spotted-newts-2014/bike-path,red-spotted-newts-2014/bike-path
c89fb451343e8acae2220881bd628e2cada8cb4a
packages/Python/lldbsuite/test/functionalities/swift-runtime-reporting/abi-v2/library.h
packages/Python/lldbsuite/test/functionalities/swift-runtime-reporting/abi-v2/library.h
// library.h // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // // ----------------------------------------------------------------------------- // From swift's include/swift/Runtime/Debug.h file. struct RuntimeErrorDetails { uintptr_t version; const char *errorType; const char *currentStackDescription; uintptr_t framesToSkip; void *memoryAddress; struct Thread { const char *description; uint64_t threadID; uintptr_t numFrames; void **frames; }; uintptr_t numExtraThreads; Thread *threads; struct FixIt { const char *filename; uintptr_t startLine; uintptr_t startColumn; uintptr_t endLine; uintptr_t endColumn; const char *replacementText; }; struct Note { const char *description; uintptr_t numFixIts; FixIt *fixIts; }; uintptr_t numFixIts; FixIt *fixIts; uintptr_t numNotes; Note *notes; }; enum: uintptr_t { RuntimeErrorFlagNone = 0, RuntimeErrorFlagFatal = 1 << 0 }; extern "C" void _swift_runtime_on_report(uintptr_t flags, const char *message, RuntimeErrorDetails *details);
// library.h // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // // ----------------------------------------------------------------------------- #include <stdint.h> // From swift's include/swift/Runtime/Debug.h file. struct RuntimeErrorDetails { uintptr_t version; const char *errorType; const char *currentStackDescription; uintptr_t framesToSkip; void *memoryAddress; struct Thread { const char *description; uint64_t threadID; uintptr_t numFrames; void **frames; }; uintptr_t numExtraThreads; Thread *threads; struct FixIt { const char *filename; uintptr_t startLine; uintptr_t startColumn; uintptr_t endLine; uintptr_t endColumn; const char *replacementText; }; struct Note { const char *description; uintptr_t numFixIts; FixIt *fixIts; }; uintptr_t numFixIts; FixIt *fixIts; uintptr_t numNotes; Note *notes; }; enum: uintptr_t { RuntimeErrorFlagNone = 0, RuntimeErrorFlagFatal = 1 << 0 }; extern "C" void _swift_runtime_on_report(uintptr_t flags, const char *message, RuntimeErrorDetails *details);
Include the necessary headers to make the swift-runtime-reporting test work.
[testsuite] Include the necessary headers to make the swift-runtime-reporting test work.
C
apache-2.0
apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb
fb3ef57e902e16fceb2486e4b9d956155966fa05
strings/stringpiece_utils.h
strings/stringpiece_utils.h
// This is a placeholder to allow include-path compatibility with code written // inside Google. #ifndef STRINGS_STRINGPIECE_UTILS_H_ #define STRINGS_STRINGPIECE_UTILS_H_ #endif // STRINGS_STRINGPIECE_UTILS_H_
Add a temporary dummy header file to make an internal refactoring process go more smoothly.
Add a temporary dummy header file to make an internal refactoring process go more smoothly.
C
apache-2.0
VersoBit/mod_pagespeed,pagespeed/mod_pagespeed,VersoBit/mod_pagespeed,hashashin/src,VersoBit/mod_pagespeed,pagespeed/mod_pagespeed,hashashin/src,hashashin/src,hashashin/src,hashashin/src,pagespeed/mod_pagespeed,hashashin/src,VersoBit/mod_pagespeed,VersoBit/mod_pagespeed,pagespeed/mod_pagespeed,VersoBit/mod_pagespeed,pagespeed/mod_pagespeed,pagespeed/mod_pagespeed,hashashin/src,pagespeed/mod_pagespeed,VersoBit/mod_pagespeed,hashashin/src
0330581ab3b9002d55ee66f377ccbbb742175c01
arch/powerpc/kernel/swsusp.c
arch/powerpc/kernel/swsusp.c
/* * Common powerpc suspend code for 32 and 64 bits * * Copyright 2007 Johannes Berg <[email protected]> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <linux/sched.h> #include <asm/system.h> #include <asm/current.h> #include <asm/mmu_context.h> void save_processor_state(void) { /* * flush out all the special registers so we don't need * to save them in the snapshot */ flush_fp_to_thread(current); flush_altivec_to_thread(current); flush_spe_to_thread(current); #ifdef CONFIG_PPC64 hard_irq_disable(); #endif } void restore_processor_state(void) { #ifdef CONFIG_PPC32 switch_mmu_context(NULL, current->active_mm); #endif }
/* * Common powerpc suspend code for 32 and 64 bits * * Copyright 2007 Johannes Berg <[email protected]> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <linux/sched.h> #include <asm/system.h> #include <asm/current.h> #include <asm/mmu_context.h> void save_processor_state(void) { /* * flush out all the special registers so we don't need * to save them in the snapshot */ flush_fp_to_thread(current); flush_altivec_to_thread(current); flush_spe_to_thread(current); #ifdef CONFIG_PPC64 hard_irq_disable(); #endif } void restore_processor_state(void) { #ifdef CONFIG_PPC32 switch_mmu_context(current->active_mm, current->active_mm); #endif }
Fix the call trace when resumed from hibernation
powerpc/mm: Fix the call trace when resumed from hibernation In SMP mode, the kernel would produce call trace when resumed from hibernation. The reason is when the function destroy_context is called to drop the resuming mm context, the mm->context.active is 1 which is wrong and should be zero. We pass the current->active_mm as previous mm context to function switch_mmu_context to decrease the context.active by 1. In UP mode, there is no effect. Signed-off-by: Tang Yuantian <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas
a2400149f3df3b8848120d8242a12c5cc4e50eb5
src/Persist.h
src/Persist.h
/* Copyright 2016 Streampunk Media Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef PERSIST_H #define PERSIST_H namespace streampunk { class Persist { public: static std::unique_ptr<Persist> makeNew(Local<Object> object) { return std::make_unique<Persist>(object); } Persist(Local<Object> object) : mPersistObj(object) {} ~Persist() { mPersistObj.Reset(); } private: Nan::Persistent<Object> mPersistObj; }; } // namespace streampunk #endif
/* Copyright 2016 Streampunk Media Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef PERSIST_H #define PERSIST_H #include <memory> namespace streampunk { class Persist { public: static std::unique_ptr<Persist> makeNew(Local<Object> object) { return std::make_unique<Persist>(object); } Persist(Local<Object> object) : mPersistObj(object) {} ~Persist() { mPersistObj.Reset(); } private: Nan::Persistent<Object> mPersistObj; }; } // namespace streampunk #endif
Add missing include for make_unique
Add missing include for make_unique
C
apache-2.0
Streampunk/codecadon,Streampunk/codecadon,Streampunk/codecadon,Streampunk/codecadon
fca3fe6b3b8f7a918025c81597fe7e4c7e450887
tests/lists/cl_list_tests.c
tests/lists/cl_list_tests.c
#include <stdio.h> #include <stdlib.h> #include <cl_list.h> #include <cl_iterator.h> #define QTD 100
#include <stdio.h> #include <stdlib.h> #include <cl_list.h> #include <cl_iterator.h> #define QTD 100 void print_list_iter(cl_list_root *list) { iterator_c *i = cl_iter_create(list, FORWARD); printf("["); if (i != NULL) { do { printf("'%d', ", *((int *) cl_iter_item(i))); } while (cl_iter_next(i) && cl_iter_is_item(i, list->head)); }; printf("]\n"); cl_iter_free(i); } int main() { return EXIT_SUCCESS; }
Add list_iter for circular list test.
Add list_iter for circular list test.
C
mit
vndmtrx/libadt
40732a47d7d7e570a5124a6acf64665a0566dee9
src/h/startup.h
src/h/startup.h
typedef struct { int cluster; /* Condor Cluster # */ int proc; /* Condor Proc # */ int job_class; /* STANDARD, VANILLA, PVM, PIPE, ... */ uid_t uid; /* Execute job under this UID */ gid_t gid; /* Execute job under this pid */ pid_t virt_pid; /* PVM virt pid of this process */ int soft_kill_sig; /* Use this signal for a soft kill */ char *a_out_name; /* Where to get executable file */ char *cmd; /* Command name given by the user */ char *args; /* Command arguments given by the user */ char *env; /* Environment variables */ char *iwd; /* Initial working directory */ BOOLEAN ckpt_wanted; /* Whether user wants checkpointing */ BOOLEAN is_restart; /* Whether this run is a restart */ BOOLEAN coredump_limit_exists; /* Whether user wants to limit core size */ int coredump_limit; /* Limit in bytes */ } STARTUP_INFO;
typedef struct { int cluster; /* Condor Cluster # */ int proc; /* Condor Proc # */ int job_class; /* STANDARD, VANILLA, PVM, PIPE, ... */ uid_t uid; /* Execute job under this UID */ gid_t gid; /* Execute job under this pid */ pid_t virt_pid; /* PVM virt pid of this process */ int soft_kill_sig; /* Use this signal for a soft kill */ char *a_out_name; /* Where to get executable file */ char *cmd; /* Command name given by the user */ char *args; /* Command arguments given by the user */ char *env; /* Environment variables */ char *iwd; /* Initial working directory */ BOOLEAN ckpt_wanted; /* Whether user wants checkpointing */ BOOLEAN is_restart; /* Whether this run is a restart */ BOOLEAN coredump_limit_exists; /* Whether user wants to limit core size */ int coredump_limit; /* Limit in bytes */ } STARTUP_INFO; /* Should eliminate starter knowing the a.out name. Should go to shadow for instructions on how to fetch the executable - e.g. local file with name <name> or get it from TCP port <x> on machine <y>. */
Add comment saying that even though the a.out file name is here, it really shouldn't be.
Add comment saying that even though the a.out file name is here, it really shouldn't be.
C
apache-2.0
neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/condor,zhangzhehust/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,htcondor/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,djw8605/condor,neurodebian/htcondor,htcondor/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,mambelli/osg-bosco-marco,djw8605/condor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/condor,neurodebian/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,htcondor/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/condor,bbockelm/condor-network-accounting,djw8605/htcondor,clalancette/condor-dcloud,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,zhangzhehust/htcondor,djw8605/condor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,zhangzhehust/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,djw8605/htcondor,djw8605/condor,mambelli/osg-bosco-marco
e7baa2446426f801c372e771969f41b98c39e0bc
MUON/mapping/AliMpStationType.h
MUON/mapping/AliMpStationType.h
// $Id$ // Category: sector // // Enum AliMpStationType // --------------------- // Enumeration for refering to bending and non-bending planes. // // Authors: David Guez, Ivana Hrivnacova; IPN Orsay #ifndef ALI_MP_STATION_TYPE_H #define ALI_MP_STATION_TYPE_H enum AliMpStationType { kStation1, // station 1 kStation2, // station 2 }; #endif //ALI_MP_STATION_TYPE_H
Update for station2: Initial version (I.Hrivnacova)
Update for station2: Initial version (I.Hrivnacova)
C
bsd-3-clause
mkrzewic/AliRoot,shahor02/AliRoot,coppedis/AliRoot,ecalvovi/AliRoot,mkrzewic/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,mkrzewic/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,miranov25/AliRoot,alisw/AliRoot,coppedis/AliRoot,shahor02/AliRoot,coppedis/AliRoot,jgrosseo/AliRoot,alisw/AliRoot,sebaleh/AliRoot,shahor02/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,alisw/AliRoot,mkrzewic/AliRoot,coppedis/AliRoot,jgrosseo/AliRoot,jgrosseo/AliRoot,miranov25/AliRoot,jgrosseo/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,shahor02/AliRoot,miranov25/AliRoot,ALICEHLT/AliRoot,sebaleh/AliRoot,jgrosseo/AliRoot,ecalvovi/AliRoot,miranov25/AliRoot,alisw/AliRoot,shahor02/AliRoot,sebaleh/AliRoot,shahor02/AliRoot,miranov25/AliRoot,ecalvovi/AliRoot,shahor02/AliRoot,ALICEHLT/AliRoot,mkrzewic/AliRoot,jgrosseo/AliRoot,mkrzewic/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,miranov25/AliRoot,ecalvovi/AliRoot,ALICEHLT/AliRoot,jgrosseo/AliRoot,ecalvovi/AliRoot,mkrzewic/AliRoot,miranov25/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,coppedis/AliRoot,ALICEHLT/AliRoot,ALICEHLT/AliRoot
6a5a7dff3117f2e7093fed49bbbb7b2cd1d9704e
src/lib/llist.h
src/lib/llist.h
#ifndef LLIST_H #define LLIST_H /* Doubly linked list */ #define DLLIST_PREPEND(list, item) STMT_START { \ (item)->prev = NULL; \ (item)->next = *(list); \ if (*(list) != NULL) (*(list))->prev = (item); \ *(list) = (item); \ } STMT_END #define DLLIST_REMOVE(list, item) STMT_START { \ if ((item)->prev == NULL) \ *(list) = (item)->next; \ else \ (item)->prev->next = (item)->next; \ if ((item)->next != NULL) \ (item)->next->prev = (item)->prev; \ } STMT_END #endif
#ifndef LLIST_H #define LLIST_H /* Doubly linked list */ #define DLLIST_PREPEND(list, item) STMT_START { \ (item)->prev = NULL; \ (item)->next = *(list); \ if (*(list) != NULL) (*(list))->prev = (item); \ *(list) = (item); \ } STMT_END #define DLLIST_REMOVE(list, item) STMT_START { \ if ((item)->prev == NULL) \ *(list) = (item)->next; \ else \ (item)->prev->next = (item)->next; \ if ((item)->next != NULL) { \ (item)->next->prev = (item)->prev; \ (item)->next = NULL; \ } \ (item)->prev = NULL; \ } STMT_END #endif
Set removed item's prev/next pointers to NULL.
DLLIST_REMOVE(): Set removed item's prev/next pointers to NULL. --HG-- branch : HEAD
C
mit
dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot
2c84316746fa61b35efbc0c334fcb2a6dec0d53d
src/vasprintf.c
src/vasprintf.c
#include <stdarg.h> #include <stdio.h> #include <stdlib.h> int vasprintf(char **ret, const char *fmt, va_list ap) { char *buf; int len; size_t buflen; va_list ap2; #ifdef _MSC_VER ap2 = ap; len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( ) #else va_copy(ap2, ap); len = vsnprintf(NULL, 0, fmt, ap2); #endif if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) { len = vsnprintf(buf, buflen, fmt, ap); *ret = buf; } else { *ret = NULL; len = -1; } va_end(ap2); return len; }
#include <stdarg.h> #include <stdio.h> #include <stdlib.h> int vasprintf(char **ret, const char *fmt, va_list ap) { char *buf; int len; size_t buflen; va_list ap2; #if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR) ap2 = ap; len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( ) #else va_copy(ap2, ap); len = vsnprintf(NULL, 0, fmt, ap2); #endif if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) { len = vsnprintf(buf, buflen, fmt, ap); *ret = buf; } else { *ret = NULL; len = -1; } va_end(ap2); return len; }
Use _vscprintf() for mingw-w64 compilers
Use _vscprintf() for mingw-w64 compilers The mingw-w64 compilers implement a vsnprintf() function that do not conform to the C99 standard (just like MSVC).
C
mit
mono/eglib,mono/eglib
4f1caf24100fb7a0d0c1ab8fcc10f2e9a412e0cd
CefSharp.Core/Internals/CefRequestCallbackWrapper.h
CefSharp.Core/Internals/CefRequestCallbackWrapper.h
// Copyright 2010-2015 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" using namespace CefSharp; namespace CefSharp { namespace Internals { public ref class CefRequestCallbackWrapper : public IRequestCallback { private: MCefRefPtr<CefRequestCallback> _callback; CefRequestWrapper^ _requestWrapper; internal: CefRequestCallbackWrapper(CefRefPtr<CefRequestCallback> &callback) : CefRequestCallbackWrapper(callback, nullptr) { } CefRequestCallbackWrapper(CefRefPtr<CefRequestCallback> &callback, CefRequestWrapper^ requestWrapper) : _callback(callback), _requestWrapper(requestWrapper) { } !CefRequestCallbackWrapper() { _callback = NULL; } ~CefRequestCallbackWrapper() { this->!CefRequestCallbackWrapper(); if (_requestWrapper != nullptr) { delete _requestWrapper; } } public: virtual void Continue(bool allow) { _callback->Continue(allow); delete this; } virtual void Cancel() { _callback->Cancel(); delete this; } }; } }
// Copyright 2010-2015 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" using namespace CefSharp; namespace CefSharp { namespace Internals { public ref class CefRequestCallbackWrapper : public IRequestCallback { private: MCefRefPtr<CefRequestCallback> _callback; IRequest^ _request; internal: CefRequestCallbackWrapper(CefRefPtr<CefRequestCallback> &callback) : CefRequestCallbackWrapper(callback, nullptr) { } CefRequestCallbackWrapper(CefRefPtr<CefRequestCallback> &callback, IRequest^ request) : _callback(callback), _request(request) { } !CefRequestCallbackWrapper() { _callback = NULL; } ~CefRequestCallbackWrapper() { this->!CefRequestCallbackWrapper(); if (_request != nullptr) { delete _request; } } public: virtual void Continue(bool allow) { _callback->Continue(allow); delete this; } virtual void Cancel() { _callback->Cancel(); delete this; } }; } }
Change to use IRequest instead (use interfaces for classes where possible)
Change to use IRequest instead (use interfaces for classes where possible)
C
bsd-3-clause
wangzheng888520/CefSharp,joshvera/CefSharp,Haraguroicha/CefSharp,Haraguroicha/CefSharp,dga711/CefSharp,rlmcneary2/CefSharp,haozhouxu/CefSharp,ruisebastiao/CefSharp,yoder/CefSharp,illfang/CefSharp,battewr/CefSharp,zhangjingpu/CefSharp,illfang/CefSharp,twxstar/CefSharp,windygu/CefSharp,ITGlobal/CefSharp,jamespearce2006/CefSharp,jamespearce2006/CefSharp,Haraguroicha/CefSharp,NumbersInternational/CefSharp,gregmartinhtc/CefSharp,joshvera/CefSharp,dga711/CefSharp,battewr/CefSharp,gregmartinhtc/CefSharp,yoder/CefSharp,windygu/CefSharp,illfang/CefSharp,VioletLife/CefSharp,twxstar/CefSharp,wangzheng888520/CefSharp,twxstar/CefSharp,NumbersInternational/CefSharp,yoder/CefSharp,AJDev77/CefSharp,ruisebastiao/CefSharp,gregmartinhtc/CefSharp,AJDev77/CefSharp,jamespearce2006/CefSharp,ITGlobal/CefSharp,Livit/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,zhangjingpu/CefSharp,illfang/CefSharp,rlmcneary2/CefSharp,ITGlobal/CefSharp,VioletLife/CefSharp,Livit/CefSharp,battewr/CefSharp,windygu/CefSharp,dga711/CefSharp,AJDev77/CefSharp,ITGlobal/CefSharp,Livit/CefSharp,ruisebastiao/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,battewr/CefSharp,NumbersInternational/CefSharp,rlmcneary2/CefSharp,Haraguroicha/CefSharp,wangzheng888520/CefSharp,NumbersInternational/CefSharp,haozhouxu/CefSharp,zhangjingpu/CefSharp,Haraguroicha/CefSharp,ruisebastiao/CefSharp,Livit/CefSharp,gregmartinhtc/CefSharp,haozhouxu/CefSharp,twxstar/CefSharp,rlmcneary2/CefSharp,dga711/CefSharp,yoder/CefSharp,AJDev77/CefSharp,VioletLife/CefSharp,joshvera/CefSharp,windygu/CefSharp,zhangjingpu/CefSharp,jamespearce2006/CefSharp,joshvera/CefSharp
d6b237df5e17eab304b62a01ff377a1e9fda0caf
win32/PlatWin.h
win32/PlatWin.h
// Scintilla source code edit control /** @file PlatWin.h ** Implementation of platform facilities on Windows. **/ // Copyright 1998-2011 by Neil Hodgson <[email protected]> // The License.txt file describes the conditions under which this software may be distributed. extern bool IsNT(); extern void Platform_Initialise(void *hInstance); extern void Platform_Finalise(); #if defined(_MSC_VER) extern bool LoadD2D(); extern ID2D1Factory *pD2DFactory; extern IDWriteFactory *pIDWriteFactory; #endif
// Scintilla source code edit control /** @file PlatWin.h ** Implementation of platform facilities on Windows. **/ // Copyright 1998-2011 by Neil Hodgson <[email protected]> // The License.txt file describes the conditions under which this software may be distributed. extern bool IsNT(); extern void Platform_Initialise(void *hInstance); extern void Platform_Finalise(); #if defined(USE_D2D) extern bool LoadD2D(); extern ID2D1Factory *pD2DFactory; extern IDWriteFactory *pIDWriteFactory; #endif
Allow choice of D2D on compiler command line.
Allow choice of D2D on compiler command line.
C
isc
timonwong/foo_uie_wsh_panel_mod.scintilla,timonwong/foo_uie_wsh_panel_mod.scintilla,timonwong/foo_uie_wsh_panel_mod.scintilla,timonwong/foo_uie_wsh_panel_mod.scintilla,timonwong/foo_uie_wsh_panel_mod.scintilla,timonwong/foo_uie_wsh_panel_mod.scintilla,timonwong/foo_uie_wsh_panel_mod.scintilla,timonwong/foo_uie_wsh_panel_mod.scintilla
83e16fa7755f2b4c908366d28aa83180a2d9e817
PHPHub/Constants/SecretConstant.example.h
PHPHub/Constants/SecretConstant.example.h
// // SecretConstant.example.h // PHPHub // // Created by Aufree on 9/30/15. // Copyright (c) 2015 ESTGroup. All rights reserved. // #if DEBUG #define Client_id @"kHOugsx4dmcXwvVbmLkd" #define Client_secret @"PuuFCrF94MloSbSkxpwS" #else #define Client_id @"Set up a client id for production env" #define Client_secret @"Set up a client secret for production env" #endif #define UMENG_APPKEY @"Set up UMEng App Key" #define UMENG_QQ_ID @"Set up qq id" #define UMENG_QQ_APPKEY @"Set up qq appkey" #define WX_APP_ID @"Set up weixin app id" #define WX_APP_SECRET @"Set up weixin app secret" #define TRACKING_ID @"Set up google anlytics tracking id"
// // SecretConstant.example.h // PHPHub // // Created by Aufree on 9/30/15. // Copyright (c) 2015 ESTGroup. All rights reserved. // #if DEBUG #define Client_id @"kHOugsx4dmcXwvVbmLkd" #define Client_secret @"PuuFCrF94MloSbSkxpwS" #else #define Client_id @"" // Set up a client id for production environment #define Client_secret @"" // Set up a client secret for production environment #endif #define UMENG_APPKEY @"" // Set up UMEng App Key #define UMENG_QQ_ID @"" // Set up QQ id #define UMENG_QQ_APPKEY @"" // Set up QQ appkey #define WX_APP_ID @"" // Set up wechat app id #define WX_APP_SECRET @"" // Set up wechat app secret #define JPush_APP_KEY @"" // Set up Jpush App Key #define TRACKING_ID @"" // Set up google anlytics tracking id
Update comments of SecretConstant file
Update comments of SecretConstant file
C
mit
Aufree/phphub-ios
a8d2223c18dad7981b74670ef719d9dcc5833679
ann.h
ann.h
#ifndef ANN_H #define ANN_H #endif
#ifndef ANN_H #define ANN_H #define INPUTS 3 #define HIDDEN 5 #define OUTPUTS 2 #define ROWS 5 typedef struct { double input[HIDDEN][INPUTS + 1]; double hidden[ROWS - 3][HIDDEN][HIDDEN + 1]; double output[OUTPUTS][HIDDEN + 1]; } Links; typedef struct { int input[INPUTS]; int hidden[ROWS - 2][HIDDEN]; int output[OUTPUTS]; } Neurons; typedef struct { Links weights; Links slopes; Neurons values; } ANN; void ann_create(ANN *ann) void ann_mutate(ANN *ann, double increment) void ann_calculate(ANN *ann, double increment) void ann_save(ANN *ann, char *filename) void ann_load(ANN *ann, char *filename) #endif
Create contents of .h file
Create contents of .h file
C
mit
tysonzero/c-ann
777e88ac428fa5af101a3345359fa563fd7c1e8e
IAAI.c
IAAI.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; int main() { system(RAW); char str[] = "I AM AN IDIOT "; size_t len = strlen(str); while ( 1 ) { for ( size_t i = 0 ; i < len ; i++ ) { getchar(); printf("\b%c", str[i]); } system(COOKED); printf("\n"); system(RAW); } return 0; }
#include <stdio.h> #include <stdlib.h> #include <string.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { system(RAW); const char *str; if ( argc == 2 ) str = argv[1]; else str = default_str; size_t len = strlen(str); while ( 1 ) { for ( size_t i = 0 ; i < len ; i++ ) { getchar(); printf("\b%c", str[i]); } system(COOKED); printf("\n"); system(RAW); } return 0; }
Allow user to choose if they want :)
Allow user to choose if they want :)
C
mit
vinamarora8/IAAI
a528fce787eb40471330c0464848b8a6b9f72b44
Tokaido/TKDApp.h
Tokaido/TKDApp.h
// // TKDApp.h // Tokaido // // Created by Mucho Besos on 10/25/12. // Copyright (c) 2012 Tilde. All rights reserved. // #import <Cocoa/Cocoa.h> typedef enum : NSUInteger { TKDAppOff, TKDAppBooting, TKDAppOn, TKDAppShuttingDown } TKDAppState; @interface TKDApp : MTLModel @property (nonatomic, copy) NSString *appName; @property (nonatomic, copy) NSString *appDirectoryPath; @property (nonatomic, copy) NSString *appHostname; @property (nonatomic, copy) NSString *appIconPath; @property (nonatomic, assign) TKDAppState state; @property (nonatomic, assign) BOOL usesYAMLfile; /** This can be used to init an TKD app instance with a directory, provided the directory includes a Tokaido.yaml file with the following entries: app_name: App Name hostname: app.local app_icon: ./icon.png */ - (id)initWithTokaidoDirectory:(NSURL *)url; - (void)showInFinder; - (void)openInBrowser; - (void)serializeToYAML; @end
// // TKDApp.h // Tokaido // // Created by Mucho Besos on 10/25/12. // Copyright (c) 2012 Tilde. All rights reserved. // #import <Cocoa/Cocoa.h> typedef enum : NSUInteger { TKDAppOff, TKDAppBooting, TKDAppOn, TKDAppShuttingDown } TKDAppState; typedef enum : NSUInteger { TKDAppBundling, TKDAppBundleFailed, TKDAppStartingServer } TKDAppBootingSubstate; @interface TKDApp : MTLModel @property (nonatomic, copy) NSString *appName; @property (nonatomic, copy) NSString *appDirectoryPath; @property (nonatomic, copy) NSString *appHostname; @property (nonatomic, copy) NSString *appIconPath; @property (nonatomic, assign) TKDAppState state; @property (nonatomic, assign) TKDAppBootingSubstate bootingSubstate; @property (nonatomic, assign) BOOL usesYAMLfile; /** This can be used to init an TKD app instance with a directory, provided the directory includes a Tokaido.yaml file with the following entries: app_name: App Name hostname: app.local app_icon: ./icon.png */ - (id)initWithTokaidoDirectory:(NSURL *)url; - (void)showInFinder; - (void)openInBrowser; - (void)serializeToYAML; @end
Add booting substate for message
Add booting substate for message
C
mit
webdev1001/tokaidoapp,tokaido/tokaidoapp,tokaido/tokaidoapp,webdev1001/tokaidoapp,webdev1001/tokaidoapp,webdev1001/tokaidoapp,tokaido/tokaidoapp
30658b235a7a7b8df8164741d03dd9fc6e45129d
system/coro.c
system/coro.c
#include "coro.h" #include "stack.h" #include <assert.h> #include <stdlib.h> #include <string.h> coro *coro_spawn(coro *me, coro_func f, size_t ssize) { coro *c = (coro*)malloc(sizeof(coro)); assert(c != NULL); c->running = 0; c->base = malloc(ssize); assert(c->base != NULL); c->stack = c->base + ssize; memset(c->base, 0, ssize); makestack(&me->stack, &c->stack, f, c); return c; } coro *coro_init() { coro *me = (coro*)malloc(sizeof(coro)); me->running = 1; // We don't need to free this (it's just the main stack segment) // so ignore it. me->base = NULL; // This'll get overridden when we swapstacks out of here. me->stack = NULL; return me; } void destroy_coro(coro *c) { free(c->base); free(c); }
#include "coro.h" #include "stack.h" #include <assert.h> #include <stdlib.h> #include <string.h> coro *coro_spawn(coro *me, coro_func f, size_t ssize) { coro *c = (coro*)malloc(sizeof(coro)); assert(c != NULL); c->running = 0; c->base = malloc(ssize); assert(c->base != NULL); c->stack = (char*) c->base + ssize; memset(c->base, 0, ssize); makestack(&me->stack, &c->stack, f, c); return c; } coro *coro_init() { coro *me = (coro*)malloc(sizeof(coro)); me->running = 1; // We don't need to free this (it's just the main stack segment) // so ignore it. me->base = NULL; // This'll get overridden when we swapstacks out of here. me->stack = NULL; return me; } void destroy_coro(coro *c) { free(c->base); free(c); }
Make pointer arithmetic warning go away
Make pointer arithmetic warning go away
C
bsd-3-clause
buaasun/grappa,buaasun/grappa,alexfrolov/grappa,alexfrolov/grappa,alexfrolov/grappa,alexfrolov/grappa,uwsampa/grappa,uwsampa/grappa,uwsampa/grappa,alexfrolov/grappa,uwsampa/grappa,uwsampa/grappa,alexfrolov/grappa,buaasun/grappa,buaasun/grappa,alexfrolov/grappa,buaasun/grappa,buaasun/grappa,buaasun/grappa,uwsampa/grappa,uwsampa/grappa
cfab8acf28fd7aff0b2d355c9935b028376ea08e
sequence.h
sequence.h
#ifndef SEQUENCE_H #define SEQUENCE_H #include "object.h" typedef enum IterType_ {ITERLIST, ITERVECTOR} IterType; typedef struct Iter_ { IterType type; union { struct { Object *node; bool first; } list; struct { Object *object; int index; } vec; } u; } Iter; bool object_isseq(Object *object); Iter seq_iter(Object *object); Object *iter_next(Iter *iter); int seq_len(Object *object); Object *seq_nth(Object *object, int n); #endif
#ifndef SEQUENCE_H #define SEQUENCE_H #include "object.h" typedef enum IterType_ {ITERLIST, ITERVECTOR} IterType; typedef struct Iter_ { IterType type; union { struct { Object *node; bool first; } list; struct { Object *object; int index; } vec; } u; } Iter; bool object_isseq(Object *object) __attribute__ ((pure)); Iter seq_iter(Object *object); Object *iter_next(Iter *iter); int seq_len(Object *object) __attribute__ ((pure)); Object *seq_nth(Object *object, int n) __attribute__ ((pure)); #endif
Mark some functions as pure
Mark some functions as pure
C
mit
ids1024/idslisp
d61970e389e32156543068e359c5af767bb3e549
src/main.h
src/main.h
#pragma once #include <unistd.h> #include <iostream> #include <list> #include <map> #include <mutex> #include <unordered_map> #include <queue> #include <sstream> #include <thread> #include <tuple> #include <vector>
#pragma once #include <unistd.h> #include <iostream> #include <list> #include <map> #include <mutex> #include <unordered_map> #include <queue> #include <sstream> #include <set> #include <thread> #include <tuple> #include <vector>
Include missing necessary include <set>
Include missing necessary include <set>
C
mit
ElementalAlchemist/RoBoBo,ElementalAlchemist/RoBoBo
1a16a79939e53044d07009bc746cfe9a08e878d4
IA32ABI/xabicc.c
IA32ABI/xabicc.c
/* * xabicc.c - platform-agnostic root for ALien call-outs and callbacks. * * Support for Call-outs and Call-backs from the IA32ABI Plugin. * The plgin is misnamed. It should be the AlienPlugin, but its history * dictates otherwise. */ #if i386|i486|i586|i686 # include "ia32abicc.c" #elif powerpc|ppc # include "ppcia32abicc.c" #elif x86_64|x64 # include "x64ia32abicc.o" #endif
/* * xabicc.c - platform-agnostic root for ALien call-outs and callbacks. * * Support for Call-outs and Call-backs from the IA32ABI Plugin. * The plgin is misnamed. It should be the AlienPlugin, but its history * dictates otherwise. */ #if i386|i486|i586|i686 # include "ia32abicc.c" #elif powerpc|ppc # include "ppcia32abicc.c" #elif x86_64|x64|__x86_64|__x86_64__ # include "x64ia32abicc.c" #endif
Make the list of x64 processor names inclusive enough to compile the Alien plugin on 64-bit linux.
Make the list of x64 processor names inclusive enough to compile the Alien plugin on 64-bit linux. git-svn-id: http://squeakvm.org/svn/squeak/trunk@3237 fa1542d4-bde8-0310-ad64-8ed1123d492a Former-commit-id: 600bd5e36821553d6b9391d8bbd8d75d4ad10a85
C
mit
timfel/squeakvm,timfel/squeakvm,timfel/squeakvm,bencoman/pharo-vm,peteruhnak/pharo-vm,timfel/squeakvm,bencoman/pharo-vm,peteruhnak/pharo-vm,bencoman/pharo-vm,timfel/squeakvm,bencoman/pharo-vm,timfel/squeakvm,timfel/squeakvm,bencoman/pharo-vm,timfel/squeakvm,bencoman/pharo-vm,peteruhnak/pharo-vm,OpenSmalltalk/vm,OpenSmalltalk/vm,peteruhnak/pharo-vm,OpenSmalltalk/vm,peteruhnak/pharo-vm,OpenSmalltalk/vm,bencoman/pharo-vm,bencoman/pharo-vm,OpenSmalltalk/vm,peteruhnak/pharo-vm,peteruhnak/pharo-vm,peteruhnak/pharo-vm,bencoman/pharo-vm,OpenSmalltalk/vm,OpenSmalltalk/vm,OpenSmalltalk/vm
03aa0b50b157b97af1dbaf93461c4941bc0bbfaa
benchs/MatMulC.c
benchs/MatMulC.c
#include <stdlib.h> #include "MatMulC.h" void MatMulC(int rows, int len, double *a, double *b, double *c) { int i,j,k; for( i = 0; i < rows; i++ ) { for( j = 0; j < rows; j+=2 ) { double sum0 = 0.0; double sum1 = 0.0; for( k = 0; k < rows; k++ ) { sum0 += a[i*rows+k] * b[k*rows + j]; sum1 += a[i*rows+k] * b[k*rows + j + 1]; } c[i*rows + j] = sum0; c[i*rows + j+1] = sum1; } } }
#include <stdlib.h> #include "MatMulC.h" void MatMulC(int rows, int len, double *a, double *bin, double *c) { int i,j,k; double *b = malloc(len * sizeof(double)); // Transpose bin with result in b. for(int n = 0; n < len; n++ ) { b[n] = bin[rows * (n % rows) + (n / rows)]; } for( i = 0; i < rows; i++ ) { for( j = 0; j < rows; j+=2 ) { double sum0 = 0.0; double sum1 = 0.0; for( k = 0; k < rows; k++ ) { sum0 += a[i*rows+k] * b[j*rows + k]; sum1 += a[i*rows+k] * b[(j + 1)*rows + k]; } c[i*rows + j] = sum0; c[i*rows + j+1] = sum1; } } free(b); }
Transpose the second matrix in the C reference for MatMul.
Transpose the second matrix in the C reference for MatMul.
C
bsd-3-clause
emwap/feldspar-compiler,emwap/feldspar-compiler
45fb9eb248df779c8fa845dac32bcafd2c129d40
include/LinearLayout.h
include/LinearLayout.h
#ifndef _LINEARLAYOUT_H_ #define _LINEARLAYOUT_H_ #include <Element.h> #include <Command.h> #define FW_VERTICAL 1 #define FW_HORIZONTAL 2 class LinearLayout : public Element { public: LinearLayout(int _direction, int _id) : Element(_id), direction(_direction) { } bool isA(const std::string & className) override { if (className == "LinearLayout") return true; return Element::isA(className); } protected: void create() override { Command c(Command::CREATE_LINEAR_LAYOUT, getParentInternalId(), getInternalId()); c.setValue(direction); sendCommand(c); } private: int direction = FW_VERTICAL; }; #endif
#ifndef _LINEARLAYOUT_H_ #define _LINEARLAYOUT_H_ #include <Element.h> #include <Command.h> #define FW_VERTICAL 1 #define FW_HORIZONTAL 2 class LinearLayout : public Element { public: LinearLayout(int _direction, int _id = 0) : Element(_id), direction(_direction) { } bool isA(const std::string & className) override { if (className == "LinearLayout") return true; return Element::isA(className); } protected: void create() override { Command c(Command::CREATE_LINEAR_LAYOUT, getParentInternalId(), getInternalId()); c.setValue(direction); sendCommand(c); } private: int direction = FW_VERTICAL; }; #endif
Add default value to id on constructor
Add default value to id on constructor
C
mit
Sometrik/framework,Sometrik/framework,Sometrik/framework
e800dd51a625cadc087c40cd41fd31d68e4f52bc
include/scopemeasure.h
include/scopemeasure.h
#ifndef NEWSBOAT_SCOPEMEASURE_H_ #define NEWSBOAT_SCOPEMEASURE_H_ #include <sys/time.h> #include <string> #include "logger.h" namespace newsboat { class ScopeMeasure { public: ScopeMeasure(const std::string& func, Level ll = Level::DEBUG); ~ScopeMeasure(); void stopover(const std::string& son = ""); private: struct timeval tv1, tv2; std::string funcname; Level lvl; }; } // namespace newsboat #endif /* NEWSBOAT_SCOPEMEASURE_H_ */
#ifndef NEWSBOAT_SCOPEMEASURE_H_ #define NEWSBOAT_SCOPEMEASURE_H_ #include <sys/time.h> #include <string> #include "logger.h" namespace newsboat { class ScopeMeasure { public: ScopeMeasure(const std::string& func, Level ll = Level::DEBUG); ~ScopeMeasure(); void stopover(const std::string& son = ""); private: struct timeval tv1 = {}, tv2 = {}; std::string funcname; Level lvl = Level::DEBUG; }; } // namespace newsboat #endif /* NEWSBOAT_SCOPEMEASURE_H_ */
Initialize all members of ScopeMeasure
Initialize all members of ScopeMeasure Problem spotted by PVS Studio.
C
mit
newsboat/newsboat,der-lyse/newsboat,newsboat/newsboat,newsboat/newsboat,der-lyse/newsboat,newsboat/newsboat,newsboat/newsboat,der-lyse/newsboat,der-lyse/newsboat,newsboat/newsboat,der-lyse/newsboat,der-lyse/newsboat,newsboat/newsboat,der-lyse/newsboat,newsboat/newsboat,der-lyse/newsboat
3b7da8cd1e2f77d73cc19533fc657ba10a80c8cd
include/tgbot/export.h
include/tgbot/export.h
#ifndef TGBOT_EXPORT_H #define TGBOT_EXPORT_H #ifndef TGBOT_API #ifdef TGBOT_DLL #if defined _WIN32 || defined __CYGWIN__ #define TGBOT_HELPER_DLL_IMPORT __declspec(dllimport) #define TGBOT_HELPER_DLL_EXPORT __declspec(dllexport) #else #if __GNUC__ >= 4 #define TGBOT_HELPER_DLL_IMPORT __attribute__ ((visibility ("default"))) #define TGBOT_HELPER_DLL_EXPORT __attribute__ ((visibility ("default"))) #else #define TGBOT_HELPER_DLL_IMPORT #define TGBOT_HELPER_DLL_EXPORT #endif #endif #ifdef TgBot_EXPORTS #define TGBOT_API TGBOT_HELPER_DLL_EXPORT #else #define FOX_API TGBOT_HELPER_DLL_IMPORT #endif #else #define TGBOT_API #endif #endif #endif //TGBOT_EXPORT_H
#ifndef TGBOT_EXPORT_H #define TGBOT_EXPORT_H #ifndef TGBOT_API #ifdef TGBOT_DLL #if defined _WIN32 || defined __CYGWIN__ #define TGBOT_HELPER_DLL_EXPORT __declspec(dllexport) #define TGBOT_HELPER_DLL_IMPORT __declspec(dllimport) #else #if __GNUC__ >= 4 #define TGBOT_HELPER_DLL_EXPORT __attribute__ ((visibility ("default"))) #define TGBOT_HELPER_DLL_IMPORT __attribute__ ((visibility ("default"))) #else #define TGBOT_HELPER_DLL_EXPORT #define TGBOT_HELPER_DLL_IMPORT #endif #endif #ifdef TgBot_EXPORTS #define TGBOT_API TGBOT_HELPER_DLL_EXPORT #else #define TGBOT_API TGBOT_HELPER_DLL_IMPORT #endif #else #define TGBOT_API #endif #endif #endif //TGBOT_EXPORT_H
Fix mistake FOX and reorder EXPORT/IMPORT
Fix mistake FOX and reorder EXPORT/IMPORT
C
mit
reo7sp/tgbot-cpp,reo7sp/tgbot-cpp,reo7sp/tgbot-cpp
37b123271739ea3a8dcd9397873b9c2e9949fe6f
packages/Python/lldbsuite/test/make/pseudo_barrier.h
packages/Python/lldbsuite/test/make/pseudo_barrier.h
#include <atomic> #include <thread> typedef std::atomic<int> pseudo_barrier_t; static inline void pseudo_barrier_wait(pseudo_barrier_t &barrier) { --barrier; while (barrier > 0) std::this_thread::yield(); } static inline void pseudo_barrier_init(pseudo_barrier_t &barrier, int count) { barrier = count; }
#include <atomic> // Note that although hogging the CPU while waiting for a variable to change // would be terrible in production code, it's great for testing since it avoids // a lot of messy context switching to get multiple threads synchronized. typedef std::atomic<int> pseudo_barrier_t; #define pseudo_barrier_wait(barrier) \ do \ { \ --(barrier); \ while ((barrier).load() > 0) \ ; \ } while (0) #define pseudo_barrier_init(barrier, count) \ do \ { \ (barrier) = (count); \ } while (0)
Revert "[test] Address TestConcurrentMany*.py flakiness on macOS"
Revert "[test] Address TestConcurrentMany*.py flakiness on macOS" This reverts my change to pseudo_barrier.h which isn't necessary anymore after Fred's fix to debugserver and caused TestThreadStepOut to fail. git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@370963 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb
0db658e796e364ebbd401d03b4b14961c59da77b
States/StatesController+DragNDrop.h
States/StatesController+DragNDrop.h
// // StatesController+DragNDrop.h // States // // Created by Dmitry Rodionov on 13/06/16. // Copyright © 2016 Internals Exposed. All rights reserved. // #import "StatesController.h" @interface StatesController (DragNDrop) @end
// // StatesController+DragNDrop.h // States // // Created by Dmitry Rodionov on 13/06/16. // Copyright © 2016 Internals Exposed. All rights reserved. // #import "StatesController.h" @interface StatesController (DragNDrop) // This category implements the following NSTableViewDataSources methods: - (BOOL)tableView: (NSTableView *)tableView writeRowsWithIndexes: (NSIndexSet *)rowIndexes toPasteboard: (NSPasteboard *)pboard; - (NSDragOperation)tableView: (NSTableView *)tableView validateDrop: (id <NSDraggingInfo>)info proposedRow: (NSInteger)row proposedDropOperation: (NSTableViewDropOperation)dropOperation; - (BOOL)tableView: (NSTableView *)tableView acceptDrop: (id <NSDraggingInfo>)info row: (NSInteger)row dropOperation: (NSTableViewDropOperation)dropOperation; @end
Add missing header into for DragNDrop category on StatesContoller
Add missing header into for DragNDrop category on StatesContoller
C
mit
edenvidal/States,edenvidal/States
3a7937af55780e9b2d38ff234d8ddbda90578313
You-GUI/stdafx.h
You-GUI/stdafx.h
//@author A0094446X #pragma once #ifndef YOU_GUI_STDAFX_H_ #define YOU_GUI_STDAFX_H_ #include <QtWidgets> #endif // YOU_GUI_STDAFX_H_
//@author A0094446X #pragma once #ifndef YOU_GUI_STDAFX_H_ #define YOU_GUI_STDAFX_H_ #include <memory> #include <QApplication> #include <QList> #include <QWidget> #include <QtWidgets> #include <boost/date_time/gregorian/greg_month.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #endif // YOU_GUI_STDAFX_H_
Add more files to the PCH for faster compiles.
Add more files to the PCH for faster compiles.
C
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
e567e0d86bcabd0746ec0704ea56598d8c15d728
Settings/Controls/Controls.h
Settings/Controls/Controls.h
#pragma once #include "Control.h" #include "Button.h" #include "Checkbox.h" #include "ComboBox.h" #include "Label.h" #include "ListView.h" #include "Spinner.h" #include "EditBox.h"
#pragma once #include "Control.h" #include "Button.h" #include "Checkbox.h" #include "ComboBox.h" #include "GroupBox.h" #include "Label.h" #include "ListView.h" #include "Spinner.h" #include "EditBox.h"
Add groupbox to control header
Add groupbox to control header
C
bsd-2-clause
malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,malensek/3RVX,Soulflare3/3RVX,malensek/3RVX
dd487c159bb93639ce574ab2e5340be5cbf4a4d1
test/CFrontend/2007-08-01-LoadStoreAlign.c
test/CFrontend/2007-08-01-LoadStoreAlign.c
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep -c {align 1} | grep 2 // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc struct p { char a; int b; } __attribute__ ((packed)); struct p t = { 1, 10 }; struct p u; int main () { int tmp = t.b; u.b = tmp; return tmp; }
Add a test for the load/store alignment.
Add a test for the load/store alignment. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@40687 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap
583acd2de697ec1f6d148755fe01df3ba97d7bfd
nbtk/nbtkmodule.c
nbtk/nbtkmodule.c
#include <pygobject.h> #include <clutter/clutter.h> void pynbtk_register_classes (PyObject *d); void pynbtk_add_constants (PyObject *module, const gchar *prefix); extern PyMethodDef pynbtk_functions[]; DL_EXPORT(void) init_nbtk(void) { PyObject *m, *d; init_pygobject_check (2, 12, 0); m = Py_InitModule ("_nbtk", pynbtk_functions); d = PyModule_GetDict (m); pynbtk_register_classes (d); pynbtk_add_constants (m, "NBTK_"); if (PyErr_Occurred ()) { Py_FatalError ("can't initialise module nbtk"); } }
#include <pygobject.h> #include <nbtk/nbtk.h> void pynbtk_register_classes (PyObject *d); void pynbtk_add_constants (PyObject *module, const gchar *prefix); extern PyMethodDef pynbtk_functions[]; static void sink_nbtkaction (GObject *object) { if (g_object_is_floating (object)) g_object_ref_sink (object); } DL_EXPORT(void) init_nbtk(void) { PyObject *m, *d; init_pygobject_check (2, 12, 0); pygobject_register_sinkfunc (NBTK_TYPE_ACTION, sink_nbtkaction); m = Py_InitModule ("_nbtk", pynbtk_functions); d = PyModule_GetDict (m); pynbtk_register_classes (d); pynbtk_add_constants (m, "NBTK_"); if (PyErr_Occurred ()) { Py_FatalError ("can't initialise module nbtk"); } }
Add a sink function for nbtk.Action
Add a sink function for nbtk.Action NbtkAction is a GInitiallyUnowned, so we need to register a sinkfunc.
C
lgpl-2.1
buztard/mxpy,buztard/mxpy,buztard/mxpy
bd6a64a57f85933059231789ed6ec117bd1089da
ADLivelyCollectionView.h
ADLivelyCollectionView.h
// // ADLivelyCollectionView.h // ADLivelyCollectionView // // Created by Romain Goyet on 18/04/12. // Copyright (c) 2012 Applidium. All rights reserved. // #import <UIKit/UIKit.h> extern NSTimeInterval ADLivelyDefaultDuration; typedef NSTimeInterval (^ADLivelyTransform)(CALayer * layer, float speed); extern ADLivelyTransform ADLivelyTransformCurl; extern ADLivelyTransform ADLivelyTransformFade; extern ADLivelyTransform ADLivelyTransformFan; extern ADLivelyTransform ADLivelyTransformFlip; extern ADLivelyTransform ADLivelyTransformHelix; extern ADLivelyTransform ADLivelyTransformTilt; extern ADLivelyTransform ADLivelyTransformWave; extern ADLivelyTransform ADLivelyTransformGrow; @interface ADLivelyCollectionView : UICollectionView <UICollectionViewDelegate, UICollectionViewDataSource> { id <UICollectionViewDelegate> _preLivelyDelegate; id <UICollectionViewDataSource> _preLivelyDataSource; CGPoint _lastScrollPosition; CGPoint _currentScrollPosition; ADLivelyTransform _transformBlock; } - (CGPoint)scrollSpeed; - (void)setInitialCellTransformBlock:(ADLivelyTransform)block; @property (nonatomic, assign) CGFloat speedThreshold; @end
// // ADLivelyCollectionView.h // ADLivelyCollectionView // // Created by Romain Goyet on 18/04/12. // Copyright (c) 2012 Applidium. All rights reserved. // #import <UIKit/UIKit.h> extern NSTimeInterval ADLivelyDefaultDuration; typedef NSTimeInterval (^ADLivelyTransform)(CALayer * layer, float speed); extern ADLivelyTransform ADLivelyTransformCurl; extern ADLivelyTransform ADLivelyTransformFade; extern ADLivelyTransform ADLivelyTransformFan; extern ADLivelyTransform ADLivelyTransformFlip; extern ADLivelyTransform ADLivelyTransformHelix; extern ADLivelyTransform ADLivelyTransformTilt; extern ADLivelyTransform ADLivelyTransformWave; extern ADLivelyTransform ADLivelyTransformGrow; @interface ADLivelyCollectionView : UICollectionView <UICollectionViewDelegate, UICollectionViewDataSource> { id <UICollectionViewDelegate> _preLivelyDelegate; id <UICollectionViewDataSource> _preLivelyDataSource; CGPoint _lastScrollPosition; CGPoint _currentScrollPosition; ADLivelyTransform _transformBlock; } - (CGPoint)scrollSpeed; - (void)setInitialCellTransformBlock:(ADLivelyTransform)block; @property (nonatomic, assign) CGFloat speedThreshold; // optional, disables animations when exceeding this speed @end
Add comment for the speed threshold
Add comment for the speed threshold
C
bsd-3-clause
applidium/ADLivelyCollectionView
22eb291b9dc8943094e143a71c3eac237f4a54c2
command_mode.c
command_mode.c
#include "mode.h" #include <stdlib.h> #include <string.h> #include <termbox.h> #include "buf.h" #include "editor.h" static void command_mode_key_pressed(editor_t *editor, struct tb_event *ev) { char ch; switch (ev->key) { case TB_KEY_ESC: buf_printf(editor->status, ""); editor->mode = normal_mode(); return; case TB_KEY_BACKSPACE2: buf_delete(editor->status, editor->status->len - 1, 1); if (editor->status->len == 0) { editor->mode = normal_mode(); return; } return; case TB_KEY_ENTER: { char *command = strdup(editor->status->buf + 1); editor_execute_command(editor, command); free(command); editor->mode = normal_mode(); return; } case TB_KEY_SPACE: ch = ' '; break; default: ch = ev->ch; } char s[2] = {ch, '\0'}; buf_insert(editor->status, s, editor->status->len); } static editing_mode_t impl = {command_mode_key_pressed}; editing_mode_t *command_mode(void) { return &impl; }
#include "mode.h" #include <stdlib.h> #include <string.h> #include <termbox.h> #include "buf.h" #include "editor.h" // TODO(isbadawi): Command mode needs a cursor, but modes don't affect drawing. static void command_mode_key_pressed(editor_t *editor, struct tb_event *ev) { char ch; switch (ev->key) { case TB_KEY_ESC: buf_printf(editor->status, ""); editor->mode = normal_mode(); return; case TB_KEY_BACKSPACE2: buf_delete(editor->status, editor->status->len - 1, 1); if (editor->status->len == 0) { editor->mode = normal_mode(); return; } return; case TB_KEY_ENTER: { char *command = strdup(editor->status->buf + 1); editor_execute_command(editor, command); free(command); editor->mode = normal_mode(); return; } case TB_KEY_SPACE: ch = ' '; break; default: ch = ev->ch; } char s[2] = {ch, '\0'}; buf_insert(editor->status, s, editor->status->len); } static editing_mode_t impl = {command_mode_key_pressed}; editing_mode_t *command_mode(void) { return &impl; }
Add TODO re: command mode cursor.
Add TODO re: command mode cursor. This will also be an issue for visual mode.
C
mit
isbadawi/badavi
ae5e1b42c06cf04a2fcf6ec78c4b028aa69791eb
ReactiveCocoaFramework/ReactiveCocoa/UIActionSheet+RACSignalSupport.h
ReactiveCocoaFramework/ReactiveCocoa/UIActionSheet+RACSignalSupport.h
// // UIActionSheet+RACSignalSupport.h // ReactiveCocoa // // Created by Dave Lee on 2013-06-22. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // #import <UIKit/UIKit.h> @class RACDelegateProxy; @class RACSignal; @interface UIActionSheet (RACSignalSupport) // A delegate proxy which will be set as the receiver's delegate when any of the // methods in this category are used. @property (nonatomic, strong, readonly) RACDelegateProxy *rac_delegateProxy; // Creates a signal for button clicks on the receiver. // // When this method is invoked, the receiver's `delegate` will be set to // the `rac_delegateProxy` if it is not already. Any existing delegate will be // set as the proxy's `rac_proxiedDelegate`. // // Returns a signal which will send the index of the specific button clicked. // The signal will complete when the receiver is deallocated. - (RACSignal *)rac_buttonClickedSignal; @end
// // UIActionSheet+RACSignalSupport.h // ReactiveCocoa // // Created by Dave Lee on 2013-06-22. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // #import <UIKit/UIKit.h> @class RACDelegateProxy; @class RACSignal; @interface UIActionSheet (RACSignalSupport) // A delegate proxy which will be set as the receiver's delegate when any of the // methods in this category are used. @property (nonatomic, strong, readonly) RACDelegateProxy *rac_delegateProxy; // Creates a signal for button clicks on the receiver. // // When this method is invoked, the `rac_delegateProxy` will become the // receiver's delegate. Any previous delegate will become the -[RACDelegateProxy // rac_proxiedDelegate], so that it receives any messages that the proxy doesn't // know how to handle. Setting the receiver's `delegate` afterward is // considered undefined behavior. // // Returns a signal which will send the index of the specific button clicked. // The signal will complete when the receiver is deallocated. - (RACSignal *)rac_buttonClickedSignal; @end
Copy documentation wording from UITextView+RACSignalSupport.h
Copy documentation wording from UITextView+RACSignalSupport.h
C
mit
buildo/ReactiveCocoa,ioshger0125/ReactiveCocoa,yaoxiaoyong/ReactiveCocoa,fanghao085/ReactiveCocoa,cstars135/ReactiveCocoa,itschaitanya/ReactiveCocoa,longv2go/ReactiveCocoa,ReactiveCocoa/ReactiveSwift,paulyoung/ReactiveCocoa,itschaitanya/ReactiveCocoa,Ray0218/ReactiveCocoa,Carthage/ReactiveCocoa,qq644531343/ReactiveCocoa,add715/ReactiveCocoa,Juraldinio/ReactiveCocoa,zxq3220122/ReactiveCocoa,BlessNeo/ReactiveCocoa,alvinvarghese/ReactiveCocoa,yonekawa/ReactiveCocoa,walkingsmarts/ReactiveCocoa,yytong/ReactiveCocoa,isghe/ReactiveCocoa,zhiwen1024/ReactiveCocoa,jam891/ReactiveCocoa,monkeydbobo/ReactiveCocoa,ikesyo/ReactiveCocoa,CCOOOOLL/ReactiveCocoa,taylormoonxu/ReactiveCocoa,cnbin/ReactiveCocoa,llb1119/test,bensonday/ReactiveCocoa,sdhzwm/ReactiveCocoa,hj3938/ReactiveCocoa,brasbug/ReactiveCocoa,eyu1988/ReactiveCocoa,valleyman86/ReactiveCocoa,windgo/ReactiveCocoa,bscarano/ReactiveCocoa,towik/ReactiveCocoa,jsslai/ReactiveCocoa,shaohung001/ReactiveCocoa,BrooksWon/ReactiveCocoa,GuitarPlayer-Ma/ReactiveCocoa,sandyway/ReactiveCocoa,tzongw/ReactiveCocoa,huiping192/ReactiveCocoa,zzzworm/ReactiveCocoa,wpstarnice/ReactiveCocoa,hoanganh6491/ReactiveCocoa,Khan/ReactiveCocoa,taylormoonxu/ReactiveCocoa,fhchina/ReactiveCocoa,xulibao/ReactiveCocoa,libiao88/ReactiveCocoa,zzqiltw/ReactiveCocoa,AlanJN/ReactiveCocoa,juliangrosshauser/ReactiveCocoa,monkeydbobo/ReactiveCocoa,jackywpy/ReactiveCocoa,buildo/ReactiveCocoa,valleyman86/ReactiveCocoa,xumaolin/ReactiveCocoa,itschaitanya/ReactiveCocoa,mxxiv/ReactiveCocoa,victorlin/ReactiveCocoa,stupidfive/ReactiveCocoa,msdgwzhy6/ReactiveCocoa,bencochran/ReactiveCocoa,longv2go/ReactiveCocoa,OnTheWay1988/ReactiveCocoa,swizzlr/ReactiveCocoa,yoichitgy/ReactiveCocoa,Remitly/ReactiveCocoa,KJin99/ReactiveCocoa,zhigang1992/ReactiveCocoa,xulibao/ReactiveCocoa,hoanganh6491/ReactiveCocoa,windgo/ReactiveCocoa,tipbit/ReactiveCocoa,200895045/ReactiveCocoa,koamac/ReactiveCocoa,ddc391565320/ReactiveCocoa,cogddo/ReactiveCocoa,ztchena/ReactiveCocoa,tonyarnold/ReactiveCocoa,Ray0218/ReactiveCocoa,cnbin/ReactiveCocoa,Khan/ReactiveCocoa,almassapargali/ReactiveCocoa,hbucius/ReactiveCocoa,RuiAAPeres/ReactiveCocoa,Rupert-RR/ReactiveCocoa,WEIBP/ReactiveCocoa,nickcheng/ReactiveCocoa,yizzuide/ReactiveCocoa,tonyli508/ReactiveCocoa,kaylio/ReactiveCocoa,takeshineshiro/ReactiveCocoa,LHDsimon/ReactiveCocoa,esttorhe/ReactiveCocoa,chao95957/ReactiveCocoa,Pingco/ReactiveCocoa,zhukaixy/ReactiveCocoa,PSPDFKit-labs/ReactiveCocoa,rpowelll/ReactiveCocoa,pzw224/ReactiveCocoa,dz1111/ReactiveCocoa,luerhouhou/ReactiveCocoa,gabemdev/ReactiveCocoa,leichunfeng/ReactiveCocoa,victorlin/ReactiveCocoa,valleyman86/ReactiveCocoa,yizzuide/ReactiveCocoa,bensonday/ReactiveCocoa,koamac/ReactiveCocoa,howandhao/ReactiveCocoa,hoanganh6491/ReactiveCocoa,AndyZhaoHe/ReactiveCocoa,monkeydbobo/ReactiveCocoa,sujeking/ReactiveCocoa,kiurentu/ReactiveCocoa,SanChain/ReactiveCocoa,towik/ReactiveCocoa,ikesyo/ReactiveCocoa,eyu1988/ReactiveCocoa,beni55/ReactiveCocoa,icepy/ReactiveCocoa,dz1111/ReactiveCocoa,calebd/ReactiveCocoa,Remitly/ReactiveCocoa,KuPai32G/ReactiveCocoa,zzzworm/ReactiveCocoa,almassapargali/ReactiveCocoa,goodheart/ReactiveCocoa,GuitarPlayer-Ma/ReactiveCocoa,libiao88/ReactiveCocoa,AlanJN/ReactiveCocoa,longv2go/ReactiveCocoa,SanChain/ReactiveCocoa,wpstarnice/ReactiveCocoa,xiaobing2007/ReactiveCocoa,OneSmallTree/ReactiveCocoa,liufeigit/ReactiveCocoa,sugar2010/ReactiveCocoa,ddc391565320/ReactiveCocoa,on99/ReactiveCocoa,ioshger0125/ReactiveCocoa,zhaoguohui/ReactiveCocoa,Rupert-RR/ReactiveCocoa,terry408911/ReactiveCocoa,andersio/ReactiveCocoa,leelili/ReactiveCocoa,shaohung001/ReactiveCocoa,luerhouhou/ReactiveCocoa,clg0118/ReactiveCocoa,brasbug/ReactiveCocoa,natan/ReactiveCocoa,Eveian/ReactiveCocoa,tiger8888/ReactiveCocoa,hj3938/ReactiveCocoa,nickcheng/ReactiveCocoa,ailyanlu/ReactiveCocoa,tipbit/ReactiveCocoa,ztchena/ReactiveCocoa,huiping192/ReactiveCocoa,OneSmallTree/ReactiveCocoa,victorlin/ReactiveCocoa,isghe/ReactiveCocoa,alvinvarghese/ReactiveCocoa,yoichitgy/ReactiveCocoa,leichunfeng/ReactiveCocoa,ReactiveCocoa/ReactiveSwift,mattpetters/ReactiveCocoa,natestedman/ReactiveCocoa,WEIBP/ReactiveCocoa,CCOOOOLL/ReactiveCocoa,zxq3220122/ReactiveCocoa,xumaolin/ReactiveCocoa,zhenlove/ReactiveCocoa,KJin99/ReactiveCocoa,windgo/ReactiveCocoa,jeelun/ReactiveCocoa,liufeigit/ReactiveCocoa,eyu1988/ReactiveCocoa,DreamHill/ReactiveCocoa,LHDsimon/ReactiveCocoa,cstars135/ReactiveCocoa,SuPair/ReactiveCocoa,dullgrass/ReactiveCocoa,bencochran/ReactiveCocoa,FelixYin66/ReactiveCocoa,jrmiddle/ReactiveCocoa,stevielu/ReactiveCocoa,dullgrass/ReactiveCocoa,335g/ReactiveCocoa,tonyli508/ReactiveCocoa,tiger8888/ReactiveCocoa,xumaolin/ReactiveCocoa,PSPDFKit-labs/ReactiveCocoa,yoichitgy/ReactiveCocoa,zhukaixy/ReactiveCocoa,smilypeda/ReactiveCocoa,hbucius/ReactiveCocoa,SuPair/ReactiveCocoa,beni55/ReactiveCocoa,chao95957/ReactiveCocoa,yaoxiaoyong/ReactiveCocoa,ohwutup/ReactiveCocoa,tzongw/ReactiveCocoa,paulyoung/ReactiveCocoa,ailyanlu/ReactiveCocoa,PSPDFKit-labs/ReactiveCocoa,fanghao085/ReactiveCocoa,zhaoguohui/ReactiveCocoa,sandyway/ReactiveCocoa,andersio/ReactiveCocoa,zhenlove/ReactiveCocoa,JohnJin007/ReactiveCocoa,ailyanlu/ReactiveCocoa,llb1119/test,ShawnLeee/ReactiveCocoa,dachaoisme/ReactiveCocoa,esttorhe/ReactiveCocoa,tonyarnold/ReactiveCocoa,WEIBP/ReactiveCocoa,rpowelll/ReactiveCocoa,mattpetters/ReactiveCocoa,j364960953/ReactiveCocoa,j364960953/ReactiveCocoa,nikita-leonov/ReactiveCocoa,wangqi211/ReactiveCocoa,Juraldinio/ReactiveCocoa,tonyli508/ReactiveCocoa,swizzlr/ReactiveCocoa,kevin-zqw/ReactiveCocoa,mtxs007/ReactiveCocoa,JackLian/ReactiveCocoa,hj3938/ReactiveCocoa,leichunfeng/ReactiveCocoa,gengjf/ReactiveCocoa,loupman/ReactiveCocoa,lixar/ReactiveCocoa,GuitarPlayer-Ma/ReactiveCocoa,add715/ReactiveCocoa,wpstarnice/ReactiveCocoa,pzw224/ReactiveCocoa,Adlai-Holler/ReactiveCocoa,JohnJin007/ReactiveCocoa,yytong/ReactiveCocoa,Carthage/ReactiveCocoa,luerhouhou/ReactiveCocoa,icepy/ReactiveCocoa,vincentiss/ReactiveCocoa,ShawnLeee/ReactiveCocoa,FelixYin66/ReactiveCocoa,yaoxiaoyong/ReactiveCocoa,dz1111/ReactiveCocoa,vincentiss/ReactiveCocoa,RuiAAPeres/ReactiveCocoa,ddc391565320/ReactiveCocoa,huiping192/ReactiveCocoa,goodheart/ReactiveCocoa,brightcove/ReactiveCocoa,stevielu/ReactiveCocoa,nickcheng/ReactiveCocoa,xulibao/ReactiveCocoa,Liquidsoul/ReactiveCocoa,Ricowere/ReactiveCocoa,yangshengchaoios/ReactiveCocoa,sugar2010/ReactiveCocoa,leelili/ReactiveCocoa,xiaoliyang/ReactiveCocoa,ericzhou2008/ReactiveCocoa,Farteen/ReactiveCocoa,terry408911/ReactiveCocoa,Ethan89/ReactiveCocoa,hilllinux/ReactiveCocoa,fhchina/ReactiveCocoa,jaylib/ReactiveCocoa,stupidfive/ReactiveCocoa,yangyangluoluo/ReactiveCocoa,xiaoliyang/ReactiveCocoa,loupman/ReactiveCocoa,natestedman/ReactiveCocoa,yangyangluoluo/ReactiveCocoa,DreamHill/ReactiveCocoa,rpowelll/ReactiveCocoa,ztchena/ReactiveCocoa,zhigang1992/ReactiveCocoa,Liquidsoul/ReactiveCocoa,Pingco/ReactiveCocoa,mtxs007/ReactiveCocoa,zhenlove/ReactiveCocoa,BlessNeo/ReactiveCocoa,ShawnLeee/ReactiveCocoa,Rupert-RR/ReactiveCocoa,dullgrass/ReactiveCocoa,DongDongDongDong/ReactiveCocoa,alvinvarghese/ReactiveCocoa,zhiwen1024/ReactiveCocoa,kiurentu/ReactiveCocoa,howandhao/ReactiveCocoa,dskatz22/ReactiveCocoa,brightcove/ReactiveCocoa,ericzhou2008/ReactiveCocoa,towik/ReactiveCocoa,JohnJin007/ReactiveCocoa,Ray0218/ReactiveCocoa,OnTheWay1988/ReactiveCocoa,zhiwen1024/ReactiveCocoa,Remitly/ReactiveCocoa,sugar2010/ReactiveCocoa,bencochran/ReactiveCocoa,sandyway/ReactiveCocoa,OneSmallTree/ReactiveCocoa,richeterre/ReactiveCocoa,kiurentu/ReactiveCocoa,CQXfly/ReactiveCocoa,hilllinux/ReactiveCocoa,SuPair/ReactiveCocoa,Eveian/ReactiveCocoa,ceekayel/ReactiveCocoa,eliperkins/ReactiveCocoa,llb1119/test,walkingsmarts/ReactiveCocoa,Ethan89/ReactiveCocoa,zzzworm/ReactiveCocoa,OnTheWay1988/ReactiveCocoa,terry408911/ReactiveCocoa,KuPai32G/ReactiveCocoa,howandhao/ReactiveCocoa,jeelun/ReactiveCocoa,goodheart/ReactiveCocoa,JackLian/ReactiveCocoa,imkerberos/ReactiveCocoa,kevin-zqw/ReactiveCocoa,j364960953/ReactiveCocoa,shaohung001/ReactiveCocoa,yytong/ReactiveCocoa,Adlai-Holler/ReactiveCocoa,andersio/ReactiveCocoa,jsslai/ReactiveCocoa,mxxiv/ReactiveCocoa,Adlai-Holler/ReactiveCocoa,kaylio/ReactiveCocoa,cogddo/ReactiveCocoa,jsslai/ReactiveCocoa,chieryw/ReactiveCocoa,200895045/ReactiveCocoa,wangqi211/ReactiveCocoa,Pikdays/ReactiveCocoa,sdhzwm/ReactiveCocoa,libiao88/ReactiveCocoa,Carthage/ReactiveCocoa,ioshger0125/ReactiveCocoa,Juraldinio/ReactiveCocoa,leelili/ReactiveCocoa,zxq3220122/ReactiveCocoa,CQXfly/ReactiveCocoa,chao95957/ReactiveCocoa,DreamHill/ReactiveCocoa,clg0118/ReactiveCocoa,AlanJN/ReactiveCocoa,dachaoisme/ReactiveCocoa,beni55/ReactiveCocoa,KJin99/ReactiveCocoa,almassapargali/ReactiveCocoa,sdhzwm/ReactiveCocoa,FelixYin66/ReactiveCocoa,clg0118/ReactiveCocoa,jrmiddle/ReactiveCocoa,calebd/ReactiveCocoa,tornade0913/ReactiveCocoa,jianwoo/ReactiveCocoa,Farteen/ReactiveCocoa,mattpetters/ReactiveCocoa,tornade0913/ReactiveCocoa,juliangrosshauser/ReactiveCocoa,AllanChen/ReactiveCocoa,CCOOOOLL/ReactiveCocoa,smilypeda/ReactiveCocoa,SmartEncounter/ReactiveCocoa,335g/ReactiveCocoa,taylormoonxu/ReactiveCocoa,jam891/ReactiveCocoa,zzqiltw/ReactiveCocoa,yangyangluoluo/ReactiveCocoa,tiger8888/ReactiveCocoa,zhukaixy/ReactiveCocoa,Ricowere/ReactiveCocoa,sujeking/ReactiveCocoa,ceekayel/ReactiveCocoa,esttorhe/ReactiveCocoa,tzongw/ReactiveCocoa,qq644531343/ReactiveCocoa,xiaoliyang/ReactiveCocoa,esttorhe/ReactiveCocoa,hbucius/ReactiveCocoa,lixar/ReactiveCocoa,on99/ReactiveCocoa,vincentiss/ReactiveCocoa,shuxiashusheng/ReactiveCocoa,KuPai32G/ReactiveCocoa,Ethan89/ReactiveCocoa,pzw224/ReactiveCocoa,yangshengchaoios/ReactiveCocoa,SmartEncounter/ReactiveCocoa,emodeqidao/ReactiveCocoa,koamac/ReactiveCocoa,natan/ReactiveCocoa,BrooksWon/ReactiveCocoa,DongDongDongDong/ReactiveCocoa,cstars135/ReactiveCocoa,chieryw/ReactiveCocoa,335g/ReactiveCocoa,jrmiddle/ReactiveCocoa,takeshineshiro/ReactiveCocoa,ceekayel/ReactiveCocoa,yizzuide/ReactiveCocoa,emodeqidao/ReactiveCocoa,brasbug/ReactiveCocoa,imkerberos/ReactiveCocoa,dskatz22/ReactiveCocoa,fanghao085/ReactiveCocoa,on99/ReactiveCocoa,liufeigit/ReactiveCocoa,qq644531343/ReactiveCocoa,AndyZhaoHe/ReactiveCocoa,Ricowere/ReactiveCocoa,BrooksWon/ReactiveCocoa,shuxiashusheng/ReactiveCocoa,bensonday/ReactiveCocoa,mtxs007/ReactiveCocoa,eliperkins/ReactiveCocoa,ReactiveCocoa/ReactiveSwift,jaylib/ReactiveCocoa,zzqiltw/ReactiveCocoa,huiping192/ReactiveCocoa,gengjf/ReactiveCocoa,shuxiashusheng/ReactiveCocoa,yonekawa/ReactiveCocoa,mxxiv/ReactiveCocoa,jaylib/ReactiveCocoa,imkerberos/ReactiveCocoa,brightcove/ReactiveCocoa,hilllinux/ReactiveCocoa,natan/ReactiveCocoa,cnbin/ReactiveCocoa,zhaoguohui/ReactiveCocoa,Khan/ReactiveCocoa,loupman/ReactiveCocoa,paulyoung/ReactiveCocoa,richeterre/ReactiveCocoa,200895045/ReactiveCocoa,nikita-leonov/ReactiveCocoa,bscarano/ReactiveCocoa,BlessNeo/ReactiveCocoa,juliangrosshauser/ReactiveCocoa,RuiAAPeres/ReactiveCocoa,msdgwzhy6/ReactiveCocoa,nikita-leonov/ReactiveCocoa,isghe/ReactiveCocoa,jackywpy/ReactiveCocoa,DongDongDongDong/ReactiveCocoa,icepy/ReactiveCocoa,takeshineshiro/ReactiveCocoa,yonekawa/ReactiveCocoa,Farteen/ReactiveCocoa,kevin-zqw/ReactiveCocoa,jianwoo/ReactiveCocoa,AndyZhaoHe/ReactiveCocoa,add715/ReactiveCocoa,tonyarnold/ReactiveCocoa,Liquidsoul/ReactiveCocoa,dachaoisme/ReactiveCocoa,SanChain/ReactiveCocoa,zhigang1992/ReactiveCocoa,msdgwzhy6/ReactiveCocoa,Ricowere/ReactiveCocoa,richeterre/ReactiveCocoa,bscarano/ReactiveCocoa,Pingco/ReactiveCocoa,Pikdays/ReactiveCocoa,calebd/ReactiveCocoa,nickcheng/ReactiveCocoa,chieryw/ReactiveCocoa,xiaobing2007/ReactiveCocoa,fhchina/ReactiveCocoa,yangshengchaoios/ReactiveCocoa,kaylio/ReactiveCocoa,cogddo/ReactiveCocoa,eliperkins/ReactiveCocoa,stevielu/ReactiveCocoa,jackywpy/ReactiveCocoa,ohwutup/ReactiveCocoa,sujeking/ReactiveCocoa,jam891/ReactiveCocoa,buildo/ReactiveCocoa,jeelun/ReactiveCocoa,CQXfly/ReactiveCocoa,dskatz22/ReactiveCocoa,gengjf/ReactiveCocoa,smilypeda/ReactiveCocoa,LHDsimon/ReactiveCocoa,tornade0913/ReactiveCocoa,ericzhou2008/ReactiveCocoa,natestedman/ReactiveCocoa,walkingsmarts/ReactiveCocoa,wangqi211/ReactiveCocoa,AllanChen/ReactiveCocoa,JackLian/ReactiveCocoa,Eveian/ReactiveCocoa,stupidfive/ReactiveCocoa,gabemdev/ReactiveCocoa,emodeqidao/ReactiveCocoa,ohwutup/ReactiveCocoa,Pikdays/ReactiveCocoa,lixar/ReactiveCocoa,jianwoo/ReactiveCocoa,xiaobing2007/ReactiveCocoa,jaylib/ReactiveCocoa
9e903e78de2ca4a4b4aaa80b2dc6320e581c87da
c-in-mips.c
c-in-mips.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <math.h> static int RegisterFile[32] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int main() { int data_memory[1024]; char string_memeory[2014]; }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <math.h> static int RegisterFile[32] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int main() { int data_memory[1024]; char* string_memory[2014]; char* instructions[100]; }
Fix typos, add instruction memory
Fix typos, add instruction memory
C
apache-2.0
jacobbieker/MIPS-In-C
c13048b862e88494460d6e70c5ce83f99f3393a8
examples/locks.c
examples/locks.c
#include <stddef.h> #include "atomic.h" #include "rmc.h" /// // Needs to live somewhere else at some point // Argh, what do we name these. #include "stdatomic.h" #define atomic_fixup(e) ((_Atomic(__typeof__(*e))*)(e)) #define rmc_compare_exchange_strong(object, expected, desired) \ atomic_compare_exchange_strong_explicit(atomic_fixup(object), expected, \ desired, memory_order_relaxed, memory_order_relaxed) #define rmc_compare_exchange_weak(object, expected, desired) \ atomic_compare_exchange_weak_explicit(atomic_fixup(object), expected, \ desired, memory_order_relaxed, memory_order_relaxed) #define rmc_exchange(object, desired) \ atomic_exchange_explicit(atomic_fixup(object), desired, memory_order_relaxed) #define rmc_fetch_add(object, operand) \ atomic_fetch_add_explicit(atomic_fixup(object), operand, memory_order_relaxed) #define rmc_fetch_and(object, operand) \ atomic_fetch_and_explicit(atomic_fixup(object), operand, memory_order_relaxed) #define rmc_fetch_or(object, operand) \ atomic_fetch_or_explicit(atomic_fixup(object), operand, memory_order_relaxed) #define rmc_fetch_sub(object, operand) \ atomic_fetch_sub_explicit(atomic_fixup(object), operand, memory_order_relaxed) #define rmc_fetch_xor(object, operand) \ atomic_fetch_xor_explicit(atomic_fixup(object), operand, memory_order_relaxed) /// typedef struct mutex_t { int locked; } mutex_t; void mutex_lock_bad(mutex_t *lock) { XEDGE(lock, post); int expected; do { expected = 0; } while (!L(lock, rmc_compare_exchange_weak(&lock->locked, &expected, 1))); } void mutex_lock(mutex_t *lock) { XEDGE(lock, loop_out); XEDGE(loop_out, post); int expected; do { expected = 0; } while (L(lock, rmc_compare_exchange_weak(&lock->locked, &expected, 1)) == 0); L(loop_out, 0); } void mutex_unlock(mutex_t *lock) { VEDGE(pre, unlock); L(unlock, lock->locked = 0); } int nus(int *x) { return rmc_fetch_and(x, 1337); }
Add some tests with RMWs
Add some tests with RMWs
C
mit
msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler,msullivan/rmc-compiler
8800559e793472408e0d44efeb4642bf3808f13e
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 108 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 109 #endif
Update Skia milestone to 109
Update Skia milestone to 109 Change-Id: I6acfef789b38f71183304cc3741c119265561b3c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/591477 Reviewed-by: Rakshit Sharma <[email protected]> Owners-Override: Kevin Lubick <[email protected]> Auto-Submit: Rakshit Sharma <[email protected]> Reviewed-by: Kevin Lubick <[email protected]> Commit-Queue: Kevin Lubick <[email protected]>
C
bsd-3-clause
google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia
80475026890a36dea4915fc9261a879ed24cca99
Wangscape/codecs/TileLocationCodec.h
Wangscape/codecs/TileLocationCodec.h
#pragma once #include <spotify/json.hpp> #include "TileLocation.h" using namespace spotify::json::codec; namespace spotify { namespace json { template<> struct default_codec_t<TileLocation> { static object_t<TileLocation> codec() { auto codec = object<TileLocation>(); codec.required("filename", &TileLocation::filename); codec.required("x", &TileLocation::x); codec.required("y", &TileLocation::y); return codec; } }; } }
Add a codec for TileLocation
Add a codec for TileLocation
C
mit
serin-delaunay/Wangscape,serin-delaunay/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape
5cec34cba823feb1e1b47d95de433f1ac96ea873
is/ac_tlm_bus/ac_tlm_bus.h
is/ac_tlm_bus/ac_tlm_bus.h
#ifndef AC_TLM_BUS_H_ #define AC_TLM_BUS_H_ #include <systemc> #include "ac_tlm_protocol.H" #include "ac_tlm_port.H" #include "ac_memport.H" // using statements using tlm::tlm_transport_if; //#define DEBUG /// Namespace to isolate bus from ArchC namespace user { /// A TLM bus class ac_tlm_bus : public sc_module, public ac_tlm_transport_if // Using ArchC TLM protocol { public: // Memory communication port ac_tlm_port DM_port; /// Exposed port with ArchC interface sc_export< ac_tlm_transport_if > target_export[4]; /** * Implementation of TLM transport method that * handle packets of the protocol doing apropriate actions. * This method must be implemented (required by SystemC TLM). * @param request is a received request packet * @return A response packet to be send */ ac_tlm_rsp transport( const ac_tlm_req &request ) { return DM_port->transport(request); } /** * Default constructor. */ ac_tlm_bus(sc_module_name module_name); /** * Default destructor. */ ~ac_tlm_bus(); }; }; #endif //AC_TLM_BUS_H_
#ifndef AC_TLM_BUS_H_ #define AC_TLM_BUS_H_ #include <systemc> #include "ac_tlm_protocol.H" #include "ac_tlm_port.H" #include "ac_memport.H" // using statements using tlm::tlm_transport_if; //#define DEBUG /// Namespace to isolate bus from ArchC namespace user { /// A TLM bus class ac_tlm_bus : public sc_module, public ac_tlm_transport_if // Using ArchC TLM protocol { public: // Memory communication port ac_tlm_port DM_port; /// Exposed port with ArchC interface sc_export< ac_tlm_transport_if > target_export[8]; /** * Implementation of TLM transport method that * handle packets of the protocol doing apropriate actions. * This method must be implemented (required by SystemC TLM). * @param request is a received request packet * @return A response packet to be send */ ac_tlm_rsp transport( const ac_tlm_req &request ) { return DM_port->transport(request); } /** * Default constructor. */ ac_tlm_bus(sc_module_name module_name); /** * Default destructor. */ ~ac_tlm_bus(); }; }; #endif //AC_TLM_BUS_H_
Make room for 8 processors in the bus.
Make room for 8 processors in the bus.
C
lgpl-2.1
eggpi/mc723-p3,guilherme-pg/mc723-p3,guilherme-pg/mc723-p3,eggpi/mc723-p3,eggpi/mc723-p3,guilherme-pg/mc723-p3,guilherme-pg/mc723-p3,eggpi/mc723-p3
e40600458fdf7a84940f1de3103886173646b19b
lib/libncurses/lib_insdel.c
lib/libncurses/lib_insdel.c
/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * * details. If they are missing then this copy is in violation of * * the copyright conditions. */ /* ** lib_insdel.c ** ** The routine winsdel(win, n). ** positive n insert n lines above current line ** negative n delete n lines starting from current line ** */ #include <stdlib.h> #include "curses.priv.h" #include "terminfo.h" int winsdelln(WINDOW *win, int n) { int ret, sscroll, stop, sbot; T(("winsdel(%x,%d) called", win, n)); if (n == 0) return OK; if (n < 0 && win->_cury - n >= win->_maxy) /* request to delete too many lines */ /* should we truncate to an appropriate number? */ return ERR; sscroll = win->_scroll; stop = win->_regtop; sbot = win->_regbottom; win->_scroll = TRUE; win->_regtop = win->_cury; if (win->_regtop > win->_regbottom) win->_regbottom = win->_maxy; ret = wscrl(win, -n); win->_scroll = sscroll; win->_regtop = stop; win->_regbottom = sbot; return ret; }
/* This work is copyrighted. See COPYRIGHT.OLD & COPYRIGHT.NEW for * * details. If they are missing then this copy is in violation of * * the copyright conditions. */ /* ** lib_insdel.c ** ** The routine winsdel(win, n). ** positive n insert n lines above current line ** negative n delete n lines starting from current line ** */ #include <stdlib.h> #include "curses.priv.h" #include "terminfo.h" int winsdelln(WINDOW *win, int n) { int ret, sscroll, stop, sbot; T(("winsdel(%x,%d) called", win, n)); if (n == 0) return OK; if (n == -1 && win->_cury == win->_maxy) return wclrtoeol(win); if (n < 0 && win->_cury - n > win->_maxy) /* request to delete too many lines */ /* should we truncate to an appropriate number? */ return ERR; sscroll = win->_scroll; stop = win->_regtop; sbot = win->_regbottom; win->_scroll = TRUE; win->_regtop = win->_cury; if (win->_regtop > win->_regbottom) win->_regbottom = win->_maxy; ret = wscrl(win, -n); win->_scroll = sscroll; win->_regtop = stop; win->_regbottom = sbot; return ret; }
Handle the condition where BS is typed while the cursor is at the first position on either of the last two lines of the screen. Ie. append contents of current line to the previous line and scroll the next line's contents up.
Handle the condition where BS is typed while the cursor is at the first position on either of the last two lines of the screen. Ie. append contents of current line to the previous line and scroll the next line's contents up. PR: 5392 Submitted by: Kouichi Hirabayashi <[email protected]>
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
217625d26001121e40c1e309321d2b9a104623f6
wisp.c
wisp.c
#include <stdio.h> #include "common.h" #include "wisp.h" #include "lisp.h" /* parser crap */ extern FILE *yyin; int yyparse (); void parser_init (); extern int interactive; extern char *prompt; /* Initilize all the systems. */ void init () { /* These *must* be called in this order. */ object_init (); symtab_init (); cons_init (); eval_init (); lisp_init (); parser_init (); } int main (int argc, char **argv) { (void) argc; (void) argv; init (); /* Load core lisp code. */ interactive = 0; yyin = fopen ("core.wisp", "r"); if (yyin == NULL) { fprintf (stderr, "error: could not load core lisp.\n"); exit (EXIT_FAILURE); } yyparse (); fclose (yyin); /* yy_flush_buffer(); */ /* Run interaction. */ interactive = 1; printf ("Happy hacking!\n%s", prompt); yyin = stdin; yyparse (); }
#include <stdio.h> #include "common.h" #include "wisp.h" #include "lisp.h" /* parser crap */ extern FILE *yyin; int yyparse (); void parser_init (); extern int interactive; extern char *prompt; /* Initilize all the systems. */ void init () { /* These *must* be called in this order. */ object_init (); symtab_init (); cons_init (); eval_init (); lisp_init (); parser_init (); } int main (int argc, char **argv) { (void) argc; (void) argv; init (); /* Load core lisp code. */ interactive = 0; yyin = fopen ("core.wisp", "r"); if (yyin == NULL) { fprintf (stderr, "error: could not load core lisp.\n"); exit (EXIT_FAILURE); } yyparse (); fclose (yyin); /* yy_flush_buffer(); */ /* Run interaction. */ interactive = 1; printf ("Happy hacking!\n%s", prompt); yyin = stdin; yyparse (); printf ("\n"); }
Print newline on clean exit.
Print newline on clean exit.
C
unlicense
skeeto/wisp,skeeto/wisp
3eb22eb7df20a7254a0b70512ca026a440152a86
inline_dbg_lbl.c
inline_dbg_lbl.c
// ucc -g tim.c _Noreturn void abort() { __builtin_unreachable(); } void realloc() { int local = 5; abort(); }
Debug label inline function bug
Debug label inline function bug
C
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
dbf67e0819451323569fbdfc4280ad4cb2310d39
bugs/cpp/strip_comment.c
bugs/cpp/strip_comment.c
#define typename(x) _Generic((x), \ _Bool: "_BoolÓ, unsigned char: "unsigned charÓ, \ char: "char", signed char: "signed char", \ void *: "pointer to voidÓ, int *: "pointer to int", \ default: "other")
#define typename(x) _Generic((x), \ _Bool: "_Bool", unsigned char: "unsigned char", \ char: "char", signed char: "signed char", \ void *: "pointer to void", int *: "pointer to int", \ default: "other")
Remove unicode from cpp bug example
Remove unicode from cpp bug example
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
8e237cddafb82de65bdca14de6a4b05d3f51b2ea
goontools.c
goontools.c
#include "goontools.h" void usage(char* prog) { fprintf(stderr, "\n"); fprintf(stderr, "Usage: %s <subcommand> <subcommand arguments>\n", prog); fprintf(stderr, "\n"); fprintf(stderr, "subcommands:\n"); fprintf(stderr, " index index file\n"); fprintf(stderr, " sort sort file\n"); fprintf(stderr, " view view/slice file\n"); fprintf(stderr, "\n"); } int dispatch(int argc, char *argv[]) { char *subcommands[] = { "index", "view", "sort", NULL // sentinel }; Subcommand dispatch[] = { &goonindex, &goonview, &goonsort }; char **s; for (s = subcommands; *s != NULL; s += 1) { if (strcmp(argv[1], *s) == 0) { break; } } if (*s == NULL) { usage(argv[0]); return -1; } return dispatch[s-subcommands](argc-2, argv+2); } int main(int argc, char *argv[]) { if (argc == 1) { usage(argv[0]); return EXIT_FAILURE; } if (dispatch(argc, argv) != 0) { return EXIT_FAILURE; } return EXIT_SUCCESS; }
#include "goontools.h" void usage(char* prog) { fprintf(stderr, "\n"); fprintf(stderr, "Usage: %s <subcommand> <subcommand arguments>\n", prog); fprintf(stderr, "\n"); fprintf(stderr, "subcommands:\n"); fprintf(stderr, " index index file\n"); fprintf(stderr, " sort sort file\n"); fprintf(stderr, " view view/slice file\n"); fprintf(stderr, "\n"); } int dispatch(int argc, char *argv[]) { char *subcommands[] = { "index", "view", "sort", NULL // sentinel }; Subcommand dispatch[] = { &goonindex, &goonview, &goonsort }; char **s; for (s = subcommands; *s != NULL; s += 1) { if (strcmp(argv[1], *s) == 0) { break; } } if (*s == NULL) { usage(argv[0]); return -1; } return dispatch[s-subcommands](argc-1, argv+1); } int main(int argc, char *argv[]) { if (argc == 1) { usage(argv[0]); return EXIT_FAILURE; } if (dispatch(argc, argv) != 0) { return EXIT_FAILURE; } return EXIT_SUCCESS; }
Make subcommands' argc/argv compatible with getopt
Make subcommands' argc/argv compatible with getopt
C
mit
mhyfritz/goontools,mhyfritz/goontools,mhyfritz/goontools
d1940709771ccf2835a019fc095880e3192eae93
inc/time_hao.h
inc/time_hao.h
#ifndef TIME_HAO #define TIME_HAO #include <time.h> class Timer_hao { public: double seconds; int timing_flag; time_t timerinit,timerend; Timer_hao(); Timer_hao(double); Timer_hao(const Timer_hao& ); ~Timer_hao(); Timer_hao& operator = (const Timer_hao&); void init(); void end(); void print_init() const; void print_end() const; void print_accumulation() const; }; struct tm second_to_tm(double); #endif
#ifndef TIME_HAO_H #define TIME_HAO_H #include <time.h> class Timer_hao { public: double seconds; int timing_flag; time_t timerinit,timerend; Timer_hao(); Timer_hao(double); Timer_hao(const Timer_hao& ); ~Timer_hao(); Timer_hao& operator = (const Timer_hao&); void init(); void end(); void print_init() const; void print_end() const; void print_accumulation() const; }; struct tm second_to_tm(double); #endif
Set the header protection to end with _H.
Set the header protection to end with _H.
C
mit
hshi/time_lib_hao
fa64def4cb805afb0cc8d966dab534e9137f3c66
src/Settings.h
src/Settings.h
// This program is free software licenced under MIT Licence. You can // find a copy of this licence in LICENCE.txt in the top directory of // source code. // #ifndef SETTINGS_H_INCLUDED #define SETTINGS_H_INCLUDED #include <vector> #include <tuple> /** * This file contains gereral configuration and thing whoch should be in the * global scope */ using AdjencyList = std::vector<std::vector<int>>; using Placements = std::vector<std::pair<int, int>>; using Movements = std::vector<std::tuple<int, int, int>>; #define NEUTRAL_ARMIES 2 #define WASTELAND_ARMIES 10 enum class Player { ME, ENEMY, NEUTRAL }; enum class Request { NONE, PICK_STARTING_REGION, PLACE_ARMIES, ATTACK_TRANSFER }; #endif // MAIN_H_INCLUDED
// This program is free software licenced under MIT Licence. You can // find a copy of this licence in LICENCE.txt in the top directory of // source code. // #ifndef SETTINGS_H_INCLUDED #define SETTINGS_H_INCLUDED #include <vector> #include <tuple> /** * This file contains gereral configuration and thing whoch should be in the * global scope */ using AdjencyList = std::vector<std::vector<int>>; using Placements = std::vector<std::pair<int, int>>; using Movements = std::vector<std::tuple<int, int, int>>; #define NEUTRAL_ARMIES 2 #define WASTELAND_ARMIES 6 enum class Player { ME, ENEMY, NEUTRAL }; enum class Request { NONE, PICK_STARTING_REGION, PLACE_ARMIES, ATTACK_TRANSFER }; #endif // MAIN_H_INCLUDED
Update number of armies on wastelands
Update number of armies on wastelands
C
mit
calincru/Warlight-AI-Challenge-2-Bot,calincru/Warlight-AI-Challenge-2-Bot
194e314afe721d748735114c68b9a723a8f74b05
Riot/SupportingFiles/Riot-Bridging-Header.h
Riot/SupportingFiles/Riot-Bridging-Header.h
// // Use this file to import your target's public headers that you would like to expose to Swift. // @import MatrixSDK; @import MatrixKit; #import "WebViewViewController.h" #import "RiotNavigationController.h" #import "ThemeService.h" #import "TableViewCellWithCheckBoxAndLabel.h" #import "RecentsDataSource.h" #import "AvatarGenerator.h" #import "EncryptionInfoView.h" #import "EventFormatter.h" #import "MediaPickerViewController.h" #import "AppDelegate.h"
// // Use this file to import your target's public headers that you would like to expose to Swift. // @import MatrixSDK; @import MatrixKit; #import "WebViewViewController.h" #import "RiotNavigationController.h" #import "ThemeService.h" #import "TableViewCellWithCheckBoxAndLabel.h" #import "RecentsDataSource.h" #import "AvatarGenerator.h" #import "EncryptionInfoView.h" #import "EventFormatter.h" #import "MediaPickerViewController.h" #import "AppDelegate.h" #import "RoomBubbleCellData.h" #import "MXKRoomBubbleTableViewCell+Riot.h"
Add RoomBubbleCellData.h and MXKRoomBubbleTableViewCell+Riot.h to Objective-C bridging header.
Add RoomBubbleCellData.h and MXKRoomBubbleTableViewCell+Riot.h to Objective-C bridging header.
C
apache-2.0
vector-im/riot-ios,vector-im/riot-ios,vector-im/riot-ios,vector-im/riot-ios,vector-im/riot-ios,vector-im/vector-ios,vector-im/vector-ios,vector-im/riot-ios,vector-im/vector-ios
2af33bb34a78b1ecd91cc9f9d92351e7a762530b
src/cilkplus.h
src/cilkplus.h
#ifndef CILKPLUS_H #define CILKPLUS_H #include <cilk/cilk.h> #define fibril #define fibril_t __attribute__((unused)) int #define fibril_init(fp) #define fibril_join(fp) cilk_sync #define fibril_fork_nrt(fp, fn, ag) cilk_spawn fn ag #define fibril_fork_wrt(fp, rt, fn, ag) rt = cilk_spawn fn ag #define fibril_rt_init(n) #define fibril_rt_exit() #define fibril_rt_nprocs(n) \ (n > 0 ? __cilkrts_set_param("nworkers", #n) : __cilkrts_get_nworkers()) #endif /* end of include guard: CILKPLUS_H */
#ifndef CILKPLUS_H #define CILKPLUS_H #include <cilk/cilk.h> #define fibril #define fibril_t __attribute__((unused)) int #define fibril_init(fp) #define fibril_join(fp) cilk_sync #define fibril_fork_nrt(fp, fn, ag) cilk_spawn fn ag #define fibril_fork_wrt(fp, rt, fn, ag) rt = cilk_spawn fn ag #define fibril_rt_init(n) (__cilkrts_set_param("stack size", "0x800000")) #define fibril_rt_exit() #define fibril_rt_nprocs(n) \ (n > 0 ? __cilkrts_set_param("nworkers", #n) : __cilkrts_get_nworkers()) #endif /* end of include guard: CILKPLUS_H */
Use 8MB as the default stack size in CilkPlus.
Use 8MB as the default stack size in CilkPlus.
C
mit
chaoran/fibril,chaoran/fibril,chaoran/fibril
80dadf74982bc78acb1fedd5e9e65f754d6bbee8
native/spinner_with_stacks/program.c
native/spinner_with_stacks/program.c
#include <stdio.h> void SpinYetAgain() { volatile unsigned int count = 0; for(int i=0; i<1000; i++) { count++; } } void SpinSomeMore() { volatile unsigned int count = 0; for(int i=0; i<1000; i++) { count++; } SpinYetAgain(); } void Spin() { volatile unsigned int count = 0; for(int i=0; i<1000; i++) { count++; } SpinSomeMore(); } int main(int argc, char* argv[]) { while(1) { Spin(); } }
#include <stdio.h> void SpinYetAgain() { volatile unsigned int count = 0; int i; for(i=0; i<1000; i++) { count++; } } void SpinSomeMore() { volatile unsigned int count = 0; int i; for(i=0; i<1000; i++) { count++; } SpinYetAgain(); } void Spin() { volatile unsigned int count = 0; int i; for(i=0; i<1000; i++) { count++; } SpinSomeMore(); } int main(int argc, char* argv[]) { while(1) { Spin(); } }
Fix C declaration errors on ARM.
Fix C declaration errors on ARM.
C
mit
brianrob/coretests,brianrob/coretests
cee852ab5abc167b1996043f2398e47902ca7068
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
3efdee2c137bfa5a8b937fea6616fd3c57eede6a
src/kvazaar_internal.h
src/kvazaar_internal.h
#ifndef KVAZAAR_INTERNAL_H_ #define KVAZAAR_INTERNAL_H_ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * * Copyright (C) 2013-2015 Tampere University of Technology and others (see * COPYING file). * * Kvazaar is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the * Free Software Foundation; either version 2.1 of the License, or (at your * option) any later version. * * Kvazaar 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 General Public License along * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. ****************************************************************************/ #include "kvazaar.h" // Forward declarations. typedef struct encoder_state_t encoder_state_t; typedef struct encoder_control_t encoder_control_t; typedef struct kvz_encoder { encoder_control_t* control; encoder_state_t* states; unsigned num_encoder_states; unsigned cur_state_num; unsigned frames_started; unsigned frames_done; size_t bitstream_length; } kvz_encoder; #endif // KVAZAAR_INTERNAL_H_
#ifndef KVAZAAR_INTERNAL_H_ #define KVAZAAR_INTERNAL_H_ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * * Copyright (C) 2013-2015 Tampere University of Technology and others (see * COPYING file). * * Kvazaar is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the * Free Software Foundation; either version 2.1 of the License, or (at your * option) any later version. * * Kvazaar 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 General Public License along * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. ****************************************************************************/ #include "kvazaar.h" // Forward declarations. struct encoder_state_t; struct encoder_control_t; struct kvz_encoder { struct encoder_control_t* control; struct encoder_state_t* states; unsigned num_encoder_states; unsigned cur_state_num; unsigned frames_started; unsigned frames_done; size_t bitstream_length; }; #endif // KVAZAAR_INTERNAL_H_
Fix compilation warnings when using clang.
Fix compilation warnings when using clang. Removes typedef redefinitions in kvazaar_internal.h.
C
bsd-3-clause
lu-zero/kvazaar,ultravideo/kvazaar,ultravideo/kvazaar,lu-zero/kvazaar,lu-zero/kvazaar,ultravideo/kvazaar,ultravideo/kvazaar,ultravideo/kvazaar,lu-zero/kvazaar
a5bc4fdc171021daeb92d5d4a6fcf45ed3cad3e6
Amethyst/AMShortcutsPreferencesViewController.h
Amethyst/AMShortcutsPreferencesViewController.h
// // AMShortcutsPreferencesViewController.h // Amethyst // // Created by Ian Ynda-Hummel on 4/26/14. // Copyright (c) 2014 Ian Ynda-Hummel. All rights reserved. // #import <Cocoa/Cocoa.h> #import <MASPreferences/MASPreferencesViewController.h> @interface AMShortcutsPreferencesViewController : NSViewController @end
// // AMShortcutsPreferencesViewController.h // Amethyst // // Created by Ian Ynda-Hummel on 4/26/14. // Copyright (c) 2014 Ian Ynda-Hummel. All rights reserved. // #import <Cocoa/Cocoa.h> @interface AMShortcutsPreferencesViewController : NSViewController @end
Remove import from previously-removed MASPreferences
Remove import from previously-removed MASPreferences
C
mit
ianyh/Amethyst,ianyh/Amethyst,ianyh/Amethyst,ianyh/Amethyst,ianyh/Amethyst
1c1fe4b476e004017fdfc633ab60b17146f1db80
stack.h
stack.h
#include <stdlib.h> #ifndef __STACK_H__ #define __STACK_H__ struct Stack; typedef struct Stack Stack; #endif
#include <stdlib.h> #ifndef __STACK_H__ #define __STACK_H__ struct Stack; typedef struct Stack Stack; void Push(Stack s, void* e); void* Pop(Stack s); int Stack_Empty(Stack s); #endif
Add basic operation function declaration
Add basic operation function declaration
C
mit
MaxLikelihood/CADT
0fee9081555e6b8a104aa857a29df14712c5fd43
ext/opengl/gl-ext-3dfx.c
ext/opengl/gl-ext-3dfx.c
/* * Copyright (C) 2007 Jan Dvorak <[email protected]> * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "common.h" /* OpenGL 3DFX extensions */ /* #208 - GL_3DFX_tbuffer */ GL_FUNC_LOAD_1(TbufferMask3DFX,GLvoid, GLuint, "GL_3DFX_tbuffer") void gl_init_functions_ext_3dfx(VALUE module) { /* #208 - GL_3DFX_tbuffer */ rb_define_module_function(module, "glTbufferMask3DFX", gl_TbufferMask3DFX, 1); }
/* * Copyright (C) 2007 Jan Dvorak <[email protected]> * * This program is distributed under the terms of the MIT license. * See the included MIT-LICENSE file for the terms of this license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "common.h" /* OpenGL 3DFX extensions */ /* #208 - GL_3DFX_tbuffer */ GL_FUNC_LOAD_1(TbufferMask3DFX,GLvoid, GLuint, "GL_3DFX_tbuffer") void gl_init_functions_ext_3dfx(VALUE klass) { /* #208 - GL_3DFX_tbuffer */ rb_define_method(klass, "glTbufferMask3DFX", gl_TbufferMask3DFX, 1); }
Change remaining glTbufferMask3DFX to an instance method.
Change remaining glTbufferMask3DFX to an instance method.
C
mit
larskanis/opengl,larskanis/opengl
815d5c9e041319cbd9660aca9097bfa9c7c257eb
prime.c
prime.c
#include <stdio.h> #include <stdlib.h> #include <math.h> int isPrime(unsigned long x) { if (sqrt(x) - (unsigned long)sqrt(x) == 0) return 0; for (unsigned long i = 2; i < ceil(sqrt(x)); i++) if (x % i == 0) return 0; return 1; } int main( int argc, char** argv) { unsigned long max = atol(argv[1]); unsigned long *a = malloc(sizeof(unsigned long) * max); unsigned long x = 2; for (unsigned long i = 0; i < max; x++) if (isPrime(x)) a[i++] = x; for (unsigned long i = 0; i < max; i++) printf("%lu\n", (unsigned long)a[i]); return 0; }
#include <stdio.h> #include <stdlib.h> #include <math.h> int isPrime(unsigned int x) { if (sqrt(x) - (unsigned int)sqrt(x) == 0) return 0; for (unsigned int i = 2; i < ceil(sqrt(x)); i++) if (x % i == 0) return 0; return 1; } int main( int argc, char** argv) { unsigned int max = atol(argv[1]); unsigned int *a = malloc(sizeof(unsigned int) * max); unsigned int x = 2; for (unsigned int i = 0; i < max; x++) if (isPrime(x)) a[i++] = x; for (unsigned int i = 0; i < max; i++) printf("%u\n", (unsigned int)a[i]); return 0; }
Replace long with int in the C version to improve performance.
Replace long with int in the C version to improve performance.
C
bsd-3-clause
noamknispel/ThePrimeBenchMark,noamknispel/ThePrimeBenchMark,noamknispel/ThePrimeBenchMark,noamknispel/ThePrimeBenchMark,noamknispel/ThePrimeBenchMark
47452ae7c92e4fb03416e1a870a0d586d761f5fa
Utilities/kwsys/testDynload.c
Utilities/kwsys/testDynload.c
#ifdef _WIN32 #define DL_EXPORT __declspec( dllexport ) #else #define DL_EXPORT #endif DL_EXPORT int TestDynamicLoaderData; DL_EXPORT void TestDynamicLoaderFunction() { }
#ifdef _WIN32 #define DL_EXPORT __declspec( dllexport ) #else #define DL_EXPORT #endif DL_EXPORT int TestDynamicLoaderData = 0; DL_EXPORT void TestDynamicLoaderFunction() { }
Fix compilation on MacOSX (common symbols not allowed with MH_DYLIB output format)
COMP: Fix compilation on MacOSX (common symbols not allowed with MH_DYLIB output format)
C
apache-2.0
eile/ITK,fbudin69500/ITK,wkjeong/ITK,fuentesdt/InsightToolkit-dev,fedral/ITK,stnava/ITK,Kitware/ITK,atsnyder/ITK,CapeDrew/DITK,blowekamp/ITK,InsightSoftwareConsortium/ITK,itkvideo/ITK,eile/ITK,stnava/ITK,LucasGandel/ITK,fedral/ITK,Kitware/ITK,stnava/ITK,itkvideo/ITK,InsightSoftwareConsortium/ITK,daviddoria/itkHoughTransform,jmerkow/ITK,rhgong/itk-with-dom,LucHermitte/ITK,biotrump/ITK,biotrump/ITK,fedral/ITK,BlueBrain/ITK,hjmjohnson/ITK,vfonov/ITK,hendradarwin/ITK,BlueBrain/ITK,zachary-williamson/ITK,wkjeong/ITK,malaterre/ITK,CapeDrew/DCMTK-ITK,wkjeong/ITK,atsnyder/ITK,daviddoria/itkHoughTransform,daviddoria/itkHoughTransform,InsightSoftwareConsortium/ITK,CapeDrew/DCMTK-ITK,heimdali/ITK,hendradarwin/ITK,eile/ITK,LucHermitte/ITK,hjmjohnson/ITK,itkvideo/ITK,CapeDrew/DITK,heimdali/ITK,BRAINSia/ITK,fuentesdt/InsightToolkit-dev,richardbeare/ITK,ajjl/ITK,stnava/ITK,spinicist/ITK,jmerkow/ITK,heimdali/ITK,richardbeare/ITK,jcfr/ITK,heimdali/ITK,cpatrick/ITK-RemoteIO,CapeDrew/DITK,hendradarwin/ITK,jmerkow/ITK,InsightSoftwareConsortium/ITK,jmerkow/ITK,rhgong/itk-with-dom,malaterre/ITK,richardbeare/ITK,hinerm/ITK,zachary-williamson/ITK,stnava/ITK,fuentesdt/InsightToolkit-dev,spinicist/ITK,PlutoniumHeart/ITK,cpatrick/ITK-RemoteIO,BlueBrain/ITK,LucasGandel/ITK,hjmjohnson/ITK,paulnovo/ITK,LucasGandel/ITK,itkvideo/ITK,PlutoniumHeart/ITK,msmolens/ITK,vfonov/ITK,vfonov/ITK,zachary-williamson/ITK,hendradarwin/ITK,LucasGandel/ITK,wkjeong/ITK,fbudin69500/ITK,GEHC-Surgery/ITK,jcfr/ITK,thewtex/ITK,rhgong/itk-with-dom,spinicist/ITK,fbudin69500/ITK,fedral/ITK,LucasGandel/ITK,daviddoria/itkHoughTransform,paulnovo/ITK,zachary-williamson/ITK,itkvideo/ITK,BRAINSia/ITK,spinicist/ITK,blowekamp/ITK,Kitware/ITK,LucasGandel/ITK,eile/ITK,CapeDrew/DITK,malaterre/ITK,richardbeare/ITK,msmolens/ITK,Kitware/ITK,spinicist/ITK,InsightSoftwareConsortium/ITK,CapeDrew/DITK,fbudin69500/ITK,CapeDrew/DCMTK-ITK,fuentesdt/InsightToolkit-dev,cpatrick/ITK-RemoteIO,paulnovo/ITK,biotrump/ITK,ajjl/ITK,vfonov/ITK,msmolens/ITK,PlutoniumHeart/ITK,fbudin69500/ITK,CapeDrew/DCMTK-ITK,malaterre/ITK,zachary-williamson/ITK,wkjeong/ITK,malaterre/ITK,stnava/ITK,LucasGandel/ITK,BlueBrain/ITK,eile/ITK,BlueBrain/ITK,hinerm/ITK,paulnovo/ITK,jmerkow/ITK,ajjl/ITK,CapeDrew/DCMTK-ITK,rhgong/itk-with-dom,Kitware/ITK,BRAINSia/ITK,fedral/ITK,atsnyder/ITK,spinicist/ITK,thewtex/ITK,ajjl/ITK,stnava/ITK,paulnovo/ITK,jmerkow/ITK,biotrump/ITK,Kitware/ITK,blowekamp/ITK,wkjeong/ITK,eile/ITK,hendradarwin/ITK,blowekamp/ITK,vfonov/ITK,malaterre/ITK,fuentesdt/InsightToolkit-dev,LucasGandel/ITK,heimdali/ITK,LucHermitte/ITK,itkvideo/ITK,heimdali/ITK,atsnyder/ITK,BRAINSia/ITK,rhgong/itk-with-dom,rhgong/itk-with-dom,CapeDrew/DCMTK-ITK,spinicist/ITK,daviddoria/itkHoughTransform,hendradarwin/ITK,hendradarwin/ITK,GEHC-Surgery/ITK,fuentesdt/InsightToolkit-dev,hinerm/ITK,malaterre/ITK,atsnyder/ITK,jmerkow/ITK,paulnovo/ITK,blowekamp/ITK,daviddoria/itkHoughTransform,daviddoria/itkHoughTransform,BlueBrain/ITK,eile/ITK,GEHC-Surgery/ITK,jcfr/ITK,zachary-williamson/ITK,hjmjohnson/ITK,hinerm/ITK,fbudin69500/ITK,zachary-williamson/ITK,stnava/ITK,heimdali/ITK,biotrump/ITK,InsightSoftwareConsortium/ITK,vfonov/ITK,richardbeare/ITK,cpatrick/ITK-RemoteIO,itkvideo/ITK,fuentesdt/InsightToolkit-dev,malaterre/ITK,BlueBrain/ITK,jcfr/ITK,richardbeare/ITK,jcfr/ITK,blowekamp/ITK,vfonov/ITK,GEHC-Surgery/ITK,Kitware/ITK,vfonov/ITK,zachary-williamson/ITK,stnava/ITK,InsightSoftwareConsortium/ITK,atsnyder/ITK,jcfr/ITK,PlutoniumHeart/ITK,hinerm/ITK,atsnyder/ITK,cpatrick/ITK-RemoteIO,CapeDrew/DITK,thewtex/ITK,spinicist/ITK,daviddoria/itkHoughTransform,malaterre/ITK,hjmjohnson/ITK,fbudin69500/ITK,msmolens/ITK,itkvideo/ITK,PlutoniumHeart/ITK,BRAINSia/ITK,thewtex/ITK,LucHermitte/ITK,LucHermitte/ITK,hinerm/ITK,GEHC-Surgery/ITK,atsnyder/ITK,fuentesdt/InsightToolkit-dev,heimdali/ITK,biotrump/ITK,CapeDrew/DCMTK-ITK,richardbeare/ITK,cpatrick/ITK-RemoteIO,biotrump/ITK,paulnovo/ITK,GEHC-Surgery/ITK,fuentesdt/InsightToolkit-dev,CapeDrew/DITK,rhgong/itk-with-dom,atsnyder/ITK,vfonov/ITK,thewtex/ITK,daviddoria/itkHoughTransform,itkvideo/ITK,jcfr/ITK,wkjeong/ITK,PlutoniumHeart/ITK,fedral/ITK,fedral/ITK,wkjeong/ITK,GEHC-Surgery/ITK,ajjl/ITK,BRAINSia/ITK,LucHermitte/ITK,BlueBrain/ITK,hendradarwin/ITK,BRAINSia/ITK,LucHermitte/ITK,CapeDrew/DCMTK-ITK,GEHC-Surgery/ITK,msmolens/ITK,CapeDrew/DITK,zachary-williamson/ITK,eile/ITK,PlutoniumHeart/ITK,hinerm/ITK,biotrump/ITK,CapeDrew/DCMTK-ITK,msmolens/ITK,ajjl/ITK,LucHermitte/ITK,thewtex/ITK,blowekamp/ITK,spinicist/ITK,jmerkow/ITK,PlutoniumHeart/ITK,hinerm/ITK,fbudin69500/ITK,paulnovo/ITK,ajjl/ITK,fedral/ITK,CapeDrew/DITK,eile/ITK,msmolens/ITK,hinerm/ITK,msmolens/ITK,hjmjohnson/ITK,jcfr/ITK,blowekamp/ITK,ajjl/ITK,hjmjohnson/ITK,rhgong/itk-with-dom,cpatrick/ITK-RemoteIO,cpatrick/ITK-RemoteIO,thewtex/ITK
5c4201a37985579b45debc1b9ab51ecf4870c140
sys/powerpc/include/floatingpoint.h
sys/powerpc/include/floatingpoint.h
/* * Copyright (c) 2004 Suleiman Souhlal <[email protected]> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY DAVID O'BRIEN AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _FLOATINGPOINT_H_ #define _FLOATINGPOINT_H_ #include <machine/ieeefp.h> #endif /* !_FLOATINGPOINT_H_ */
Add sys file required for IEEE fp functions.
Add sys file required for IEEE fp functions. Submitted by: Suleiman Souhlal <[email protected]>
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
614c7ace15046fd016ddcb28f61cb6cf6b30cc05
test/Preprocessor/has_c_attribute.c
test/Preprocessor/has_c_attribute.c
// RUN: %clang_cc1 -fdouble-square-bracket-attributes -std=c11 -E %s -o - | FileCheck %s // CHECK: has_fallthrough #if __has_c_attribute(fallthrough) int has_fallthrough(); #endif // CHECK: does_not_have_selectany #if !__has_c_attribute(selectany) int does_not_have_selectany(); #endif
// RUN: %clang_cc1 -fdouble-square-bracket-attributes -std=c11 -E %s -o - | FileCheck %s // CHECK: has_fallthrough #if __has_c_attribute(fallthrough) int has_fallthrough(); #endif // CHECK: does_not_have_selectany #if !__has_c_attribute(selectany) int does_not_have_selectany(); #endif
Correct line endings that got mixed up in r320088; NFC.
Correct line endings that got mixed up in r320088; NFC. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@320115 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,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
9b3814de8a8cbe6fda99174955f7878a5e6189bf
tests/src/test_run.c
tests/src/test_run.c
#include <stdio.h> #include <stdlib.h> #include "rxvm.h" #include "test_common.h" #include "test_modules.h" #define NUM_MODS 7 const testmod_t mods[NUM_MODS] = { test_rxvm_err, test_rxvm_match, test_rxvm_search, test_rxvm_search_nomatch, test_rxvm_compile, test_fuzz_rxvm_match, test_fuzz_full_rxvm_match }; int main (void) { testmod_t module; int i; int ret; int count; count = 1; ret = 0; printf("1..%d\n", NUM_TESTS); /* Run all test modules */ for (i = 0; i < NUM_MODS; ++i) { module = mods[i]; ret += (*module)(&count); } return ret; }
#include <stdio.h> #include <stdlib.h> #include "rxvm.h" #include "test_common.h" #include "test_modules.h" //#define NUM_MODS 7 #define NUM_MODS 6 const testmod_t mods[NUM_MODS] = { test_rxvm_err, test_rxvm_match, test_rxvm_search, test_rxvm_search_nomatch, test_rxvm_compile, test_fuzz_rxvm_match, //test_fuzz_full_rxvm_match }; int main (void) { testmod_t module; int i; int ret; int count; count = 1; ret = 0; printf("1..%d\n", NUM_TESTS); /* Run all test modules */ for (i = 0; i < NUM_MODS; ++i) { module = mods[i]; ret += (*module)(&count); } return ret; }
Disable fuzz_full test until fixed
Disable fuzz_full test until fixed
C
apache-2.0
eriknyquist/librxvm,eriknyquist/librxvm,eriknyquist/librxvm
3b6f6fefaa1f13cde4d9530a51e655059f5b15ab
texor.c
texor.c
#include <termios.h> #include <unistd.h> void enableRawMode() { struct termios raw; tcgetattr(STDIN_FILENO, &raw); raw.c_lflag &= ~(ECHO); tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw); } int main() { enableRawMode(); char c; while (read(STDIN_FILENO, &c, 1) == 1 && c!= 'q'); return 0; }
#include <stdlib.h> #include <termios.h> #include <unistd.h> struct termios orig_termios; void disableRawMode() { tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios); } void enableRawMode() { tcgetattr(STDIN_FILENO, &orig_termios); atexit(disableRawMode); struct termios raw = orig_termios; raw.c_lflag &= ~(ECHO); tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw); } int main() { enableRawMode(); char c; while (read(STDIN_FILENO, &c, 1) == 1 && c!= 'q'); return 0; }
Disable raw mode when exiting
Disable raw mode when exiting
C
bsd-2-clause
kyletolle/texor
15eb88a039cda665d151f6daa280c2ad439c2c84
BBlock.h
BBlock.h
// // BBlock.h // BBlock // // Created by David Keegan on 4/10/12. // Copyright (c) 2012 David Keegan. All rights reserved. // #import <Foundation/Foundation.h> /// For when you need a weak reference of an object, example: `BBlockWeakObject(obj) wobj = obj;` #define BBlockWeakObject(o) __weak typeof(o) /// For when you need a weak reference to self, example: `BBlockWeakSelf wself = self;` #define BBlockWeakSelf BBlockWeakObject(self) @interface BBlock : NSObject /// Execute the block on the main thread + (void)dispatchOnMainThread:(void (^)())block; /// Exectute the block on a background thread but in a synchronous queue + (void)dispatchOnSynchronousQueue:(void (^)())block; /// Exectute the block on a background thread but in a synchronous queue, /// This queue should only be used for writing files to disk. + (void)dispatchOnSynchronousFileQueue:(void (^)())block; + (void)dispatchOnDefaultPriorityConcurrentQueue:(void (^)())block; + (void)dispatchOnLowPriorityConcurrentQueue:(void (^)())block; + (void)dispatchOnHighPriorityConcurrentQueue:(void (^)())block; @end
// // BBlock.h // BBlock // // Created by David Keegan on 4/10/12. // Copyright (c) 2012 David Keegan. All rights reserved. // #import <Foundation/Foundation.h> /// For when you need a weak reference of an object, example: `BBlockWeakObject(obj) wobj = obj;` #define BBlockWeakObject(o) __weak __typeof__((__typeof__(o))o) /// For when you need a weak reference to self, example: `BBlockWeakSelf wself = self;` #define BBlockWeakSelf BBlockWeakObject(self) @interface BBlock : NSObject /// Execute the block on the main thread + (void)dispatchOnMainThread:(void (^)())block; /// Exectute the block on a background thread but in a synchronous queue + (void)dispatchOnSynchronousQueue:(void (^)())block; /// Exectute the block on a background thread but in a synchronous queue, /// This queue should only be used for writing files to disk. + (void)dispatchOnSynchronousFileQueue:(void (^)())block; + (void)dispatchOnDefaultPriorityConcurrentQueue:(void (^)())block; + (void)dispatchOnLowPriorityConcurrentQueue:(void (^)())block; + (void)dispatchOnHighPriorityConcurrentQueue:(void (^)())block; @end
Revert "with Xcode4.4 __weak typeof(o) is all that's needed for weak references"
Revert "with Xcode4.4 __weak typeof(o) is all that's needed for weak references" This reverts commit 7689903fd592848310bf12743dcec7805cd37098.
C
mit
kgn/BBlock,cnbin/BBlock,azplanlos/BBlock
2c454a161bc6f8cbe364c5dc040cf140299b4087
src/crt/crt1.c
src/crt/crt1.c
#include <stdint.h> void __wasm_call_ctors(void); int __argc(void); void __argv(uintptr_t[static 1]); void __args(char[static 1]); int main(int, char**); void _start(void) { int argc = __argc(); char* argv[argc + 1]; __argv((uintptr_t*)argv); char args[(uintptr_t)argv[argc]]; __args(args); for (int i = 0; i < argc; ++i) argv[i] = args + (uintptr_t)argv[i]; argv[argc] = (void*)0; __wasm_call_ctors(); main(argc, argv); }
#include <stdint.h> void __wasm_call_ctors(void); /*! * `argc` getter * * This function returns 0 if passing arguments to main() is unsupported. */ int __argc(void); /*! * `argv` builder * * This function stores `argv` as offset from `argv[0]`, * and appends `sizeof(args)`. * * For example, if the command line is `foo -c alfa`, * { 0, 4, 7, 12 } will be written because * * argv[0] = args + 0 * argv[1] = args + 4 * argv[2] = args + 7 * sizeof(args) = 12 * * See __args() for format of `args`. */ void __argv(uintptr_t* argv); /*! * This function stores null-separated command line. * * For example, if the command line is `foo -c alfa`, * it is stored as `"foo\0-c\0alfa"`. * Note that there is an implied '\0' at the end of a string. */ void __args(char* args); int main(int argc, char** argv); void _start(void) { int argc = __argc(); char* argv[argc + 1]; __argv((uintptr_t*)argv); char args[argc ? (uintptr_t)argv[argc] : 0]; __args(args); for (int i = 0; i < argc; ++i) argv[i] = args + (uintptr_t)argv[i]; argv[argc] = (void*)0; __wasm_call_ctors(); main(argc, argv); }
Document on getters of argc and argv
Document on getters of argc and argv
C
mit
jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic
af6936815f344cab1cd0549172582dfa40dcd46e
infiniteloop_cmd.c
infiniteloop_cmd.c
// Copyright (c) 2016 Ed Schouten <[email protected]> // // This file is distributed under a 2-clause BSD license. // See the LICENSE file for details. #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include "infiniteloop.h" static bool print_solution(const struct il_solution *s, void *thunk) { char buf[1024]; if (!il_solution_print(s, buf, sizeof(buf))) { fprintf(stderr, "Failed to print solution\n"); exit(1); } printf("-- SOLUTION --\n%s\n", buf); return true; } int main(void) { char buf[1024]; size_t len = fread(buf, 1, sizeof(buf) - 1, stdin); buf[len] = '\0'; struct il_problem p; if (!il_problem_parse(buf, &p)) { fprintf(stderr, "Failed to parse input\n"); return 1; } il_solve(&p, print_solution, NULL); return 0; }
// Copyright (c) 2016 Ed Schouten <[email protected]> // // This file is distributed under a 2-clause BSD license. // See the LICENSE file for details. #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include "infiniteloop.h" static unsigned int solutions_found = 0; static bool print_solution(const struct il_solution *s, void *thunk) { char buf[1024]; if (!il_solution_print(s, buf, sizeof(buf))) { fprintf(stderr, "Failed to print solution\n"); exit(1); } printf("-- SOLUTION --\n%s\n", buf); ++solutions_found; return true; } int main(void) { char buf[1024]; size_t len = fread(buf, 1, sizeof(buf) - 1, stdin); buf[len] = '\0'; struct il_problem p; if (!il_problem_parse(buf, &p)) { fprintf(stderr, "Failed to parse input\n"); return 1; } il_solve(&p, print_solution, NULL); printf("-- FOUND %u SOLUTIONS --\n", solutions_found); return 0; }
Print the number of solutions.
Print the number of solutions.
C
bsd-2-clause
EdSchouten/infiniteloop,EdSchouten/infiniteloop
c7b9219474aaa208b8063241d18d9d6cb3e1ad2e
include/MHClientSecret.h
include/MHClientSecret.h
// // MHClientSecret.h // MyHub // // Created by Arcterus on 1/14/14. // Copyright (c) 2014 kRaken Research. All rights reserved. // #ifndef MyHub_MHClientSecret_h #define MyHub_MHClientSecret_h #define CLIENT_ID "1234567890" #define CLIENT_SECRET "1234567890abcdef" #endif
Add file with dummy client info
Add file with dummy client info
C
mpl-2.0
Arcterus/MyHub
e8b78e79fe13f170083ba89b48b1c18bd3c93543
Mac/Python/macguesstabsize.c
Mac/Python/macguesstabsize.c
#include <MacHeaders> #include <string.h> /* Interface used by tokenizer.c */ guesstabsize(path) char *path; { char s[256]; int refnum; Handle h; int tabsize = 0; s[0] = strlen(path); strncpy(s+1, path, s[0]); refnum = OpenResFile(s); /* printf("%s --> refnum=%d\n", path, refnum); */ if (refnum == -1) return 0; UseResFile(refnum); h = GetIndResource('ETAB', 1); if (h != 0) { tabsize = (*(short**)h)[1]; /* printf("tabsize=%d\n", tabsize); */ } CloseResFile(refnum); return tabsize; }
#include <Types.h> #include <Files.h> #include <OSUtils.h> #include <Resources.h> #include <string.h> /* Interface used by tokenizer.c */ guesstabsize(path) char *path; { char s[256]; int refnum; Handle h; int tabsize = 0; s[0] = strlen(path); strncpy(s+1, path, s[0]); refnum = OpenResFile(s); /* printf("%s --> refnum=%d\n", path, refnum); */ if (refnum == -1) return 0; UseResFile(refnum); h = GetIndResource('ETAB', 1); if (h != 0) { tabsize = (*(short**)h)[1]; /* printf("tabsize=%d\n", tabsize); */ } CloseResFile(refnum); return tabsize; }
Replace <MacHeaders> by specific required header files
Replace <MacHeaders> by specific required header files
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
16a70daa90a743729ece6bb7ecd971a55ebe4731
link-grammar/lg_assert.h
link-grammar/lg_assert.h
/* There is no include guard here - by purpose. This file can be included * after system includes that redefine the assert() macro. * The actual problem for which this file got separated from utilities.h * happens in the sat-solver code, when local include files include * Solver.h which in turn includes the system's assert.h. */ #include "error.h" /* for prt_error() */ #ifndef STRINGIFY #define STR(x) #x #define STRINGIFY(x) STR(x) #endif /* STRINGIFY */ #define FILELINE __FILE__ ":" STRINGIFY(__LINE__) #ifdef _WIN32 #define DEBUG_TRAP (*((volatile int*) 0x0) = 42) #else #define DEBUG_TRAP __builtin_trap() #endif #define assert(ex, ...) { \ if (!(ex)) { \ prt_error("Fatal error: \nAssertion (" #ex ") failed at " FILELINE ": " __VA_ARGS__); \ prt_error("\n"); \ DEBUG_TRAP; /* leave stack trace in debugger */ \ } \ }
/* There is no include guard here - by purpose. This file can be included * after system includes that redefine the assert() macro. * The actual problem for which this file got separated from utilities.h * happens in the sat-solver code, when local include files include * Solver.h which in turn includes the system's assert.h. */ #include "error.h" /* for prt_error() */ #ifndef STRINGIFY #define STR(x) #x #define STRINGIFY(x) STR(x) #endif /* STRINGIFY */ #define FILELINE __FILE__ ":" STRINGIFY(__LINE__) #ifdef _WIN32 #define DEBUG_TRAP (*((volatile int*) 0x0) = 42) #else #define DEBUG_TRAP __builtin_trap() #endif #define assert(ex, ...) { \ if (!(ex)) { \ fprintf(stderr, "Fatal error: \nAssertion (" #ex ") failed at " FILELINE ": " __VA_ARGS__); \ fprintf(stderr, "\n"); \ DEBUG_TRAP; /* leave stack trace in debugger */ \ } \ }
Use fprintf() to ensure message printing
assert(): Use fprintf() to ensure message printing If prt_error() is used and the error facility uses a non-default error handler, the message will get lost.
C
lgpl-2.1
ampli/link-grammar,opencog/link-grammar,linas/link-grammar,linas/link-grammar,opencog/link-grammar,opencog/link-grammar,linas/link-grammar,opencog/link-grammar,opencog/link-grammar,ampli/link-grammar,linas/link-grammar,ampli/link-grammar,opencog/link-grammar,ampli/link-grammar,opencog/link-grammar,opencog/link-grammar,linas/link-grammar,ampli/link-grammar,ampli/link-grammar,ampli/link-grammar,linas/link-grammar,opencog/link-grammar,linas/link-grammar,linas/link-grammar,ampli/link-grammar,ampli/link-grammar,linas/link-grammar
d58d382cd1d01bc048c8bb74b184d182b36a5cfb
Application/voRemoteAnalysisConnectionDialog.h
Application/voRemoteAnalysisConnectionDialog.h
/*========================================================================= Program: Visomics Copyright (c) Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =========================================================================*/ #ifndef __voMongoSaveDialog_h #define __voMongoSaveDialog_h // Qt includes #include <QDialog> class voRemoteAnalysisConnectionDialogPrivate; class voRemoteAnalysisConnectionDialog : public QDialog { Q_OBJECT public: typedef QDialog Superclass; voRemoteAnalysisConnectionDialog(QWidget* newParent = 0); virtual ~voRemoteAnalysisConnectionDialog(); QString Url(); QString User(); QString Password(); private: QScopedPointer<voRemoteAnalysisConnectionDialogPrivate> d_ptr; Q_DECLARE_PRIVATE(voRemoteAnalysisConnectionDialog); Q_DISABLE_COPY(voRemoteAnalysisConnectionDialog); void loadSettings(); private slots: void saveSettings(); }; #endif
/*========================================================================= Program: Visomics Copyright (c) Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =========================================================================*/ #ifndef __voRemoteAnalysisConnectionDialog_h #define __voRemoteAnalysisConnectionDialog_h // Qt includes #include <QDialog> class voRemoteAnalysisConnectionDialogPrivate; class voRemoteAnalysisConnectionDialog : public QDialog { Q_OBJECT public: typedef QDialog Superclass; voRemoteAnalysisConnectionDialog(QWidget* newParent = 0); virtual ~voRemoteAnalysisConnectionDialog(); QString Url(); QString User(); QString Password(); private: QScopedPointer<voRemoteAnalysisConnectionDialogPrivate> d_ptr; Q_DECLARE_PRIVATE(voRemoteAnalysisConnectionDialog); Q_DISABLE_COPY(voRemoteAnalysisConnectionDialog); void loadSettings(); private slots: void saveSettings(); }; #endif
Fix copy/paste error in header guard
Fix copy/paste error in header guard
C
apache-2.0
Visomics/Visomics,arborworkflows/Visomics,Visomics/Visomics,Visomics/Visomics,arborworkflows/Visomics,Visomics/Visomics,Visomics/Visomics,arborworkflows/Visomics,Visomics/Visomics,arborworkflows/Visomics,arborworkflows/Visomics,arborworkflows/Visomics
947470b6ae897dd4a340944206c80e39c5e20cc9
browser/atom_browser_main_parts.h
browser/atom_browser_main_parts.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_ATOM_BROWSER_MAIN_PARTS_ #define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_ #include "brightray/browser/browser_main_parts.h" namespace atom { class AtomBrowserBindings; class Browser; class NodeBindings; class AtomBrowserMainParts : public brightray::BrowserMainParts { public: AtomBrowserMainParts(); virtual ~AtomBrowserMainParts(); static AtomBrowserMainParts* Get(); AtomBrowserBindings* atom_bindings() { return atom_bindings_.get(); } Browser* browser() { return browser_.get(); } protected: // Implementations of brightray::BrowserMainParts. virtual brightray::BrowserContext* CreateBrowserContext() OVERRIDE; // Implementations of content::BrowserMainParts. virtual void PostEarlyInitialization() OVERRIDE; virtual void PreMainMessageLoopStart() OVERRIDE; virtual void PreMainMessageLoopRun() OVERRIDE; virtual void PostDestroyThreads() OVERRIDE; private: scoped_ptr<AtomBrowserBindings> atom_bindings_; scoped_ptr<Browser> browser_; scoped_ptr<NodeBindings> node_bindings_; static AtomBrowserMainParts* self_; DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts); }; } // namespace atom #endif // ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_
// 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_ATOM_BROWSER_MAIN_PARTS_ #define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_ #include "brightray/browser/browser_main_parts.h" namespace atom { class AtomBrowserBindings; class Browser; class NodeBindings; class AtomBrowserMainParts : public brightray::BrowserMainParts { public: AtomBrowserMainParts(); virtual ~AtomBrowserMainParts(); static AtomBrowserMainParts* Get(); AtomBrowserBindings* atom_bindings() { return atom_bindings_.get(); } Browser* browser() { return browser_.get(); } protected: // Implementations of brightray::BrowserMainParts. virtual brightray::BrowserContext* CreateBrowserContext() OVERRIDE; // Implementations of content::BrowserMainParts. virtual void PostEarlyInitialization() OVERRIDE; virtual void PreMainMessageLoopRun() OVERRIDE; #if defined(OS_MACOSX) virtual void PreMainMessageLoopStart() OVERRIDE; virtual void PostDestroyThreads() OVERRIDE; #endif private: scoped_ptr<AtomBrowserBindings> atom_bindings_; scoped_ptr<Browser> browser_; scoped_ptr<NodeBindings> node_bindings_; static AtomBrowserMainParts* self_; DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts); }; } // namespace atom #endif // ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_
Mark OS X only implementations in BrowserMainParts.
Mark OS X only implementations in BrowserMainParts.
C
mit
Jacobichou/electron,michaelchiche/electron,fritx/electron,chrisswk/electron,twolfson/electron,eriser/electron,Jacobichou/electron,John-Lin/electron,gabriel/electron,simonfork/electron,d-salas/electron,aliib/electron,GoooIce/electron,adamjgray/electron,JesselJohn/electron,Faiz7412/electron,ervinb/electron,Floato/electron,Zagorakiss/electron,faizalpribadi/electron,sircharleswatson/electron,sky7sea/electron,nicobot/electron,mirrh/electron,minggo/electron,miniak/electron,joneit/electron,icattlecoder/electron,jlord/electron,bpasero/electron,micalan/electron,ianscrivener/electron,shockone/electron,gerhardberger/electron,xiruibing/electron,mjaniszew/electron,mhkeller/electron,rreimann/electron,DivyaKMenon/electron,biblerule/UMCTelnetHub,neutrous/electron,LadyNaggaga/electron,sky7sea/electron,LadyNaggaga/electron,baiwyc119/electron,LadyNaggaga/electron,wan-qy/electron,setzer777/electron,jjz/electron,seanchas116/electron,yalexx/electron,cos2004/electron,sircharleswatson/electron,chrisswk/electron,anko/electron,medixdev/electron,mattotodd/electron,lrlna/electron,electron/electron,GoooIce/electron,jlord/electron,smczk/electron,etiktin/electron,GoooIce/electron,brenca/electron,lzpfmh/electron,mirrh/electron,dkfiresky/electron,saronwei/electron,bbondy/electron,chrisswk/electron,tinydew4/electron,minggo/electron,natgolov/electron,adcentury/electron,soulteary/electron,biblerule/UMCTelnetHub,robinvandernoord/electron,takashi/electron,adcentury/electron,adcentury/electron,adamjgray/electron,bruce/electron,MaxWhere/electron,kokdemo/electron,aecca/electron,Andrey-Pavlov/electron,sshiting/electron,roadev/electron,bobwol/electron,MaxWhere/electron,Jonekee/electron,hokein/atom-shell,gbn972/electron,bright-sparks/electron,seanchas116/electron,mrwizard82d1/electron,kostia/electron,jhen0409/electron,stevemao/electron,stevemao/electron,jjz/electron,thingsinjars/electron,kikong/electron,Evercoder/electron,trigrass2/electron,twolfson/electron,wolfflow/electron,fireball-x/atom-shell,shaundunne/electron,evgenyzinoviev/electron,Andrey-Pavlov/electron,fireball-x/atom-shell,nicholasess/electron,shaundunne/electron,tinydew4/electron,edulan/electron,John-Lin/electron,anko/electron,jonatasfreitasv/electron,JussMee15/electron,voidbridge/electron,JesselJohn/electron,jlhbaseball15/electron,GoooIce/electron,jjz/electron,jannishuebl/electron,tonyganch/electron,IonicaBizauKitchen/electron,BionicClick/electron,stevekinney/electron,dkfiresky/electron,leolujuyi/electron,sircharleswatson/electron,gabriel/electron,d-salas/electron,thompsonemerson/electron,MaxGraey/electron,fireball-x/atom-shell,Ivshti/electron,medixdev/electron,jaanus/electron,Evercoder/electron,simongregory/electron,rajatsingla28/electron,twolfson/electron,cos2004/electron,astoilkov/electron,dongjoon-hyun/electron,jlhbaseball15/electron,Zagorakiss/electron,Jonekee/electron,Ivshti/electron,ervinb/electron,Neron-X5/electron,Jonekee/electron,mjaniszew/electron,takashi/electron,leftstick/electron,coderhaoxin/electron,pandoraui/electron,chriskdon/electron,mattdesl/electron,pirafrank/electron,Evercoder/electron,lzpfmh/electron,the-ress/electron,fabien-d/electron,farmisen/electron,Jonekee/electron,biblerule/UMCTelnetHub,cos2004/electron,matiasinsaurralde/electron,nicholasess/electron,abhishekgahlot/electron,voidbridge/electron,ervinb/electron,icattlecoder/electron,brave/electron,wan-qy/electron,jacksondc/electron,Zagorakiss/electron,dahal/electron,joaomoreno/atom-shell,thomsonreuters/electron,eriser/electron,simongregory/electron,bpasero/electron,sircharleswatson/electron,RobertJGabriel/electron,preco21/electron,Floato/electron,carsonmcdonald/electron,JussMee15/electron,meowlab/electron,edulan/electron,posix4e/electron,shennushi/electron,matiasinsaurralde/electron,gabrielPeart/electron,kenmozi/electron,jannishuebl/electron,posix4e/electron,gamedevsam/electron,Neron-X5/electron,jsutcodes/electron,xfstudio/electron,bitemyapp/electron,setzer777/electron,jaanus/electron,Gerhut/electron,brave/electron,mirrh/electron,neutrous/electron,brave/electron,posix4e/electron,simonfork/electron,micalan/electron,preco21/electron,aichingm/electron,coderhaoxin/electron,biblerule/UMCTelnetHub,xiruibing/electron,xiruibing/electron,ankitaggarwal011/electron,rsvip/electron,joaomoreno/atom-shell,jjz/electron,kostia/electron,michaelchiche/electron,kazupon/electron,xiruibing/electron,shiftkey/electron,tylergibson/electron,deepak1556/atom-shell,cos2004/electron,Rokt33r/electron,anko/electron,d-salas/electron,bitemyapp/electron,aliib/electron,webmechanicx/electron,shaundunne/electron,ankitaggarwal011/electron,vaginessa/electron,saronwei/electron,RobertJGabriel/electron,webmechanicx/electron,pandoraui/electron,leftstick/electron,preco21/electron,jsutcodes/electron,eric-seekas/electron,meowlab/electron,shennushi/electron,ervinb/electron,jonatasfreitasv/electron,IonicaBizauKitchen/electron,egoist/electron,faizalpribadi/electron,jhen0409/electron,ankitaggarwal011/electron,arusakov/electron,tinydew4/electron,IonicaBizauKitchen/electron,gbn972/electron,sshiting/electron,LadyNaggaga/electron,mattdesl/electron,hokein/atom-shell,jtburke/electron,coderhaoxin/electron,aichingm/electron,RobertJGabriel/electron,minggo/electron,dahal/electron,kikong/electron,mrwizard82d1/electron,Andrey-Pavlov/electron,edulan/electron,roadev/electron,shockone/electron,pirafrank/electron,Faiz7412/electron,rhencke/electron,gstack/infinium-shell,simonfork/electron,iftekeriba/electron,jaanus/electron,shockone/electron,lrlna/electron,mhkeller/electron,benweissmann/electron,leolujuyi/electron,BionicClick/electron,roadev/electron,jtburke/electron,iftekeriba/electron,shiftkey/electron,faizalpribadi/electron,bruce/electron,kenmozi/electron,bright-sparks/electron,mhkeller/electron,MaxWhere/electron,Ivshti/electron,fomojola/electron,digideskio/electron,brave/muon,maxogden/atom-shell,oiledCode/electron,darwin/electron,arusakov/electron,Neron-X5/electron,xfstudio/electron,thompsonemerson/electron,anko/electron,benweissmann/electron,adamjgray/electron,yan-foto/electron,brave/muon,micalan/electron,mrwizard82d1/electron,davazp/electron,aecca/electron,pirafrank/electron,deepak1556/atom-shell,xfstudio/electron,gamedevsam/electron,systembugtj/electron,voidbridge/electron,kostia/electron,etiktin/electron,nicobot/electron,tinydew4/electron,yan-foto/electron,abhishekgahlot/electron,lzpfmh/electron,gerhardberger/electron,wan-qy/electron,shennushi/electron,kazupon/electron,deed02392/electron,SufianHassan/electron,pandoraui/electron,rajatsingla28/electron,mattotodd/electron,chriskdon/electron,jiaz/electron,jtburke/electron,thompsonemerson/electron,bwiggs/electron,mattotodd/electron,farmisen/electron,michaelchiche/electron,thompsonemerson/electron,bobwol/electron,eriser/electron,posix4e/electron,fritx/electron,soulteary/electron,evgenyzinoviev/electron,jlhbaseball15/electron,nekuz0r/electron,bright-sparks/electron,jhen0409/electron,thompsonemerson/electron,gbn972/electron,subblue/electron,darwin/electron,wolfflow/electron,voidbridge/electron,synaptek/electron,shaundunne/electron,robinvandernoord/electron,mubassirhayat/electron,jcblw/electron,wolfflow/electron,fabien-d/electron,trigrass2/electron,jacksondc/electron,joneit/electron,kenmozi/electron,rreimann/electron,bwiggs/electron,felixrieseberg/electron,simonfork/electron,biblerule/UMCTelnetHub,howmuchcomputer/electron,mattdesl/electron,tomashanacek/electron,the-ress/electron,thomsonreuters/electron,abhishekgahlot/electron,dahal/electron,noikiy/electron,seanchas116/electron,dahal/electron,oiledCode/electron,aecca/electron,bitemyapp/electron,aichingm/electron,stevekinney/electron,oiledCode/electron,leftstick/electron,sky7sea/electron,faizalpribadi/electron,destan/electron,mattdesl/electron,robinvandernoord/electron,LadyNaggaga/electron,darwin/electron,simongregory/electron,iftekeriba/electron,yan-foto/electron,howmuchcomputer/electron,sircharleswatson/electron,tincan24/electron,rprichard/electron,pandoraui/electron,destan/electron,jhen0409/electron,thingsinjars/electron,aliib/electron,jonatasfreitasv/electron,renaesop/electron,natgolov/electron,mrwizard82d1/electron,Zagorakiss/electron,timruffles/electron,jannishuebl/electron,Rokt33r/electron,synaptek/electron,brave/muon,stevekinney/electron,yalexx/electron,lzpfmh/electron,ianscrivener/electron,shiftkey/electron,brenca/electron,coderhaoxin/electron,dongjoon-hyun/electron,eric-seekas/electron,bpasero/electron,John-Lin/electron,posix4e/electron,zhakui/electron,rhencke/electron,GoooIce/electron,Jacobichou/electron,jonatasfreitasv/electron,medixdev/electron,wolfflow/electron,rajatsingla28/electron,tincan24/electron,aaron-goshine/electron,DivyaKMenon/electron,digideskio/electron,pandoraui/electron,neutrous/electron,ankitaggarwal011/electron,anko/electron,tincan24/electron,bitemyapp/electron,SufianHassan/electron,jcblw/electron,pirafrank/electron,gabriel/electron,jsutcodes/electron,mubassirhayat/electron,tomashanacek/electron,bitemyapp/electron,stevemao/electron,brave/muon,RIAEvangelist/electron,tomashanacek/electron,SufianHassan/electron,maxogden/atom-shell,rajatsingla28/electron,stevekinney/electron,Ivshti/electron,mjaniszew/electron,deed02392/electron,seanchas116/electron,kcrt/electron,roadev/electron,benweissmann/electron,aecca/electron,gabrielPeart/electron,saronwei/electron,bruce/electron,arturts/electron,wolfflow/electron,evgenyzinoviev/electron,kcrt/electron,vHanda/electron,abhishekgahlot/electron,Gerhut/electron,mrwizard82d1/electron,bbondy/electron,anko/electron,miniak/electron,baiwyc119/electron,kokdemo/electron,zhakui/electron,sshiting/electron,gabrielPeart/electron,sshiting/electron,aichingm/electron,greyhwndz/electron,matiasinsaurralde/electron,jaanus/electron,saronwei/electron,arturts/electron,shockone/electron,fabien-d/electron,yalexx/electron,mattotodd/electron,dkfiresky/electron,chriskdon/electron,simonfork/electron,edulan/electron,robinvandernoord/electron,vHanda/electron,benweissmann/electron,takashi/electron,rajatsingla28/electron,nicholasess/electron,smczk/electron,synaptek/electron,John-Lin/electron,Floato/electron,bpasero/electron,tinydew4/electron,deepak1556/atom-shell,jacksondc/electron,twolfson/electron,jlord/electron,JussMee15/electron,iftekeriba/electron,egoist/electron,brave/muon,micalan/electron,maxogden/atom-shell,gbn972/electron,aliib/electron,bitemyapp/electron,bobwol/electron,chriskdon/electron,gamedevsam/electron,icattlecoder/electron,electron/electron,arusakov/electron,electron/electron,astoilkov/electron,yalexx/electron,felixrieseberg/electron,arusakov/electron,bright-sparks/electron,thingsinjars/electron,renaesop/electron,nicholasess/electron,dongjoon-hyun/electron,saronwei/electron,takashi/electron,meowlab/electron,chrisswk/electron,cqqccqc/electron,Neron-X5/electron,joaomoreno/atom-shell,etiktin/electron,wan-qy/electron,jonatasfreitasv/electron,rajatsingla28/electron,destan/electron,BionicClick/electron,mattdesl/electron,yan-foto/electron,vHanda/electron,kenmozi/electron,timruffles/electron,brave/electron,gamedevsam/electron,tylergibson/electron,jacksondc/electron,mubassirhayat/electron,tonyganch/electron,mhkeller/electron,rprichard/electron,thingsinjars/electron,eric-seekas/electron,oiledCode/electron,kokdemo/electron,bobwol/electron,renaesop/electron,destan/electron,deepak1556/atom-shell,jcblw/electron,arusakov/electron,gabriel/electron,JesselJohn/electron,gstack/infinium-shell,gabriel/electron,adcentury/electron,brenca/electron,Faiz7412/electron,vaginessa/electron,matiasinsaurralde/electron,arusakov/electron,maxogden/atom-shell,felixrieseberg/electron,beni55/electron,thingsinjars/electron,voidbridge/electron,dahal/electron,noikiy/electron,mubassirhayat/electron,jlord/electron,cos2004/electron,lrlna/electron,Gerhut/electron,michaelchiche/electron,dongjoon-hyun/electron,MaxWhere/electron,leolujuyi/electron,jannishuebl/electron,RobertJGabriel/electron,neutrous/electron,benweissmann/electron,astoilkov/electron,kcrt/electron,kostia/electron,farmisen/electron,bruce/electron,rprichard/electron,nagyistoce/electron-atom-shell,sky7sea/electron,vipulroxx/electron,tylergibson/electron,vaginessa/electron,jsutcodes/electron,xiruibing/electron,baiwyc119/electron,kazupon/electron,fomojola/electron,IonicaBizauKitchen/electron,Ivshti/electron,bwiggs/electron,rsvip/electron,mubassirhayat/electron,LadyNaggaga/electron,nekuz0r/electron,jhen0409/electron,fritx/electron,deed02392/electron,chrisswk/electron,JussMee15/electron,astoilkov/electron,BionicClick/electron,SufianHassan/electron,fffej/electron,leftstick/electron,yalexx/electron,trankmichael/electron,nekuz0r/electron,tylergibson/electron,vHanda/electron,jsutcodes/electron,rsvip/electron,preco21/electron,meowlab/electron,Neron-X5/electron,GoooIce/electron,tinydew4/electron,fabien-d/electron,lrlna/electron,neutrous/electron,coderhaoxin/electron,mattdesl/electron,gabriel/electron,thomsonreuters/electron,RIAEvangelist/electron,DivyaKMenon/electron,evgenyzinoviev/electron,ianscrivener/electron,mirrh/electron,John-Lin/electron,dongjoon-hyun/electron,carsonmcdonald/electron,jiaz/electron,howmuchcomputer/electron,lrlna/electron,nicholasess/electron,vipulroxx/electron,nagyistoce/electron-atom-shell,eric-seekas/electron,stevemao/electron,etiktin/electron,yan-foto/electron,nagyistoce/electron-atom-shell,dkfiresky/electron,twolfson/electron,Andrey-Pavlov/electron,jlord/electron,fomojola/electron,DivyaKMenon/electron,systembugtj/electron,thomsonreuters/electron,thomsonreuters/electron,yan-foto/electron,miniak/electron,greyhwndz/electron,kikong/electron,ianscrivener/electron,medixdev/electron,nicobot/electron,bright-sparks/electron,deepak1556/atom-shell,MaxWhere/electron,baiwyc119/electron,tomashanacek/electron,rhencke/electron,xiruibing/electron,carsonmcdonald/electron,MaxGraey/electron,roadev/electron,arturts/electron,robinvandernoord/electron,takashi/electron,nicobot/electron,mhkeller/electron,jtburke/electron,systembugtj/electron,jaanus/electron,beni55/electron,bright-sparks/electron,kikong/electron,aecca/electron,arturts/electron,nicobot/electron,Jacobichou/electron,bruce/electron,biblerule/UMCTelnetHub,egoist/electron,smczk/electron,shockone/electron,zhakui/electron,felixrieseberg/electron,fireball-x/atom-shell,systembugtj/electron,shennushi/electron,rreimann/electron,shennushi/electron,arturts/electron,fritx/electron,jsutcodes/electron,Zagorakiss/electron,howmuchcomputer/electron,jlhbaseball15/electron,shiftkey/electron,gerhardberger/electron,destan/electron,micalan/electron,rhencke/electron,leftstick/electron,seanchas116/electron,gerhardberger/electron,noikiy/electron,christian-bromann/electron,gbn972/electron,Floato/electron,jannishuebl/electron,tomashanacek/electron,DivyaKMenon/electron,matiasinsaurralde/electron,cqqccqc/electron,kikong/electron,trankmichael/electron,systembugtj/electron,bobwol/electron,minggo/electron,davazp/electron,trigrass2/electron,gbn972/electron,jlhbaseball15/electron,beni55/electron,wolfflow/electron,farmisen/electron,mattotodd/electron,kazupon/electron,renaesop/electron,zhakui/electron,tonyganch/electron,noikiy/electron,sky7sea/electron,posix4e/electron,brenca/electron,jcblw/electron,ankitaggarwal011/electron,leethomas/electron,renaesop/electron,aaron-goshine/electron,evgenyzinoviev/electron,cqqccqc/electron,rreimann/electron,bpasero/electron,kokdemo/electron,adamjgray/electron,nekuz0r/electron,SufianHassan/electron,seanchas116/electron,digideskio/electron,Gerhut/electron,pombredanne/electron,baiwyc119/electron,renaesop/electron,SufianHassan/electron,beni55/electron,nagyistoce/electron-atom-shell,pirafrank/electron,kazupon/electron,trankmichael/electron,tincan24/electron,christian-bromann/electron,miniak/electron,RIAEvangelist/electron,Evercoder/electron,kenmozi/electron,JussMee15/electron,DivyaKMenon/electron,greyhwndz/electron,shaundunne/electron,the-ress/electron,nicobot/electron,fritx/electron,vHanda/electron,faizalpribadi/electron,setzer777/electron,webmechanicx/electron,fffej/electron,ankitaggarwal011/electron,dongjoon-hyun/electron,leftstick/electron,setzer777/electron,vaginessa/electron,trigrass2/electron,etiktin/electron,felixrieseberg/electron,mrwizard82d1/electron,leethomas/electron,brenca/electron,medixdev/electron,tincan24/electron,joneit/electron,shockone/electron,trankmichael/electron,arturts/electron,matiasinsaurralde/electron,John-Lin/electron,carsonmcdonald/electron,Floato/electron,fomojola/electron,bpasero/electron,Faiz7412/electron,bbondy/electron,JesselJohn/electron,gstack/infinium-shell,abhishekgahlot/electron,Jacobichou/electron,brave/electron,lrlna/electron,fabien-d/electron,gstack/infinium-shell,neutrous/electron,d-salas/electron,Jonekee/electron,joaomoreno/atom-shell,trigrass2/electron,oiledCode/electron,etiktin/electron,davazp/electron,fffej/electron,the-ress/electron,nekuz0r/electron,eric-seekas/electron,Neron-X5/electron,jcblw/electron,farmisen/electron,robinvandernoord/electron,Evercoder/electron,joaomoreno/atom-shell,miniak/electron,bwiggs/electron,stevemao/electron,stevekinney/electron,stevekinney/electron,vipulroxx/electron,ianscrivener/electron,smczk/electron,Andrey-Pavlov/electron,dkfiresky/electron,micalan/electron,beni55/electron,BionicClick/electron,jiaz/electron,jonatasfreitasv/electron,pombredanne/electron,pirafrank/electron,eric-seekas/electron,gamedevsam/electron,howmuchcomputer/electron,rreimann/electron,leolujuyi/electron,astoilkov/electron,vHanda/electron,soulteary/electron,kokdemo/electron,RIAEvangelist/electron,pombredanne/electron,kokdemo/electron,gerhardberger/electron,electron/electron,leethomas/electron,trigrass2/electron,JussMee15/electron,joneit/electron,thingsinjars/electron,MaxGraey/electron,the-ress/electron,dahal/electron,jannishuebl/electron,trankmichael/electron,simongregory/electron,leethomas/electron,greyhwndz/electron,christian-bromann/electron,baiwyc119/electron,rhencke/electron,synaptek/electron,thompsonemerson/electron,faizalpribadi/electron,smczk/electron,rsvip/electron,minggo/electron,IonicaBizauKitchen/electron,darwin/electron,Rokt33r/electron,adamjgray/electron,sshiting/electron,carsonmcdonald/electron,tonyganch/electron,deed02392/electron,natgolov/electron,gerhardberger/electron,kcrt/electron,JesselJohn/electron,cos2004/electron,edulan/electron,kcrt/electron,tylergibson/electron,vipulroxx/electron,MaxWhere/electron,aaron-goshine/electron,Andrey-Pavlov/electron,iftekeriba/electron,aliib/electron,Faiz7412/electron,michaelchiche/electron,fritx/electron,jjz/electron,minggo/electron,ianscrivener/electron,mattotodd/electron,MaxGraey/electron,tonyganch/electron,destan/electron,oiledCode/electron,lzpfmh/electron,mhkeller/electron,stevemao/electron,roadev/electron,mirrh/electron,leethomas/electron,adcentury/electron,Evercoder/electron,trankmichael/electron,deed02392/electron,christian-bromann/electron,michaelchiche/electron,natgolov/electron,meowlab/electron,pombredanne/electron,greyhwndz/electron,fffej/electron,aaron-goshine/electron,mirrh/electron,RIAEvangelist/electron,fffej/electron,jcblw/electron,miniak/electron,gabrielPeart/electron,Rokt33r/electron,brave/electron,aaron-goshine/electron,soulteary/electron,rreimann/electron,hokein/atom-shell,fomojola/electron,pandoraui/electron,jaanus/electron,egoist/electron,icattlecoder/electron,BionicClick/electron,greyhwndz/electron,timruffles/electron,zhakui/electron,gabrielPeart/electron,simonfork/electron,cqqccqc/electron,subblue/electron,cqqccqc/electron,meowlab/electron,electron/electron,aecca/electron,Jonekee/electron,timruffles/electron,icattlecoder/electron,tomashanacek/electron,egoist/electron,vaginessa/electron,bbondy/electron,noikiy/electron,mjaniszew/electron,Floato/electron,thomsonreuters/electron,nekuz0r/electron,benweissmann/electron,wan-qy/electron,xfstudio/electron,electron/electron,xfstudio/electron,coderhaoxin/electron,kostia/electron,sshiting/electron,Gerhut/electron,digideskio/electron,carsonmcdonald/electron,webmechanicx/electron,RIAEvangelist/electron,maxogden/atom-shell,mjaniszew/electron,kcrt/electron,bwiggs/electron,edulan/electron,aaron-goshine/electron,icattlecoder/electron,Rokt33r/electron,bbondy/electron,jhen0409/electron,davazp/electron,webmechanicx/electron,Zagorakiss/electron,RobertJGabriel/electron,hokein/atom-shell,jlhbaseball15/electron,shaundunne/electron,d-salas/electron,ervinb/electron,howmuchcomputer/electron,preco21/electron,brave/muon,davazp/electron,christian-bromann/electron,electron/electron,christian-bromann/electron,jacksondc/electron,jiaz/electron,jiaz/electron,cqqccqc/electron,felixrieseberg/electron,timruffles/electron,natgolov/electron,fomojola/electron,evgenyzinoviev/electron,leolujuyi/electron,IonicaBizauKitchen/electron,jtburke/electron,leolujuyi/electron,lzpfmh/electron,tylergibson/electron,twolfson/electron,vaginessa/electron,xfstudio/electron,tonyganch/electron,gabrielPeart/electron,subblue/electron,medixdev/electron,saronwei/electron,zhakui/electron,nagyistoce/electron-atom-shell,takashi/electron,fffej/electron,adamjgray/electron,voidbridge/electron,Jacobichou/electron,darwin/electron,fireball-x/atom-shell,systembugtj/electron,jiaz/electron,Rokt33r/electron,deed02392/electron,bruce/electron,synaptek/electron,tincan24/electron,vipulroxx/electron,MaxGraey/electron,farmisen/electron,adcentury/electron,jjz/electron,chriskdon/electron,shiftkey/electron,rsvip/electron,gstack/infinium-shell,shennushi/electron,digideskio/electron,synaptek/electron,joneit/electron,subblue/electron,leethomas/electron,astoilkov/electron,aichingm/electron,ervinb/electron,eriser/electron,natgolov/electron,simongregory/electron,JesselJohn/electron,subblue/electron,aichingm/electron,the-ress/electron,aliib/electron,wan-qy/electron,kostia/electron,shiftkey/electron,webmechanicx/electron,pombredanne/electron,digideskio/electron,abhishekgahlot/electron,chriskdon/electron,iftekeriba/electron,jtburke/electron,vipulroxx/electron,gamedevsam/electron,joneit/electron,rprichard/electron,jacksondc/electron,pombredanne/electron,eriser/electron,sircharleswatson/electron,preco21/electron,sky7sea/electron,rhencke/electron,yalexx/electron,mjaniszew/electron,joaomoreno/atom-shell,simongregory/electron,the-ress/electron,smczk/electron,kazupon/electron,setzer777/electron,kenmozi/electron,RobertJGabriel/electron,d-salas/electron,soulteary/electron,dkfiresky/electron,bpasero/electron,noikiy/electron,brenca/electron,gerhardberger/electron,setzer777/electron,egoist/electron,Gerhut/electron,bwiggs/electron,davazp/electron,nicholasess/electron,hokein/atom-shell,bobwol/electron,beni55/electron,bbondy/electron,eriser/electron,subblue/electron,soulteary/electron
39e3614c7136029acb6b18cd71e12ef2feaeaac7
ui/minigraph.h
ui/minigraph.h
#pragma once #include <QtGui/QMouseEvent> #include <QtGui/QPaintEvent> #include <QtWidgets/QWidget> #include "binaryninjaapi.h" #include "dockhandler.h" #include "uitypes.h" class ContextMenuManager; class DisassemblyView; class Menu; class ViewFrame; class BINARYNINJAUIAPI MiniGraph: public QWidget, public DockContextHandler { Q_OBJECT DisassemblyView* m_disassemblyView = nullptr; public: MiniGraph(QWidget* parent); ~MiniGraph(); virtual void notifyViewChanged(ViewFrame* frame) override; virtual bool shouldBeVisible(ViewFrame* frame) override; protected: virtual void contextMenuEvent(QContextMenuEvent* event) override; virtual void mouseMoveEvent(QMouseEvent* event) override; virtual void mousePressEvent(QMouseEvent* event) override; virtual void paintEvent(QPaintEvent* event) override; virtual void scrollTo(int x, int y); public Q_SLOTS: void notifyUpdate(); };
#pragma once #include <QtGui/QMouseEvent> #include <QtGui/QPaintEvent> #include <QtWidgets/QWidget> #include "binaryninjaapi.h" #include "dockhandler.h" #include "uitypes.h" class ContextMenuManager; class FlowGraphWidget; class Menu; class ViewFrame; class BINARYNINJAUIAPI MiniGraph: public QWidget, public DockContextHandler { Q_OBJECT FlowGraphWidget* m_flowGraphWidget = nullptr; public: MiniGraph(QWidget* parent); ~MiniGraph(); virtual void notifyViewChanged(ViewFrame* frame) override; virtual bool shouldBeVisible(ViewFrame* frame) override; protected: virtual void contextMenuEvent(QContextMenuEvent* event) override; virtual void mouseMoveEvent(QMouseEvent* event) override; virtual void mousePressEvent(QMouseEvent* event) override; virtual void paintEvent(QPaintEvent* event) override; virtual void scrollTo(int x, int y); public Q_SLOTS: void notifyUpdate(); };
Update MiniGraph to work with FlowGraphWidet.
Update MiniGraph to work with FlowGraphWidet.
C
mit
Vector35/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api
2b37c13dcf9f8460bf86c4b9096dcc49aed72a44
src/lib/utils/rotate.h
src/lib/utils/rotate.h
/* * Word Rotation Operations * (C) 1999-2008 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #ifndef BOTAN_WORD_ROTATE_H__ #define BOTAN_WORD_ROTATE_H__ #include <botan/types.h> namespace Botan { /** * Bit rotation left * @param input the input word * @param rot the number of bits to rotate * @return input rotated left by rot bits */ template<typename T> inline T rotate_left(T input, size_t rot) { return (rot == 0) ? input : static_cast<T>((input << rot) | (input >> (8*sizeof(T)-rot)));; } /** * Bit rotation right * @param input the input word * @param rot the number of bits to rotate * @return input rotated right by rot bits */ template<typename T> inline T rotate_right(T input, size_t rot) { return (rot == 0) ? input : static_cast<T>((input >> rot) | (input << (8*sizeof(T)-rot))); } } #endif
/* * Word Rotation Operations * (C) 1999-2008 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #ifndef BOTAN_WORD_ROTATE_H__ #define BOTAN_WORD_ROTATE_H__ #include <botan/types.h> namespace Botan { /** * Bit rotation left * @param input the input word * @param rot the number of bits to rotate * @return input rotated left by rot bits */ template<typename T> inline T rotate_left(T input, size_t rot) { rot %= 8 * sizeof(T); return (rot == 0) ? input : static_cast<T>((input << rot) | (input >> (8*sizeof(T)-rot)));; } /** * Bit rotation right * @param input the input word * @param rot the number of bits to rotate * @return input rotated right by rot bits */ template<typename T> inline T rotate_right(T input, size_t rot) { rot %= 8 * sizeof(T); return (rot == 0) ? input : static_cast<T>((input >> rot) | (input << (8*sizeof(T)-rot))); } } #endif
Allow bit rotation by more than sizeof(T)*8 bits.
Allow bit rotation by more than sizeof(T)*8 bits. Currently these functions will happily bit shift by >= sizeof(T)*8 bits. However, this is undefined behavior, and results in unexpected results (0) on at least one platform I've tested. With this update, you can expect that rotate_left<uint32_t>(1, 32)==1 and rotate_right<uint32_t>(1, 32)==1.
C
bsd-2-clause
randombit/botan,webmaster128/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan