commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
8ea9c9401cca7ea074d0e85ba57b2ccf42630cd7
BBBAPI/BBBAPI/Classes/BBASearchServiceResult.h
BBBAPI/BBBAPI/Classes/BBASearchServiceResult.h
// // BBASearchServiceResult.h // BBBAPI // // Created by Owen Worley on 12/01/2015. // Copyright (c) 2015 Blinkbox Entertainment Ltd. All rights reserved. // #import <Foundation/Foundation.h> @class FEMObjectMapping; /** * Represents data provided from the search service when searching for books */ @interface BBASearchServiceResult : NSObject @property (nonatomic, copy) NSString *type; @property (nonatomic, copy) NSString *identifier; @property (nonatomic, copy) NSArray *links; @property (nonatomic, assign) NSInteger numberOfResults; @property (nonatomic, copy) NSArray *books; /** * Object mapping to convert server search result to `BBASearchServiceResult` */ + (FEMObjectMapping *) searchServiceResultMapping; @end
// // BBASearchServiceResult.h // BBBAPI // // Created by Owen Worley on 12/01/2015. // Copyright (c) 2015 Blinkbox Entertainment Ltd. All rights reserved. // #import <Foundation/Foundation.h> @class FEMObjectMapping; /** * Represents data provided from the search service when searching for books */ @interface BBASearchServiceResult : NSObject @property (nonatomic, copy) NSString *type; @property (nonatomic, copy) NSString *identifier; /** * Array of `BBALibraryItemLink` objects */ @property (nonatomic, copy) NSArray *links; @property (nonatomic, assign) NSInteger numberOfResults; @property (nonatomic, copy) NSArray *books; /** * Object mapping to convert server search result to `BBASearchServiceResult` */ + (FEMObjectMapping *) searchServiceResultMapping; @end
Document contents of Links array
Document contents of Links array
C
mit
blinkboxbooks/blinkbox-network.objc,blinkboxbooks/blinkbox-network.objc
00cbbaa30f3c3336f6bfeea39b8c2699fb43b6e0
inc/osvr/Util/SharedPtr.h
inc/osvr/Util/SharedPtr.h
/** @file @brief Header to bring shared_ptr into the ::osvr namespace. @date 2014 @author Ryan Pavlik <ryan@sensics.com> <http://sensics.com> */ // Copyright 2014 Sensics, Inc. // // All rights reserved. // // (Final version intended to be licensed under // the Apache License, Version 2.0) #ifndef INCLUDED_SharedPtr_h_GUID_E9C5BC8D_7D3A_4896_1552_6F4F5292783C #define INCLUDED_SharedPtr_h_GUID_E9C5BC8D_7D3A_4896_1552_6F4F5292783C #if defined(_MSC_VER) && (_MSC_VER < 1600) #error "Not supported before VS 2010" #else #include <memory> namespace osvr { using std::shared_ptr; using std::make_shared; } // namespace osvr #endif #endif // INCLUDED_SharedPtr_h_GUID_E9C5BC8D_7D3A_4896_1552_6F4F5292783C
/** @file @brief Header to bring shared_ptr into the ::osvr namespace. @date 2014 @author Ryan Pavlik <ryan@sensics.com> <http://sensics.com> */ // Copyright 2014 Sensics, Inc. // // All rights reserved. // // (Final version intended to be licensed under // the Apache License, Version 2.0) #ifndef INCLUDED_SharedPtr_h_GUID_E9C5BC8D_7D3A_4896_1552_6F4F5292783C #define INCLUDED_SharedPtr_h_GUID_E9C5BC8D_7D3A_4896_1552_6F4F5292783C #if defined(_MSC_VER) && (_MSC_VER < 1600) #error "Not supported before VS 2010" #else #include <memory> namespace osvr { using std::shared_ptr; using std::weak_ptr; using std::make_shared; using std::enable_shared_from_this; } // namespace osvr #endif #endif // INCLUDED_SharedPtr_h_GUID_E9C5BC8D_7D3A_4896_1552_6F4F5292783C
Include more items in our namespace with shared_ptr.
Include more items in our namespace with shared_ptr.
C
apache-2.0
leemichaelRazer/OSVR-Core,feilen/OSVR-Core,godbyk/OSVR-Core,godbyk/OSVR-Core,Armada651/OSVR-Core,OSVR/OSVR-Core,godbyk/OSVR-Core,OSVR/OSVR-Core,Armada651/OSVR-Core,leemichaelRazer/OSVR-Core,feilen/OSVR-Core,Armada651/OSVR-Core,godbyk/OSVR-Core,godbyk/OSVR-Core,Armada651/OSVR-Core,d235j/OSVR-Core,leemichaelRazer/OSVR-Core,OSVR/OSVR-Core,feilen/OSVR-Core,leemichaelRazer/OSVR-Core,godbyk/OSVR-Core,OSVR/OSVR-Core,d235j/OSVR-Core,d235j/OSVR-Core,Armada651/OSVR-Core,d235j/OSVR-Core,feilen/OSVR-Core,OSVR/OSVR-Core,leemichaelRazer/OSVR-Core,OSVR/OSVR-Core,d235j/OSVR-Core,feilen/OSVR-Core
579bb01db2d8b21d3de6223c6305eb94f3fc92f2
src/sampgdk.c
src/sampgdk.c
#include "sampgdk.h" #if SAMPGDK_WINDOWS #undef CreateMenu #undef DestroyMenu #undef GetTickCount #undef KillTimer #undef SelectObject #undef SetTimer #include <windows.h> #endif
#include "sampgdk.h" #if SAMPGDK_WINDOWS #undef CreateMenu #undef DestroyMenu #undef GetTickCount #undef KillTimer #undef SelectObject #undef SetTimer #define WIN32_LEAN_AND_MEAN #include <windows.h> #else #define _GNU_SOURCE #endif
Copy some definitions from CMakeLists.txt to preamble
Copy some definitions from CMakeLists.txt to preamble
C
apache-2.0
WopsS/sampgdk,Zeex/sampgdk,WopsS/sampgdk,Zeex/sampgdk,WopsS/sampgdk,Zeex/sampgdk
1b09860dd29bdf741fff1f20c28abff817f88cd1
CreamMonkey.h
CreamMonkey.h
#import <Cocoa/Cocoa.h> @interface CreamMonkey : NSObject { } @end
/* * Copyright (c) 2006 KATO Kazuyoshi <kzys@8-p.info> * This source code is released under the MIT license. */ #import <Cocoa/Cocoa.h> @interface CreamMonkey : NSObject { } @end
Add copyright and license header.
Add copyright and license header.
C
mit
torezzz/greasekit
de50503cc4ef90f8e0eaa9786303bcc287284e33
hardware/main.c
hardware/main.c
#include <avr/io.h> #include <util/delay.h> #include <avr/interrupt.h> #include "deps/util.h" #include "deps/rcswitch/rcswitch.h" #define PIN_RC PB2 #include "deps/softuart/softuart.h" #include "packet.h" int main(void) { // initialize serial softuart_init(); // enable interrupts sei(); // enable the rc switch rcswitch_enable(PIN_RC); while (1) { // if there is some data waiting for us if (softuart_kbhit()) { // parse the data struct Packet packet; binary_to_packet(&packet, softuart_getchar()); // handle the packet if (packet.status) { rcswitch_switch_on(packet.group + 1, packet.plug + 1); } else { rcswitch_switch_off(packet.group + 1, packet.plug + 1); } } } return 0; }
#include <avr/io.h> #include <avr/interrupt.h> #include "deps/rcswitch/rcswitch.h" #include "deps/softuart/softuart.h" #include "packet.h" #define PIN_RC PB2 int main(void) { // initialize serial softuart_init(); // enable interrupts sei(); // enable the rc switch rcswitch_enable(PIN_RC); while (1) { // if there is some data waiting for us if (softuart_kbhit()) { // parse the data struct Packet packet; binary_to_packet(&packet, softuart_getchar()); // handle the packet if (packet.status) { rcswitch_switch_on(packet.group + 1, packet.plug + 1); } else { rcswitch_switch_off(packet.group + 1, packet.plug + 1); } } } return 0; }
Remove unused includes and move rc pin definition
Remove unused includes and move rc pin definition
C
agpl-3.0
jackwilsdon/lightcontrol,jackwilsdon/lightcontrol
54ed8514134558d13ab53b81f9d94836e036f351
src/thsh.c
src/thsh.c
/* ============================================================================ Name : thsh.c Authors : Collin Kruger, Denton Underwood, John Christensen, Jon Stacey Version : Copyright : Copyright 2009 Jon Stacey. All rights reserved. Description : Hello World in C, Ansi-style ============================================================================ */ #include <stdio.h> #include <stdlib.h> int main(void) { puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ return EXIT_SUCCESS; }
/* ============================================================================ Name : thsh.c Authors : Collin Kruger, Denton Underwood, John Christensen, Jon Stacey Version : Copyright : Copyright 2009 Jon Stacey. All rights reserved. Description : Hello World in C, Ansi-style ============================================================================ */ #include <stdio.h> #include <stdlib.h> extern char **environ; void printEnVars() { char **env = environ; printf("\n"); printf("%s\n", "--These are the environmental variables--"); while(*env) { printf("%s\n", *env); env++; } } int main(int argc, char *argv[], char *envp[]) { /////////////////////////////////////////////////////// - Print Args printf("%s\n", "--This is the total number of args--"); printf("%s", "argc | "); printf("%i\n", argc); printf("\n"); printf("%s\n", "--These are the argument characters--"); int i; for (i = 0; i < argc; i++) { printf("%i", i); printf("%s", " | "); printf("%s\n", argv[i]); } /////////////////////////////////////////////////////// - Print all Environment Variables printEnVars(); /////////////////////////////////////////////////////// - Finished printf("\n"); printf("%s\n", "Exited Program"); return 0; }
Add environment vars and commandline arguments
Add environment vars and commandline arguments
C
mit
jmstacey/thsh
b1a0e5ae8b3e3d1052cc7c3e3ec12750060cb173
db/functions/quadtile.c
db/functions/quadtile.c
#include <my_global.h> #include <my_sys.h> #include <m_string.h> #include <mysql.h> #include <quad_tile.h> my_bool tile_for_point_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if ( args->arg_count != 2 || args->arg_type[0] != INT_RESULT || args->arg_type[1] != INT_RESULT ) { strcpy( message, "Your tile_for_point arguments are bogus!" ); return 1; } return 0; } void tile_for_point_deinit(UDF_INIT *initid) { return; } long long tile_for_point(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error) { long long lon = *(long long *)args->args[0]; long long lat = *(long long *)args->args[1]; return xy2tile(lon2x(lon / 1000000.0), lat2y(lat / 1000000.0)); }
#include <my_global.h> #include <my_sys.h> #include <m_string.h> #include <mysql.h> #include <quad_tile.h> my_bool tile_for_point_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { if ( args->arg_count != 2 || args->arg_type[0] != INT_RESULT || args->arg_type[1] != INT_RESULT ) { strcpy( message, "Your tile_for_point arguments are bogus!" ); return 1; } return 0; } void tile_for_point_deinit(UDF_INIT *initid) { return; } long long tile_for_point(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error) { long long lat = *(long long *)args->args[0]; long long lon = *(long long *)args->args[1]; return xy2tile(lon2x(lon / 1000000.0), lat2y(lat / 1000000.0)); }
Make the MySQL tile_for_point function take arguments in the same order as the ruby version.
Make the MySQL tile_for_point function take arguments in the same order as the ruby version.
C
agpl-3.0
tillmo/do-roam,tillmo/do-roam,tillmo/do-roam,tillmo/do-roam,tillmo/do-roam,tillmo/do-roam
c33abbf19bc02e90c1b020534e3ccbb2ed4754a5
native/helper.h
native/helper.h
#ifndef HELPER_H #define HELPER_H #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) #define AT() __FILE__ ":" TOSTRING(__LINE__) #ifdef DO_DEBUG #include <iostream> #include <mutex> extern std::mutex log_mutex; #define DEBUG(x) do { std::lock_guard<std::mutex> guard(log_mutex); std::cerr << "[libnice] " << x << " (@" << AT() << ")" << std::endl; } while (0) #else #define DEBUG(x) #endif static inline std::string trim(const std::string& str, const std::string& target=" \r\n\t") { const size_t first = str.find_first_not_of(target); if(first == std::string::npos) { return std::string(); } else { const size_t last = str.find_last_not_of(target); return str.substr(first, last - first + 1); } } #endif /* HELPER_H */
#ifndef HELPER_H #define HELPER_H #include <string> #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) #define AT() __FILE__ ":" TOSTRING(__LINE__) #ifdef DO_DEBUG #include <iostream> #include <mutex> extern std::mutex log_mutex; #define DEBUG(x) do { std::lock_guard<std::mutex> guard(log_mutex); std::cerr << "[libnice] " << x << " (@" << AT() << ")" << std::endl; } while (0) #else #define DEBUG(x) #endif static inline std::string trim(const std::string& str, const std::string& target=" \r\n\t") { const size_t first = str.find_first_not_of(target); if(first == std::string::npos) { return std::string(); } else { const size_t last = str.find_last_not_of(target); return str.substr(first, last - first + 1); } } #endif /* HELPER_H */
Add missing header in case of no debug output
Add missing header in case of no debug output
C
agpl-3.0
felixSchl/node-libnice,felixSchl/node-libnice,Innovailable/node-libnice,Innovailable/node-libnice,Innovailable/node-libnice,felixSchl/node-libnice
564fdcbc609fbc48435a061513fa8400e475fa2b
hw3-gen-andes-code/test1.c
hw3-gen-andes-code/test1.c
int main(){ int a; int b = 1; int c = 2; int d = 3; a = 10/2; c = (b+3)*4-5; //printf(“a is %d\n",a); return 0 }
int main(){ int a; int b = 1; int c = 2; int d = 3; a = 10/2; c = (b+3)*4-5; //printf(“a is %d\n",a); return 0; }
Fix typo in test case
Fix typo in test case
C
mit
hydai/Compiler-Design
008db442efa542357314593c71ab9966be909855
sound/soc/codecs/wm8350.h
sound/soc/codecs/wm8350.h
/* * wm8350.h - WM8903 audio codec interface * * Copyright 2008 Wolfson Microelectronics PLC. * * 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. */ #ifndef _WM8350_H #define _WM8350_H #include <sound/soc.h> extern struct snd_soc_dai wm8350_dai; extern struct snd_soc_codec_device soc_codec_dev_wm8350; enum wm8350_jack { WM8350_JDL = 1, WM8350_JDR = 2, }; int wm8350_hp_jack_detect(struct snd_soc_codec *codec, enum wm8350_jack which, struct snd_soc_jack *jack, int report); #endif
/* * wm8350.h - WM8903 audio codec interface * * Copyright 2008 Wolfson Microelectronics PLC. * * 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. */ #ifndef _WM8350_H #define _WM8350_H #include <sound/soc.h> #include <linux/mfd/wm8350/audio.h> extern struct snd_soc_dai wm8350_dai; extern struct snd_soc_codec_device soc_codec_dev_wm8350; enum wm8350_jack { WM8350_JDL = 1, WM8350_JDR = 2, }; int wm8350_hp_jack_detect(struct snd_soc_codec *codec, enum wm8350_jack which, struct snd_soc_jack *jack, int report); #endif
Include WM8350 register definitions in CODEC header
ASoC: Include WM8350 register definitions in CODEC header It's expected behaviour for the CODEC header to provide them but the WM8350 doesn't due to having all the registers together under drivers/mfd. Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas
a90e572e67f094d59faad390e41d9f8791900f89
redditAPI/RAPRedditLinks.h
redditAPI/RAPRedditLinks.h
// // RAPRedditLinks.h // redditAPI // // Created by Woudini on 2/3/15. // Copyright (c) 2015 Hi Range. All rights reserved. // #ifndef redditAPI_RAPRedditLinks_h #define redditAPI_RAPRedditLinks_h #define RAPRedditLimit_10_typePrefix_Link_ @"?limit=10?&after=t3_%@" #define RAPSubredditNew @"r/%@/new.json?limit=10" #define RAPSubredditHot @"r/%@/hot.json?limit=10" #define RAPThreadComments @"r/%@/.json" #endif
// // RAPRedditLinks.h // redditAPI // // Created by Woudini on 2/3/15. // Copyright (c) 2015 Hi Range. All rights reserved. // #ifndef redditAPI_RAPRedditLinks_h #define redditAPI_RAPRedditLinks_h #define RAPRedditLimit_10_typePrefix_Link_ @".json?limit=10?&after=t3_%@" #define RAPSubredditNew @"r/%@/new.json?limit=10" #define RAPSubredditHot @"r/%@/hot.json?limit=10" #define RAPThreadComments @"r/%@/.json" #endif
Fix json additional fetch in frontpage
Fix json additional fetch in frontpage
C
mit
woudini/lzytltbrwsr
ef27bd42a368bb3c3886e07a79f751ab41f7ff92
SettingsUI/Hotkeys.h
SettingsUI/Hotkeys.h
#pragma once #include "afxwin.h" #include "afxcmn.h" class Hotkeys : public CPropertyPage { DECLARE_DYNAMIC(Hotkeys) public: Hotkeys(); virtual ~Hotkeys(); // Dialog Data enum { IDD = IDD_HOTKEYS }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() private: void SelectItem(int idx); private: CComboBox _action; CButton _keys; CListCtrl _list; afx_msg void OnBnClickedAdd(); afx_msg void OnBnClickedRemove(); afx_msg void OnLvnItemchangedKeys(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnBnClickedKeys(); };
#pragma once #include "afxwin.h" #include "afxcmn.h" #include <vector> #include "HotkeyInfo.h" class Hotkeys : public CPropertyPage { DECLARE_DYNAMIC(Hotkeys) public: Hotkeys(); virtual ~Hotkeys(); enum { IDD = IDD_HOTKEYS }; protected: virtual void DoDataExchange(CDataExchange* pDX); virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() private: std::vector<HotkeyInfo> _keyInfo; void SelectItem(int idx); private: CComboBox _action; CButton _keys; CListCtrl _list; afx_msg void OnBnClickedAdd(); afx_msg void OnBnClickedRemove(); afx_msg void OnLvnItemchangedKeys(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnBnClickedKeys(); };
Add list to contain hotkey info
Add list to contain hotkey info
C
bsd-2-clause
Soulflare3/3RVX,Soulflare3/3RVX,malensek/3RVX,malensek/3RVX,malensek/3RVX,Soulflare3/3RVX
cc628b8c1b2227cad240ed1c12d10636e91145cc
sdk/objc/base/RTCMacros.h
sdk/objc/base/RTCMacros.h
/* * Copyright 2016 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef SDK_OBJC_BASE_RTCMACROS_H_ #define SDK_OBJC_BASE_RTCMACROS_H_ #define RTC_OBJC_EXPORT __attribute__((visibility("default"))) // TODO(mbonadei): Remove RTC_EXPORT in order to be able to land // https://webrtc-review.googlesource.com/c/src/+/97960. #define RTC_EXPORT RTC_OBJC_EXPORT #if defined(__cplusplus) #define RTC_EXTERN extern "C" RTC_OBJC_EXPORT #else #define RTC_EXTERN extern RTC_OBJC_EXPORT #endif #ifdef __OBJC__ #define RTC_FWD_DECL_OBJC_CLASS(classname) @class classname #else #define RTC_FWD_DECL_OBJC_CLASS(classname) typedef struct objc_object classname #endif #endif // SDK_OBJC_BASE_RTCMACROS_H_
/* * Copyright 2016 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef SDK_OBJC_BASE_RTCMACROS_H_ #define SDK_OBJC_BASE_RTCMACROS_H_ #define RTC_OBJC_EXPORT __attribute__((visibility("default"))) #if defined(__cplusplus) #define RTC_EXTERN extern "C" RTC_OBJC_EXPORT #else #define RTC_EXTERN extern RTC_OBJC_EXPORT #endif #ifdef __OBJC__ #define RTC_FWD_DECL_OBJC_CLASS(classname) @class classname #else #define RTC_FWD_DECL_OBJC_CLASS(classname) typedef struct objc_object classname #endif #endif // SDK_OBJC_BASE_RTCMACROS_H_
Remove backwards compatible macro RTC_EXPORT from sdk/.
Remove backwards compatible macro RTC_EXPORT from sdk/. Symbols under sdk/ are now exported using RTC_OBJC_EXPORT, while RTC_EXPORT is used for C++ symbols. Bug: webrtc:9419 Change-Id: Icdf7ee0e7b3faf4d7fec33e9b33a3b13260f45b7 Reviewed-on: https://webrtc-review.googlesource.com/102461 Reviewed-by: Peter Hanspers <d02e325c30aa6f5b5d3f28abcc70f6d579033e9e@webrtc.org> Commit-Queue: Mirko Bonadei <d2c43c210eae6feef04f53bae50885e8152edcca@webrtc.org> Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#24886}
C
bsd-3-clause
TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc
5f400303acd4dd821005cc04f0ae873475cd2133
native/v8_extensions/git.h
native/v8_extensions/git.h
#include "include/cef_base.h" #include "include/cef_v8.h" namespace v8_extensions { class Git : public CefV8Handler { public: Git(); virtual bool Execute(const CefString& name, CefRefPtr<CefV8Value> object, const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval, CefString& exception) OVERRIDE; // Provide the reference counting implementation for this class. IMPLEMENT_REFCOUNTING(Native); }; }
#include "include/cef_base.h" #include "include/cef_v8.h" namespace v8_extensions { class Git : public CefV8Handler { public: Git(); virtual bool Execute(const CefString& name, CefRefPtr<CefV8Value> object, const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval, CefString& exception) OVERRIDE; // Provide the reference counting implementation for this class. IMPLEMENT_REFCOUNTING(Git); }; }
Add ref counting to Git class
Add ref counting to Git class
C
mit
jtrose2/atom,dijs/atom,russlescai/atom,seedtigo/atom,nrodriguez13/atom,DiogoXRP/atom,hharchani/atom,devmario/atom,davideg/atom,liuderchi/atom,johnrizzo1/atom,h0dgep0dge/atom,hagb4rd/atom,codex8/atom,kdheepak89/atom,RobinTec/atom,Hasimir/atom,niklabh/atom,champagnez/atom,prembasumatary/atom,bradgearon/atom,t9md/atom,me-benni/atom,Neron-X5/atom,Ju2ender/atom,KENJU/atom,toqz/atom,mostafaeweda/atom,avdg/atom,Hasimir/atom,sebmck/atom,scv119/atom,bcoe/atom,woss/atom,kevinrenaers/atom,tanin47/atom,hharchani/atom,execjosh/atom,FIT-CSE2410-A-Bombs/atom,hpham04/atom,ali/atom,cyzn/atom,florianb/atom,jtrose2/atom,mdumrauf/atom,yalexx/atom,bcoe/atom,ashneo76/atom,russlescai/atom,fredericksilva/atom,amine7536/atom,AlisaKiatkongkumthon/atom,brumm/atom,AdrianVovk/substance-ide,erikhakansson/atom,Hasimir/atom,beni55/atom,vjeux/atom,john-kelly/atom,Ingramz/atom,GHackAnonymous/atom,nvoron23/atom,hellendag/atom,lovesnow/atom,efatsi/atom,johnrizzo1/atom,matthewclendening/atom,toqz/atom,Austen-G/BlockBuilder,oggy/atom,yangchenghu/atom,rjattrill/atom,bradgearon/atom,Abdillah/atom,Ju2ender/atom,lovesnow/atom,acontreras89/atom,nvoron23/atom,sillvan/atom,vcarrera/atom,bcoe/atom,ilovezy/atom,001szymon/atom,sebmck/atom,fscherwi/atom,sekcheong/atom,RobinTec/atom,mertkahyaoglu/atom,nucked/atom,SlimeQ/atom,constanzaurzua/atom,ObviouslyGreen/atom,abe33/atom,AlbertoBarrago/atom,fedorov/atom,Arcanemagus/atom,basarat/atom,tjkr/atom,mostafaeweda/atom,Galactix/atom,boomwaiza/atom,vjeux/atom,vinodpanicker/atom,Jonekee/atom,sillvan/atom,sebmck/atom,mostafaeweda/atom,qskycolor/atom,yomybaby/atom,liuderchi/atom,ardeshirj/atom,liuxiong332/atom,PKRoma/atom,basarat/atom,oggy/atom,tjkr/atom,boomwaiza/atom,Andrey-Pavlov/atom,Neron-X5/atom,pkdevbox/atom,deoxilix/atom,Austen-G/BlockBuilder,Abdillah/atom,efatsi/atom,acontreras89/atom,bolinfest/atom,efatsi/atom,isghe/atom,ralphtheninja/atom,russlescai/atom,qiujuer/atom,ilovezy/atom,constanzaurzua/atom,NunoEdgarGub1/atom,isghe/atom,wiggzz/atom,Abdillah/atom,ezeoleaf/atom,sekcheong/atom,stuartquin/atom,FoldingText/atom,dannyflax/atom,mnquintana/atom,niklabh/atom,devoncarew/atom,yalexx/atom,yamhon/atom,jordanbtucker/atom,mdumrauf/atom,wiggzz/atom,Shekharrajak/atom,ilovezy/atom,qskycolor/atom,kittens/atom,dkfiresky/atom,targeter21/atom,FoldingText/atom,Rodjana/atom,champagnez/atom,Andrey-Pavlov/atom,isghe/atom,Rychard/atom,abcP9110/atom,Locke23rus/atom,Ingramz/atom,KENJU/atom,gisenberg/atom,deepfox/atom,russlescai/atom,qskycolor/atom,alfredxing/atom,ironbox360/atom,bencolon/atom,xream/atom,elkingtonmcb/atom,liuderchi/atom,pkdevbox/atom,0x73/atom,devoncarew/atom,cyzn/atom,cyzn/atom,alexandergmann/atom,hharchani/atom,Hasimir/atom,pengshp/atom,synaptek/atom,amine7536/atom,atom/atom,deepfox/atom,fedorov/atom,kittens/atom,folpindo/atom,Jandersoft/atom,BogusCurry/atom,CraZySacX/atom,kdheepak89/atom,mostafaeweda/atom,ilovezy/atom,Jandersolutions/atom,constanzaurzua/atom,n-riesco/atom,qiujuer/atom,Andrey-Pavlov/atom,devoncarew/atom,me6iaton/atom,vcarrera/atom,chengky/atom,yomybaby/atom,vcarrera/atom,jjz/atom,bencolon/atom,charleswhchan/atom,ezeoleaf/atom,rjattrill/atom,me-benni/atom,targeter21/atom,0x73/atom,KENJU/atom,jacekkopecky/atom,bryonwinger/atom,hakatashi/atom,vjeux/atom,rsvip/aTom,stinsonga/atom,Jdesk/atom,einarmagnus/atom,medovob/atom,CraZySacX/atom,stinsonga/atom,AlisaKiatkongkumthon/atom,Abdillah/atom,yamhon/atom,tony612/atom,Ju2ender/atom,sxgao3001/atom,stinsonga/atom,woss/atom,helber/atom,hakatashi/atom,rjattrill/atom,t9md/atom,medovob/atom,hpham04/atom,sxgao3001/atom,woss/atom,gisenberg/atom,dijs/atom,ppamorim/atom,deoxilix/atom,h0dgep0dge/atom,mnquintana/atom,einarmagnus/atom,sillvan/atom,Jandersolutions/atom,Dennis1978/atom,Sangaroonaom/atom,nrodriguez13/atom,Klozz/atom,jjz/atom,rlugojr/atom,phord/atom,basarat/atom,FIT-CSE2410-A-Bombs/atom,Neron-X5/atom,abcP9110/atom,Austen-G/BlockBuilder,gontadu/atom,woss/atom,n-riesco/atom,beni55/atom,transcranial/atom,kandros/atom,RobinTec/atom,phord/atom,chengky/atom,johnhaley81/atom,devmario/atom,einarmagnus/atom,jtrose2/atom,splodingsocks/atom,Jandersolutions/atom,matthewclendening/atom,AlbertoBarrago/atom,ali/atom,codex8/atom,decaffeinate-examples/atom,svanharmelen/atom,andrewleverette/atom,decaffeinate-examples/atom,burodepeper/atom,dkfiresky/atom,amine7536/atom,ralphtheninja/atom,h0dgep0dge/atom,helber/atom,Neron-X5/atom,brettle/atom,sotayamashita/atom,Galactix/atom,ppamorim/atom,mrodalgaard/atom,ezeoleaf/atom,Jdesk/atom,Jandersolutions/atom,sxgao3001/atom,darwin/atom,originye/atom,liuxiong332/atom,chengky/atom,scv119/atom,jacekkopecky/atom,ReddTea/atom,champagnez/atom,kdheepak89/atom,Rychard/atom,isghe/atom,xream/atom,MjAbuz/atom,Neron-X5/atom,Abdillah/atom,florianb/atom,bradgearon/atom,gabrielPeart/atom,rsvip/aTom,gzzhanghao/atom,johnrizzo1/atom,kc8wxm/atom,ReddTea/atom,SlimeQ/atom,burodepeper/atom,jeremyramin/atom,alfredxing/atom,paulcbetts/atom,codex8/atom,paulcbetts/atom,rsvip/aTom,panuchart/atom,GHackAnonymous/atom,001szymon/atom,boomwaiza/atom,lisonma/atom,medovob/atom,codex8/atom,decaffeinate-examples/atom,pombredanne/atom,florianb/atom,abcP9110/atom,einarmagnus/atom,davideg/atom,crazyquark/atom,constanzaurzua/atom,Jdesk/atom,sotayamashita/atom,AdrianVovk/substance-ide,Jonekee/atom,dsandstrom/atom,brumm/atom,ardeshirj/atom,kittens/atom,toqz/atom,ykeisuke/atom,dannyflax/atom,Mokolea/atom,AlexxNica/atom,gzzhanghao/atom,ivoadf/atom,mostafaeweda/atom,omarhuanca/atom,palita01/atom,lovesnow/atom,execjosh/atom,rookie125/atom,BogusCurry/atom,yamhon/atom,bryonwinger/atom,davideg/atom,ali/atom,YunchengLiao/atom,mdumrauf/atom,decaffeinate-examples/atom,fredericksilva/atom,devoncarew/atom,MjAbuz/atom,tanin47/atom,bryonwinger/atom,johnhaley81/atom,splodingsocks/atom,Jandersolutions/atom,basarat/atom,targeter21/atom,deoxilix/atom,GHackAnonymous/atom,anuwat121/atom,batjko/atom,abcP9110/atom,0x73/atom,prembasumatary/atom,helber/atom,alexandergmann/atom,bcoe/atom,qiujuer/atom,Locke23rus/atom,KENJU/atom,nvoron23/atom,xream/atom,prembasumatary/atom,oggy/atom,Rychard/atom,PKRoma/atom,G-Baby/atom,ashneo76/atom,kjav/atom,atom/atom,batjko/atom,YunchengLiao/atom,GHackAnonymous/atom,acontreras89/atom,hpham04/atom,Sangaroonaom/atom,splodingsocks/atom,jacekkopecky/atom,AlexxNica/atom,tanin47/atom,ykeisuke/atom,jlord/atom,deepfox/atom,kjav/atom,bj7/atom,charleswhchan/atom,devoncarew/atom,Ingramz/atom,hellendag/atom,stuartquin/atom,russlescai/atom,jlord/atom,gzzhanghao/atom,harshdattani/atom,jacekkopecky/atom,mertkahyaoglu/atom,anuwat121/atom,Jandersoft/atom,Huaraz2/atom,yangchenghu/atom,seedtigo/atom,Arcanemagus/atom,Arcanemagus/atom,chfritz/atom,abe33/atom,MjAbuz/atom,jlord/atom,ReddTea/atom,constanzaurzua/atom,Jandersoft/atom,rxkit/atom,sekcheong/atom,chengky/atom,rlugojr/atom,Galactix/atom,synaptek/atom,rjattrill/atom,sebmck/atom,rmartin/atom,scippio/atom,hagb4rd/atom,fredericksilva/atom,Dennis1978/atom,targeter21/atom,pombredanne/atom,BogusCurry/atom,YunchengLiao/atom,jeremyramin/atom,hpham04/atom,crazyquark/atom,Jandersoft/atom,FoldingText/atom,gontadu/atom,john-kelly/atom,jjz/atom,qskycolor/atom,0x73/atom,prembasumatary/atom,bsmr-x-script/atom,dannyflax/atom,matthewclendening/atom,tmunro/atom,rookie125/atom,kaicataldo/atom,ppamorim/atom,dkfiresky/atom,splodingsocks/atom,lpommers/atom,fedorov/atom,alfredxing/atom,Shekharrajak/atom,svanharmelen/atom,MjAbuz/atom,jtrose2/atom,originye/atom,basarat/atom,basarat/atom,mnquintana/atom,Sangaroonaom/atom,ppamorim/atom,NunoEdgarGub1/atom,kevinrenaers/atom,sillvan/atom,lpommers/atom,omarhuanca/atom,Ju2ender/atom,dsandstrom/atom,AlexxNica/atom,bcoe/atom,001szymon/atom,lisonma/atom,rsvip/aTom,einarmagnus/atom,kdheepak89/atom,harshdattani/atom,acontreras89/atom,g2p/atom,mertkahyaoglu/atom,CraZySacX/atom,G-Baby/atom,Shekharrajak/atom,Andrey-Pavlov/atom,matthewclendening/atom,ilovezy/atom,batjko/atom,avdg/atom,gisenberg/atom,kittens/atom,chfritz/atom,daxlab/atom,FIT-CSE2410-A-Bombs/atom,dannyflax/atom,niklabh/atom,sotayamashita/atom,omarhuanca/atom,rxkit/atom,tjkr/atom,stuartquin/atom,YunchengLiao/atom,Hasimir/atom,sillvan/atom,scippio/atom,rmartin/atom,ppamorim/atom,liuxiong332/atom,gontadu/atom,johnhaley81/atom,kaicataldo/atom,vhutheesing/atom,deepfox/atom,tisu2tisu/atom,pombredanne/atom,kjav/atom,burodepeper/atom,folpindo/atom,PKRoma/atom,lisonma/atom,nvoron23/atom,n-riesco/atom,AlisaKiatkongkumthon/atom,tony612/atom,transcranial/atom,bj7/atom,sebmck/atom,hpham04/atom,fedorov/atom,ashneo76/atom,fang-yufeng/atom,atom/atom,fscherwi/atom,fang-yufeng/atom,panuchart/atom,hagb4rd/atom,jacekkopecky/atom,yomybaby/atom,harshdattani/atom,gisenberg/atom,devmario/atom,vinodpanicker/atom,ivoadf/atom,lisonma/atom,jtrose2/atom,hellendag/atom,woss/atom,tisu2tisu/atom,crazyquark/atom,kaicataldo/atom,SlimeQ/atom,davideg/atom,dsandstrom/atom,lisonma/atom,tony612/atom,avdg/atom,DiogoXRP/atom,rsvip/aTom,h0dgep0dge/atom,florianb/atom,fang-yufeng/atom,yalexx/atom,AdrianVovk/substance-ide,Huaraz2/atom,pengshp/atom,mertkahyaoglu/atom,tmunro/atom,darwin/atom,davideg/atom,FoldingText/atom,NunoEdgarGub1/atom,fscherwi/atom,ironbox360/atom,toqz/atom,dkfiresky/atom,AlbertoBarrago/atom,SlimeQ/atom,acontreras89/atom,erikhakansson/atom,fedorov/atom,yomybaby/atom,Locke23rus/atom,jjz/atom,john-kelly/atom,Andrey-Pavlov/atom,Austen-G/BlockBuilder,Huaraz2/atom,G-Baby/atom,batjko/atom,me-benni/atom,vjeux/atom,nucked/atom,RuiDGoncalves/atom,charleswhchan/atom,hakatashi/atom,bsmr-x-script/atom,vinodpanicker/atom,rookie125/atom,vinodpanicker/atom,bsmr-x-script/atom,devmario/atom,john-kelly/atom,ReddTea/atom,ObviouslyGreen/atom,fredericksilva/atom,tmunro/atom,jordanbtucker/atom,bolinfest/atom,paulcbetts/atom,dijs/atom,hharchani/atom,yalexx/atom,omarhuanca/atom,qiujuer/atom,ivoadf/atom,beni55/atom,vcarrera/atom,pombredanne/atom,scv119/atom,anuwat121/atom,lovesnow/atom,hakatashi/atom,n-riesco/atom,erikhakansson/atom,john-kelly/atom,Galactix/atom,crazyquark/atom,palita01/atom,scippio/atom,me6iaton/atom,vcarrera/atom,hagb4rd/atom,Klozz/atom,bj7/atom,sekcheong/atom,yangchenghu/atom,Rodjana/atom,GHackAnonymous/atom,abcP9110/atom,ralphtheninja/atom,qskycolor/atom,phord/atom,synaptek/atom,brettle/atom,vhutheesing/atom,rmartin/atom,Mokolea/atom,dsandstrom/atom,ironbox360/atom,synaptek/atom,DiogoXRP/atom,kjav/atom,githubteacher/atom,mnquintana/atom,bolinfest/atom,t9md/atom,Austen-G/BlockBuilder,bryonwinger/atom,gabrielPeart/atom,RobinTec/atom,pkdevbox/atom,yomybaby/atom,tisu2tisu/atom,MjAbuz/atom,jlord/atom,qiujuer/atom,RuiDGoncalves/atom,prembasumatary/atom,hagb4rd/atom,brettle/atom,SlimeQ/atom,nucked/atom,kjav/atom,ali/atom,elkingtonmcb/atom,yalexx/atom,kittens/atom,pengshp/atom,kdheepak89/atom,ObviouslyGreen/atom,kc8wxm/atom,dannyflax/atom,Galactix/atom,kc8wxm/atom,liuxiong332/atom,amine7536/atom,charleswhchan/atom,alexandergmann/atom,jlord/atom,Dennis1978/atom,RobinTec/atom,amine7536/atom,rlugojr/atom,liuderchi/atom,jeremyramin/atom,ardeshirj/atom,palita01/atom,folpindo/atom,isghe/atom,codex8/atom,ali/atom,kevinrenaers/atom,rmartin/atom,sxgao3001/atom,Ju2ender/atom,NunoEdgarGub1/atom,me6iaton/atom,g2p/atom,paulcbetts/atom,charleswhchan/atom,dkfiresky/atom,nvoron23/atom,andrewleverette/atom,darwin/atom,Shekharrajak/atom,n-riesco/atom,synaptek/atom,sxgao3001/atom,rxkit/atom,chengky/atom,githubteacher/atom,pombredanne/atom,jordanbtucker/atom,chfritz/atom,scv119/atom,kc8wxm/atom,matthewclendening/atom,FoldingText/atom,tony612/atom,oggy/atom,jjz/atom,fang-yufeng/atom,batjko/atom,Jdesk/atom,daxlab/atom,stinsonga/atom,kandros/atom,githubteacher/atom,gisenberg/atom,RuiDGoncalves/atom,Jandersoft/atom,targeter21/atom,devmario/atom,Rodjana/atom,Klozz/atom,crazyquark/atom,andrewleverette/atom,Austen-G/BlockBuilder,Jdesk/atom,florianb/atom,elkingtonmcb/atom,fang-yufeng/atom,KENJU/atom,YunchengLiao/atom,kc8wxm/atom,mnquintana/atom,brumm/atom,sekcheong/atom,abe33/atom,seedtigo/atom,transcranial/atom,dsandstrom/atom,liuxiong332/atom,me6iaton/atom,svanharmelen/atom,Mokolea/atom,lovesnow/atom,Jonekee/atom,vjeux/atom,toqz/atom,jacekkopecky/atom,wiggzz/atom,ezeoleaf/atom,bencolon/atom,fredericksilva/atom,g2p/atom,nrodriguez13/atom,mrodalgaard/atom,gabrielPeart/atom,mrodalgaard/atom,vhutheesing/atom,panuchart/atom,lpommers/atom,kandros/atom,daxlab/atom,NunoEdgarGub1/atom,ykeisuke/atom,omarhuanca/atom,mertkahyaoglu/atom,ReddTea/atom,Shekharrajak/atom,hharchani/atom,oggy/atom,tony612/atom,dannyflax/atom,rmartin/atom,FoldingText/atom,vinodpanicker/atom,originye/atom,execjosh/atom,deepfox/atom,me6iaton/atom
4ebe6c82223445eaf08ef58f8abb031c8b5297b9
tests/test_stdlib.c
tests/test_stdlib.c
#include <stdlib.h> #include "seatest.h" static void test_abs (void) { // abs assert_true(abs(0) == 0); assert_true(abs(1) == 1); assert_true(abs(INT_MAX) == INT_MAX); assert_true(abs(-1) == 1); // labs assert_true(labs(0) == 0); assert_true(labs(1) == 1); assert_true(labs(LONG_MAX) == LONG_MAX); assert_true(labs(-1) == 1); // llabs assert_true(llabs(0) == 0); assert_true(llabs(1) == 1); assert_true(llabs(LLONG_MAX) == LLONG_MAX); assert_true(llabs(-1) == 1); } void test_stdlib (void) { test_fixture_start(); run_test(test_abs); test_fixture_end(); }
#include <stdlib.h> #include "seatest.h" static void test_abs (void) { // abs assert_int_equal(0, abs(0)); assert_int_equal(1, abs(1)); assert_int_equal(INT_MAX, abs(INT_MAX)); assert_int_equal(1, abs(-1)); // labs assert_true(labs(0) == 0); assert_true(labs(1) == 1); assert_true(labs(LONG_MAX) == LONG_MAX); assert_true(labs(-1) == 1); // llabs assert_true(llabs(0) == 0); assert_true(llabs(1) == 1); assert_true(llabs(LLONG_MAX) == LLONG_MAX); assert_true(llabs(-1) == 1); } void test_stdlib (void) { test_fixture_start(); run_test(test_abs); test_fixture_end(); }
Use assert_int_equal not assert_true where possible
Use assert_int_equal not assert_true where possible
C
mit
kristapsk/resclib,kristapsk/resclib,kristapsk/reclib,kristapsk/reclib
d07bfb8f8d51a392b72bb14b9d9f2281309f632e
components/policy/core/common/policy_provider_android_delegate.h
components/policy/core/common/policy_provider_android_delegate.h
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_PROVIDER_ANDROID_DELEGATE_H_ #define COMPONENTS_POLICY_CORE_COMMON_POLICY_PROVIDER_ANDROID_DELEGATE_H_ #include "base/compiler_specific.h" namespace policy { // A delegate for the Android policy provider. This class is responsible for // setting policies on the PolicyProviderAndroid and refreshing them on demand. class POLICY_EXPORT PolicyProviderAndroidDelegate { public: // Called to refresh policies. If this method is called, the delegate must // eventually call SetPolicies on the provider. virtual void RefreshPolicies() = 0; // Called before the provider is destroyed. virtual void PolicyProviderShutdown() = 0; protected: virtual ~PolicyProviderAndroidDelegate() {} }; } // namespace policy #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_PROVIDER_ANDROID_DELEGATE_H_
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_PROVIDER_ANDROID_DELEGATE_H_ #define COMPONENTS_POLICY_CORE_COMMON_POLICY_PROVIDER_ANDROID_DELEGATE_H_ #include "base/compiler_specific.h" #include "components/policy/policy_export.h" namespace policy { // A delegate for the Android policy provider. This class is responsible for // setting policies on the PolicyProviderAndroid and refreshing them on demand. class POLICY_EXPORT PolicyProviderAndroidDelegate { public: // Called to refresh policies. If this method is called, the delegate must // eventually call SetPolicies on the provider. virtual void RefreshPolicies() = 0; // Called before the provider is destroyed. virtual void PolicyProviderShutdown() = 0; protected: virtual ~PolicyProviderAndroidDelegate() {} }; } // namespace policy #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_PROVIDER_ANDROID_DELEGATE_H_
Add a missing policy_export include
Add a missing policy_export include When including only policy_provider_android and no other policy related header, this made the compiler complain about the missing declaration of POLICY_EXPORT BUG=506809 Review URL: https://codereview.chromium.org/1225583002 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#337316}
C
bsd-3-clause
Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,Just-D/chromium-1,Chilledheart/chromium,Chilledheart/chromium,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk
f51e7a2cf7e05177c04d65d559cafa2691549046
src/EthShield.c
src/EthShield.c
/** * @file debug.h * @brief Initializer and main loop of EthShield * * \copyright Copyright 2013 /Dev. All rights reserved. * \license This project is released under MIT license. * * @author Ferdi van der Werf <efcm@slashdev.nl> * @since 0.1.0 */ // Speed of micro-controller (20.0 MHz) #ifndef F_CPU #define F_CPU 20000000 #endif #include <inttypes.h> #include <avr/interrupt.h> #include "net/network.h" #include "utils/logger.h" #include "utils/uptime.h" int main(void) { // Enable interrupts sei(); // Initialize debug logger_init(); // Initialize uptime uptime_init(); // Initialize network chip network_init(); // Infinite loop while (1) { } }
/** * @file debug.h * @brief Initializer and main loop of EthShield * * \copyright Copyright 2013 /Dev. All rights reserved. * \license This project is released under MIT license. * * @author Ferdi van der Werf <efcm@slashdev.nl> * @since 0.1.0 */ // Speed of micro-controller (20.0 MHz) #ifndef F_CPU #define F_CPU 20000000 #endif #include <inttypes.h> #include <avr/interrupt.h> #include "net/network.h" #include "utils/logger.h" #include "utils/uptime.h" int main(void) { // Enable interrupts sei(); // Initialize debug logger_init(); // Initialize uptime uptime_init(); // Initialize network chip network_init(); // Infinite loop while (1) { // Handle network traffic network_backbone(); } }
Handle network traffic in main loop
Handle network traffic in main loop
C
mit
slashdev/slashnet,fuegas/dollhouse-ethshield,fuegas/dollhouse-ethshield,slashdev/slashnet
e8034eb5a2e48453728bb1a182588a6dffa2b08a
problems/0001-0025/0001-multiples-of-3-and-5/main.c
problems/0001-0025/0001-multiples-of-3-and-5/main.c
#include <stdio.h> #define RANGE 1000 unsigned int count_divisibility(unsigned int divisor) { int count = 0; for ( int i = 1 ; i < RANGE ; i++ ) { if ( i % divisor == 0 ) { count++; } } return count; } // Use the identity n(n+1)/2 to calculate the sum unsigned int calculate_divisibility_sum(unsigned int number, unsigned int count) { unsigned int divisibility_sum = 0; divisibility_sum = number * (count * (count + 1)) / 2; return divisibility_sum; } int main() { unsigned short div_three_count = 0, div_five_count = 0, div_fifteen_count = 0; unsigned int div_three_sum, div_five_sum, div_fifteen_sum, total_sum; div_three_count = count_divisibility(3); div_five_count = count_divisibility(5); div_fifteen_count = count_divisibility(15); div_three_sum = calculate_divisibility_sum(3, div_three_count); div_five_sum = calculate_divisibility_sum(5, div_five_count); div_fifteen_sum = calculate_divisibility_sum(15, div_fifteen_count); total_sum = div_three_sum + div_five_sum - div_fifteen_sum; printf("%d", total_sum); return 0; }
#include <stdio.h> #define RANGE 1000 unsigned short count_divisibility(unsigned short divisor) { int count = 0; count = (RANGE - 1) / divisor; return count; } // Use the identity n(n+1)/2 to calculate the sum unsigned int calculate_divisibility_sum(unsigned short number, unsigned short count) { unsigned int divisibility_sum = 0; divisibility_sum = number * (count * (count + 1)) / 2; return divisibility_sum; } int main() { unsigned short div_three_count = 0, div_five_count = 0, div_fifteen_count = 0; unsigned int div_three_sum, div_five_sum, div_fifteen_sum, total_sum; div_three_count = count_divisibility(3); div_five_count = count_divisibility(5); div_fifteen_count = count_divisibility(15); div_three_sum = calculate_divisibility_sum(3, div_three_count); div_five_sum = calculate_divisibility_sum(5, div_five_count); div_fifteen_sum = calculate_divisibility_sum(15, div_fifteen_count); total_sum = div_three_sum + div_five_sum - div_fifteen_sum; printf("%d", total_sum); return 0; }
Refactor Problem 1's solution in C
Refactor Problem 1's solution in C My logic failed me and I noticed that I just need to divide 1000 by the number to get the amount of divisible numbers. -_- That's why I removed the for-loop. Changed the datatype for some of the functions and arguments, because `short int` is sufficient enough to store the values.
C
mit
pho1n1x/eulerian-insanity
352fd8a38a7ca9bed62801969d9e0188f6b7e3ad
SearchResultsView/PrecompiledHeader.h
SearchResultsView/PrecompiledHeader.h
#pragma once #define NTDDI_VERSION 0x06010000 #define WINVER 0x0601 #define _WIN32_WINNT 0x0601 #include <ShellScalingApi.h> #include <Shlobj.h> #include <ShObjIdl.h> #include <Windows.h> #include <wrl.h> #undef min #undef max #include <algorithm> #include <unordered_map> namespace WRL { using namespace Microsoft::WRL; } #if _DEBUG #define Assert(x) do { if (!(x)) __debugbreak(); } while (false, false) #else #define Assert(x) do { if (false, false) (void)(x); } while (false, false) #endif
#pragma once #define NTDDI_VERSION 0x0A000007 // NTDDI_WIN10_19H1 #define _WIN32_WINNT 0x0A00 // _WIN32_WINNT_WIN10 #define WINVER 0x0A00 #include <ShellScalingApi.h> #include <Shlobj.h> #include <ShObjIdl.h> #include <Windows.h> #include <wrl.h> #undef min #undef max #include <algorithm> #include <unordered_map> namespace WRL { using namespace Microsoft::WRL; } #if _DEBUG #define Assert(x) do { if (!(x)) __debugbreak(); } while (false, false) #else #define Assert(x) do { if (false, false) (void)(x); } while (false, false) #endif
Drop support for Windows 7.
Drop support for Windows 7.
C
mit
TautvydasZilys/FileSystemSearch,TautvydasZilys/FileSystemSearch,TautvydasZilys/FileSystemSearch
1a5537811f3faf7171f282321aa91f8ef1f8dd35
arch/arm/soc/ti_simplelink/cc32xx/soc.h
arch/arm/soc/ti_simplelink/cc32xx/soc.h
/* * Copyright (c) 2016, Texas Instruments Incorporated * * SPDX-License-Identifier: Apache-2.0 */ #include <inc/hw_types.h> #include <driverlib/prcm.h>
/* * Copyright (c) 2016-2017, Texas Instruments Incorporated * * SPDX-License-Identifier: Apache-2.0 */ #include <inc/hw_types.h> #include <driverlib/prcm.h> /* * CMSIS IRQn_Type enum is broken relative to ARM GNU compiler. * * So redefine the IRQn_Type enum to a unsigned int to avoid * the ARM compiler from sign extending IRQn_Type values higher than 0x80 * into negative IRQ values, which causes hard-to-debug Hard Faults. */ typedef u32_t IRQn_Type; /* Need to keep the remaining from cmsis.h, as Zephyr expects these. */ enum { Reset_IRQn = -15, NonMaskableInt_IRQn = -14, HardFault_IRQn = -13, #if defined(CONFIG_ARMV7_M) MemoryManagement_IRQn = -12, BusFault_IRQn = -11, UsageFault_IRQn = -10, #endif /* CONFIG_ARMV7_M */ SVCall_IRQn = -5, DebugMonitor_IRQn = -4, PendSV_IRQn = -2, SysTick_IRQn = -1, } CMSIS_IRQn_Type; #define __CM4_REV 0 #define __MPU_PRESENT 0 /* Zephyr has no MPU support */ #define __NVIC_PRIO_BITS CONFIG_NUM_IRQ_PRIO_BITS #define __Vendor_SysTickConfig 0 /* Default to standard SysTick */
Redefine CMSIS IRQn_Type enum to unsigned int
cc32xx: Redefine CMSIS IRQn_Type enum to unsigned int Previously, calling NVIC_SetPriority(IRQn_Type irqn, ....) with the NWP interrupt number of 171 caused a hard fault during a subsequent svc #0 instruction during _Swap(). GNU compiler is generating a bit extension instruction (sxtb) which converts a positive IRQ value argument to a negative value when casting to the CMSIS IRQn_Type enum parameter type. This generates a negative index, which then writes to an SCB control register instead of NVIC register, causing a hard fault later on. This issue only occurs when passing interrupt numbers > 0x80 (eg: 171 (0xab) for the NWP) to the CMSIS NVIC apis. The solution here is simply to redefine IRQn_Type to be an unsigned 32 bit integer, while redefining the CMSIS IRQn_Type enum definitions for interrupts less than zero. Jira: ZEP-1958 Signed-off-by: Gil Pitney <477da50908f0a7963c2c490cce0ff096d2cac162@linaro.org>
C
apache-2.0
runchip/zephyr-cc3220,fbsder/zephyr,punitvara/zephyr,nashif/zephyr,punitvara/zephyr,finikorg/zephyr,Vudentz/zephyr,fbsder/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,rsalveti/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,aceofall/zephyr-iotos,explora26/zephyr,ldts/zephyr,zephyriot/zephyr,rsalveti/zephyr,finikorg/zephyr,runchip/zephyr-cc3220,kraj/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,zephyriot/zephyr,runchip/zephyr-cc3220,mbolivar/zephyr,ldts/zephyr,Vudentz/zephyr,Vudentz/zephyr,ldts/zephyr,rsalveti/zephyr,aceofall/zephyr-iotos,fbsder/zephyr,aceofall/zephyr-iotos,runchip/zephyr-cc3220,nashif/zephyr,kraj/zephyr,kraj/zephyr,Vudentz/zephyr,punitvara/zephyr,mbolivar/zephyr,rsalveti/zephyr,galak/zephyr,kraj/zephyr,kraj/zephyr,galak/zephyr,mbolivar/zephyr,nashif/zephyr,nashif/zephyr,explora26/zephyr,fbsder/zephyr,finikorg/zephyr,explora26/zephyr,zephyriot/zephyr,rsalveti/zephyr,zephyrproject-rtos/zephyr,zephyriot/zephyr,runchip/zephyr-cc3220,zephyrproject-rtos/zephyr,galak/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,galak/zephyr,zephyriot/zephyr,galak/zephyr,aceofall/zephyr-iotos,zephyrproject-rtos/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,ldts/zephyr,mbolivar/zephyr,aceofall/zephyr-iotos,Vudentz/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,mbolivar/zephyr,ldts/zephyr,fbsder/zephyr
274937d4b721bb1162598610a3635ea67728c116
src/private/timer-win32.c
src/private/timer-win32.c
/* Copyright (C) 2012-2013 Zeex * * 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. */ #include <time.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> time_t timer_clock(void) { return GetTickCount(); }
/* Copyright (C) 2012-2013 Zeex * * 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. */ #include <time.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> time_t timer_clock(void) { LARGE_INTEGER freq, count; if (!QueryPerformanceFrequency(&freq)) { return 0; } if (!QueryPerformanceCounter(&count)) { return 0; } return (time_t)(1000.0L / freq.QuadPart * count.QuadPart);; }
Use QueryPerformanceCounter() timer instead of GetTickCount()
Use QueryPerformanceCounter() timer instead of GetTickCount() GetTickCount() has poor resolution according to MSDN docs (from 10 to 16 ms).
C
apache-2.0
WopsS/sampgdk,Zeex/sampgdk,Zeex/sampgdk,WopsS/sampgdk,Zeex/sampgdk,WopsS/sampgdk
a9091c137bb21a247afa01ecf17bd5c75d9b0e65
crypto/engine/eng_all.c
crypto/engine/eng_all.c
/* * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include "internal/cryptlib.h" #include "eng_int.h" void ENGINE_load_builtin_engines(void) { /* Some ENGINEs need this */ OPENSSL_cpuid_setup(); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL); } #if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)) && !defined(OPENSSL_NO_DEPRECATED) void ENGINE_setup_bsd_cryptodev(void) { } #endif
/* * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include "internal/cryptlib.h" #include "eng_int.h" void ENGINE_load_builtin_engines(void) { /* Some ENGINEs need this */ OPENSSL_cpuid_setup(); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL); } #if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)) && OPENSSL_API_COMPAT < 0x10100000L void ENGINE_setup_bsd_cryptodev(void) { } #endif
Convert our own check of OPENSSL_NO_DEPRECATED
Convert our own check of OPENSSL_NO_DEPRECATED ... to the check OPENSSL_API_COMPAT < 0x10100000L, to correspond with how it's declared. Reviewed-by: Matt Caswell <1fa2ef4755a9226cb9a0a4840bd89b158ac71391@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6470)
C
apache-2.0
openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl
a4bc57be10b8f84f94f628dae4f4afee5767e79a
include/t3f/view.h
include/t3f/view.h
#ifndef T3F_VIEW_H #define T3F_VIEW_H /* structure holds information about a 3D viewport usually used to represent one player's screen, split screen games will have multiple viewports */ typedef struct { /* offset of viewport */ float offset_x; float offset_y; float width; float height; /* vanishing point */ float vp_x; float vp_y; } T3F_VIEW; extern T3F_VIEW * t3f_default_view; extern T3F_VIEW * t3f_current_view; T3F_VIEW * t3f_create_view(float ox, float oy, float w, float h, float vpx, float vpy); void t3f_destroy_view(T3F_VIEW * vp); void t3f_store_state(T3F_VIEW * sp); void t3f_restore_state(T3F_VIEW * sp); void t3f_select_view(T3F_VIEW * sp); T3F_VIEW * t3f_get_current_view(void); bool t3f_project_coordinates(float vw, float vpx, float vpy, float * x, float * y, float z); float t3f_project_x(float x, float z); float t3f_project_y(float y, float z); #endif
#ifndef T3F_VIEW_H #define T3F_VIEW_H #include <allegro5/allegro5.h> /* structure holds information about a 3D viewport usually used to represent one player's screen, split screen games will have multiple viewports */ typedef struct { /* offset of viewport */ float offset_x; float offset_y; float width; float height; /* vanishing point */ float vp_x; float vp_y; } T3F_VIEW; extern T3F_VIEW * t3f_default_view; extern T3F_VIEW * t3f_current_view; T3F_VIEW * t3f_create_view(float ox, float oy, float w, float h, float vpx, float vpy); void t3f_destroy_view(T3F_VIEW * vp); void t3f_store_state(T3F_VIEW * sp); void t3f_restore_state(T3F_VIEW * sp); void t3f_select_view(T3F_VIEW * sp); T3F_VIEW * t3f_get_current_view(void); bool t3f_project_coordinates(float vw, float vpx, float vpy, float * x, float * y, float z); float t3f_project_x(float x, float z); float t3f_project_y(float y, float z); #endif
Include Allegro header so we can use 'bool'.
Include Allegro header so we can use 'bool'.
C
bsd-3-clause
NewCreature/T--Framework,NewCreature/T--Framework,NewCreature/T--Framework,NewCreature/T--Framework,NewCreature/T--Framework
5bf21b0759b13a6fe5ec1ab6d984eedcd8d96720
src/file/keydb.h
src/file/keydb.h
/* encrypted keys */ static const uint32_t internal_device_number = 0; static const uint8_t internal_dk_list[][21] = { { }, }; static const uint8_t internal_pk_list[][16] = { { }, }; static const uint8_t internal_hc_list[][112] = { { }, }; /* customize this function to "hide" the keys in the binary */ static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size) { memcpy(out, in, size); }
/* encrypted keys */ static const uint32_t internal_device_number = 0; static const uint8_t internal_dk_list[][21] = { { 0 }, }; static const uint8_t internal_pk_list[][16] = { { 0 }, }; static const uint8_t internal_hc_list[][112] = { { 0 }, }; /* customize this function to "hide" the keys in the binary */ static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size) { memcpy(out, in, size); }
Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet.
Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet.
C
lgpl-2.1
mwgoldsmith/aacs,mwgoldsmith/aacs
921fc17e0d1df4aa29f1176fe7c1240019f286f8
tests/arcus/MockSocket.h
tests/arcus/MockSocket.h
//Copyright (c) 2018 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef MOCKSOCKET_H #define MOCKSOCKET_H #include <Arcus/Socket.h> //Inheriting from this to be able to swap this socket in the tested class. #include <deque> //History of sent and received messages. namespace cura { /* * \brief Mocks a socket connection from libArcus such that we can test with it * without creating an actual connection. */ class MockSocket : public Arcus::Socket { public: MockSocket(); //virtual ~MockSocket(); virtual void connect(const std::string& address, int port); virtual void listen(const std::string& address, int port); virtual void close(); virtual void reset(); virtual void sendMessage(Arcus::MessagePtr message); virtual Arcus::MessagePtr takeNextMessage(); //virtual Arcus::MessagePtr createMessage(const std::string& type_name); void pushMessageToReceivedQueue(Arcus::MessagePtr message); Arcus::MessagePtr popMessageFromSendQueue(); // void setName(const std::string& new_name); // void printMessages(); std::deque<Arcus::MessagePtr> sent_messages; std::deque<Arcus::MessagePtr> received_messages; }; } //namespace cura #endif //MOCKSOCKET_H
//Copyright (c) 2018 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef MOCKSOCKET_H #define MOCKSOCKET_H #include <Arcus/Socket.h> //Inheriting from this to be able to swap this socket in the tested class. #include <deque> //History of sent and received messages. namespace cura { /* * \brief Mocks a socket connection from libArcus such that we can test with it * without creating an actual connection. */ class MockSocket : public Arcus::Socket { public: MockSocket(); //These functions are overridden to be no-op. void connect(const std::string& address, int port) override; void listen(const std::string& address, int port) override; void close() override; void reset() override; //Catch these functions so that we can see whether they are called. void sendMessage(Arcus::MessagePtr message) override; Arcus::MessagePtr takeNextMessage() override; //Helpers to store the sent and received messages. void pushMessageToReceivedQueue(Arcus::MessagePtr message); Arcus::MessagePtr popMessageFromSendQueue(); std::deque<Arcus::MessagePtr> sent_messages; std::deque<Arcus::MessagePtr> received_messages; }; } //namespace cura #endif //MOCKSOCKET_H
Mark functions as override if they override
Mark functions as override if they override So that if for some reason they don't override anything, we get a compiler error. This bit me in the arse, anyway. Contributes to issue CURA-4410.
C
agpl-3.0
Ultimaker/CuraEngine,Ultimaker/CuraEngine
f76d811c7d49ba1d5aa2a3fd01df6c3d35d97cdb
src/skadns/skadns_end.c
src/skadns/skadns_end.c
/* ISC license. */ #include <skalibs/alloc.h> #include <skalibs/genalloc.h> #include <skalibs/gensetdyn.h> #include <skalibs/skaclient.h> #include <s6-dns/skadns.h> static int skadnsanswer_free (char *p, void *stuff) { register skadnsanswer_t *q = (skadnsanswer_t_ref)p ; alloc_free(&q->data) ; (void)stuff ; return 1 ; } void skadns_end (skadns_t *a) { skaclient_end(&a->connection) ; genalloc_free(uint16, &a->list) ; gensetdyn_iter(&a->q, &skadnsanswer_free, 0) ; gensetdyn_free(&a->q) ; *a = skadns_zero ; }
/* ISC license. */ #include <skalibs/alloc.h> #include <skalibs/genalloc.h> #include <skalibs/gensetdyn.h> #include <skalibs/skaclient.h> #include <s6-dns/skadns.h> static int skadnsanswer_free (char *p, void *stuff) { register skadnsanswer_t *q = (skadnsanswer_t_ref)p ; alloc_free(&q->data) ; (void)stuff ; return 1 ; } void skadns_end (skadns_t *a) { skaclient_end(&a->connection) ; genalloc_free(uint16, &a->list) ; (void)gensetdyn_iter(&a->q, &skadnsanswer_free, 0) ; gensetdyn_free(&a->q) ; *a = skadns_zero ; }
Adjust to gensetdyn_iter change in skalibs
Adjust to gensetdyn_iter change in skalibs
C
isc
skarnet/s6-dns,skarnet/s6-dns
f333a38b65f9d357ab6c2fc73fd014f8e266657f
cpp/EXGL.h
cpp/EXGL.h
#ifndef __EXGL_H__ #define __EXGL_H__ #include <OpenGLES/ES2/gl.h> #include <JavaScriptCore/JSBase.h> #ifdef __cplusplus extern "C" { #endif // Identifies an EXGL context. No EXGL context has the id 0, so that can be // used as a 'null' value. typedef unsigned int EXGLContextId; // [JS thread] Create an EXGL context and return its id number. Saves the // JavaScript interface object (has a WebGLRenderingContext-style API) at // `global.__EXGLContexts[id]` in JavaScript. EXGLContextId EXGLContextCreate(JSGlobalContextRef jsCtx); // [Any thread] Release the resources for an EXGL context. The same id is never // reused. void EXGLContextDestroy(EXGLContextId exglCtxId); // [GL thread] Perform one frame's worth of queued up GL work void EXGLContextFlush(EXGLContextId exglCtxId); // [GL thread] Set the default framebuffer (used when binding 0). Allows using // platform-specific extensions on the default framebuffer, such as MSAA. void EXGLContextSetDefaultFramebuffer(EXGLContextId exglCtxId, GLint framebuffer); #ifdef __cplusplus } #endif #endif
#ifndef __EXGL_H__ #define __EXGL_H__ #ifdef __ANDROID__ #include <GLES2/gl2.h> #endif #ifdef __APPLE__ #include <OpenGLES/ES2/gl.h> #endif #include <JavaScriptCore/JSBase.h> #ifdef __cplusplus extern "C" { #endif // Identifies an EXGL context. No EXGL context has the id 0, so that can be // used as a 'null' value. typedef unsigned int EXGLContextId; // [JS thread] Create an EXGL context and return its id number. Saves the // JavaScript interface object (has a WebGLRenderingContext-style API) at // `global.__EXGLContexts[id]` in JavaScript. EXGLContextId EXGLContextCreate(JSGlobalContextRef jsCtx); // [Any thread] Release the resources for an EXGL context. The same id is never // reused. void EXGLContextDestroy(EXGLContextId exglCtxId); // [GL thread] Perform one frame's worth of queued up GL work void EXGLContextFlush(EXGLContextId exglCtxId); // [GL thread] Set the default framebuffer (used when binding 0). Allows using // platform-specific extensions on the default framebuffer, such as MSAA. void EXGLContextSetDefaultFramebuffer(EXGLContextId exglCtxId, GLint framebuffer); #ifdef __cplusplus } #endif #endif
Fix Android vs. iOS GL header include
Fix Android vs. iOS GL header include fbshipit-source-id: 75ec20a
C
bsd-3-clause
jolicloud/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,jolicloud/exponent,exponent/exponent,jolicloud/exponent,exponentjs/exponent,jolicloud/exponent,exponent/exponent,jolicloud/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,jolicloud/exponent,jolicloud/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponentjs/exponent,jolicloud/exponent,exponent/exponent,jolicloud/exponent,exponentjs/exponent
927cf450d4ebb3df503d79112b0a90d4b19de1ea
src/modules/conf_randr/e_mod_main.h
src/modules/conf_randr/e_mod_main.h
#ifndef E_MOD_MAIN_H # define E_MOD_MAIN_H # ifndef ECORE_X_RANDR_1_2 # define ECORE_X_RANDR_1_2 ((1 << 16) | 2) # endif # ifndef ECORE_X_RANDR_1_3 # define ECORE_X_RANDR_1_3 ((1 << 16) | 3) # endif # ifndef E_RANDR_12 # define E_RANDR_12 (e_randr_screen_info.rrvd_info.randr_info_12) # endif EAPI extern E_Module_Api e_modapi; EAPI void *e_modapi_init(E_Module *m); EAPI int e_modapi_shutdown(E_Module *m); EAPI int e_modapi_save(E_Module *m); extern const char *mod_dir; /** * @addtogroup Optional_Conf * @{ * * @defgroup Module_Conf_RandR RandR (Screen Resize, Rotate and Mirror) * * Configures size, rotation and mirroring of screen. Uses the X11 * RandR protocol (does not work with NVidia proprietary drivers). * * @} */ #endif
#ifndef E_MOD_MAIN_H # define E_MOD_MAIN_H # define LOGFNS 1 # ifdef LOGFNS # include <stdio.h> # define LOGFN(fl, ln, fn) printf("-CONF-RANDR: %25s: %5i - %s\n", fl, ln, fn); # else # define LOGFN(fl, ln, fn) # endif # ifndef ECORE_X_RANDR_1_2 # define ECORE_X_RANDR_1_2 ((1 << 16) | 2) # endif # ifndef ECORE_X_RANDR_1_3 # define ECORE_X_RANDR_1_3 ((1 << 16) | 3) # endif # ifndef E_RANDR_12 # define E_RANDR_12 (e_randr_screen_info.rrvd_info.randr_info_12) # endif EAPI extern E_Module_Api e_modapi; EAPI void *e_modapi_init(E_Module *m); EAPI int e_modapi_shutdown(E_Module *m); EAPI int e_modapi_save(E_Module *m); extern const char *mod_dir; /** * @addtogroup Optional_Conf * @{ * * @defgroup Module_Conf_RandR RandR (Screen Resize, Rotate and Mirror) * * Configures size, rotation and mirroring of screen. Uses the X11 * RandR protocol (does not work with NVidia proprietary drivers). * * @} */ #endif
Add LOGFN macro to header.
Add LOGFN macro to header. Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 84140
C
bsd-2-clause
tasn/enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,rvandegrift/e,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,FlorentRevest/Enlightenment,rvandegrift/e
396890929c29d0c7a9b1474f9e0fa6683903ed1a
lib/ReaderWriter/ELF/AMDGPU/AMDGPURelocationHandler.h
lib/ReaderWriter/ELF/AMDGPU/AMDGPURelocationHandler.h
//===- lld/ReaderWriter/ELF/AMDGPU/AMDGPURelocationHandler.h --------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_READER_WRITER_ELF_AMDGPU_AMDGPU_RELOCATION_HANDLER_H #define LLD_READER_WRITER_ELF_AMDGPU_AMDGPU_RELOCATION_HANDLER_H #include "lld/ReaderWriter/ELFLinkingContext.h" #include <system_error> namespace lld { namespace elf { class AMDGPUTargetHandler; class AMDGPUTargetLayout; class AMDGPUTargetRelocationHandler final : public TargetRelocationHandler { public: AMDGPUTargetRelocationHandler(AMDGPUTargetLayout &layout) : _targetLayout(layout) {} std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, const AtomLayout &, const Reference &) const override; private: AMDGPUTargetLayout &_targetLayout; }; } // elf } // lld #endif
//===- lld/ReaderWriter/ELF/AMDGPU/AMDGPURelocationHandler.h --------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_READER_WRITER_ELF_AMDGPU_AMDGPU_RELOCATION_HANDLER_H #define LLD_READER_WRITER_ELF_AMDGPU_AMDGPU_RELOCATION_HANDLER_H #include "lld/ReaderWriter/ELFLinkingContext.h" #include <system_error> namespace lld { namespace elf { class AMDGPUTargetHandler; class AMDGPUTargetLayout; class AMDGPUTargetRelocationHandler final : public TargetRelocationHandler { public: AMDGPUTargetRelocationHandler(AMDGPUTargetLayout &layout) { } std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, const AtomLayout &, const Reference &) const override; }; } // elf } // lld #endif
Remove another unused private member variable
ELF/AMDGPU: Remove another unused private member variable git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@246164 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/lld,llvm-mirror/lld
1e5799c3a633161f89ced5d3d11ee6354ecf7f88
include/auth.h
include/auth.h
#ifndef CPR_AUTH_H #define CPR_AUTH_H #include <string> namespace cpr { class Authentication { public: Authentication(const std::string& username, const std::string& password) : username_{username}, password_{password}, auth_string_{username + ":" + password} {} const char* GetAuthString() const; private: std::string username_; std::string password_; std::string auth_string_; }; } #endif
#ifndef CPR_AUTH_H #define CPR_AUTH_H #include <string> namespace cpr { class Authentication { public: Authentication(const std::string& username, const std::string& password) : username_{username}, password_{password}, auth_string_{username_ + ":" + password_} {} const char* GetAuthString() const; private: std::string username_; std::string password_; std::string auth_string_; }; } #endif
Use the member strings since their types on concrete
Use the member strings since their types on concrete
C
mit
msuvajac/cpr,whoshuu/cpr,SuperV1234/cpr,msuvajac/cpr,whoshuu/cpr,skystrife/cpr,msuvajac/cpr,skystrife/cpr,skystrife/cpr,SuperV1234/cpr,SuperV1234/cpr,whoshuu/cpr
56841922d1e0ee90cdd2bdf10c8fead846560897
src/RCoRoutineRunner.h
src/RCoRoutineRunner.h
#ifndef __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #define __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #include <pt.h> class RCoRoutineRunner { public: RCoRoutineRunner(); virtual ~RCoRoutineRunner(); virtual char run(); public: struct pt mPt; }; #endif // __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C
#ifndef __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #define __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #include <pt/pt.h> class RCoRoutineRunner { public: RCoRoutineRunner(); virtual ~RCoRoutineRunner(); virtual char run(); public: struct pt mPt; }; #endif // __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C
Use protothread library which included in RabirdToolkitThirdParties
Use protothread library which included in RabirdToolkitThirdParties
C
mit
starofrainnight/ArduinoRabirdToolkit,starofrainnight/ArduinoRabirdTookit,starofrainnight/ArduinoRabirdToolkit
f0da1d7331333266c7f45eb326ac595d0a831d01
10V/Stefan_Iliev_25/Homework_2/Homework2_v2.c
10V/Stefan_Iliev_25/Homework_2/Homework2_v2.c
#include<stdio.h> int main() { int printed_numb=0; int x; int prev_number=2; int number=2; int flag; while(printed_numb<10) { flag=0; for(x=2;x<=number/2;x++) { if(number%x==0) { flag=1; break; } } if(flag=0) { if(number==prev_number+2) { printf("%d - ",prev_number); printf("%d\n",number); printed_numb++; } prev_number=number; } number++; } return 0; }
#include<stdio.h> int main() { int printed_numb=0; int x; int prev_number=2; int number=2; int flag; while(printed_numb<10) { flag=0; for(x=2;x<=number/2;x++) { if(number%x==0) { flag=1; break; } } if(flag==0) { if(number==prev_number+2) { printf("%d - ",prev_number); printf("%d\n",number); printed_numb++; } prev_number=number; } number++; } return 0; }
Repair on Twin Primes.Homework 2 completed.Stefan Iliev 26 10V
Repair on Twin Primes.Homework 2 completed.Stefan Iliev 26 10V
C
mit
Dimitur-Matev/elsys-c-programming-2013-2014
91e4896559b1f087e56007b77ed630e48301eaf0
cmd/smyrna/gui/glmenu.h
cmd/smyrna/gui/glmenu.h
#ifndef GLMENU_H #define GLMENU_H #include "viewport.h" GtkWidget* create_popup_menu (GtkWidget* drawing_area); #endif
/* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp. * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Corp. * * * * Information and Software Systems Research * * AT&T Research, Florham Park NJ * **********************************************************/ #ifndef GLMENU_H #define GLMENU_H #include "viewport.h" GtkWidget *create_popup_menu(GtkWidget * drawing_area); #endif
Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings
Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings
C
epl-1.0
tkelman/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,jho1965us/graphviz,pixelglow/graphviz,tkelman/graphviz,tkelman/graphviz,kbrock/graphviz,tkelman/graphviz,tkelman/graphviz,pixelglow/graphviz,kbrock/graphviz,jho1965us/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,pixelglow/graphviz,jho1965us/graphviz,ellson/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,jho1965us/graphviz,kbrock/graphviz,ellson/graphviz,BMJHayward/graphviz,pixelglow/graphviz,kbrock/graphviz,jho1965us/graphviz,MjAbuz/graphviz,pixelglow/graphviz,kbrock/graphviz,jho1965us/graphviz,ellson/graphviz,ellson/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,pixelglow/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,tkelman/graphviz,ellson/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,kbrock/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,pixelglow/graphviz,jho1965us/graphviz,MjAbuz/graphviz,jho1965us/graphviz,jho1965us/graphviz,kbrock/graphviz,ellson/graphviz,kbrock/graphviz,tkelman/graphviz,ellson/graphviz,BMJHayward/graphviz,kbrock/graphviz,BMJHayward/graphviz,tkelman/graphviz,MjAbuz/graphviz,pixelglow/graphviz,MjAbuz/graphviz,ellson/graphviz,pixelglow/graphviz,pixelglow/graphviz,ellson/graphviz,jho1965us/graphviz,ellson/graphviz,MjAbuz/graphviz,tkelman/graphviz,jho1965us/graphviz,pixelglow/graphviz,ellson/graphviz
228e64096902f6bcd14aca8be5333fc69cbc80bc
server/database.c
server/database.c
#include <sqlite3.h> #include <stdio.h> static sqlite3 *db; int _mqtt_db_create_tables(void); int mqtt_db_open(const char *filename) { if(sqlite3_open(filename, &db) != SQLITE_OK){ fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db)); return 1; } return _mqtt_db_create_tables(); } int mqtt_db_close(void) { sqlite3_close(db); db = NULL; return 0; } int _mqtt_db_create_tables(void) { int rc; char *errmsg = NULL; rc = sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS clients(" "id TEXT, " "will INTEGER, will_retain INTEGER, will_qos " "will_topic TEXT, will_message TEXT)", NULL, NULL, &errmsg); if(errmsg) sqlite3_free(errmsg); if(rc == SQLITE_OK){ return 0; }else{ return 1; } }
#include <sqlite3.h> #include <stdio.h> static sqlite3 *db; int _mqtt_db_create_tables(void); int mqtt_db_open(const char *filename) { if(sqlite3_open(filename, &db) != SQLITE_OK){ fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db)); return 1; } return _mqtt_db_create_tables(); } int mqtt_db_close(void) { sqlite3_close(db); db = NULL; return 0; } int _mqtt_db_create_tables(void) { int rc = 0; char *errmsg = NULL; if(sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS clients(" "id TEXT, " "will INTEGER, will_retain INTEGER, will_qos " "will_topic TEXT, will_message TEXT)", NULL, NULL, &errmsg) != SQLITE_OK){ rc = 1; } if(errmsg) sqlite3_free(errmsg); if(sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS subs(" "client_id TEXT, sub TEXT, qos INTEGER)", NULL, NULL, &errmsg) != SQLITE_OK){ rc = 1; } if(errmsg) sqlite3_free(errmsg); return rc; }
Create db table for subscriptions.
Create db table for subscriptions.
C
bsd-3-clause
zlargon/mosquitto,zlargon/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto,zlargon/mosquitto,tempbottle/mosquitto,zlargon/mosquitto,zlargon/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto
6bf45f6de4f613fef61dbe98c464c33478785e95
tests/dbus/test-tpl-observer.c
tests/dbus/test-tpl-observer.c
#include <telepathy-logger/channel-factory-internal.h> #include <telepathy-logger/observer-internal.h> static gint factory_counter = 0; static TplChannel * mock_factory (const gchar *chan_type, TpConnection *conn, const gchar *object_path, GHashTable *tp_chan_props, TpAccount *tp_acc, GError **error) { factory_counter += 1; return NULL; } int main (int argc, char **argv) { TplObserver *obs, *obs2; g_type_init (); obs = _tpl_observer_new (); /* TplObserver is a singleton, be sure both references point to the same * memory address */ obs2 = _tpl_observer_new (); g_assert (obs == obs2); /* unref the second singleton pointer and check that the it is still * valid: checking correct object ref-counting after each _dup() call */ g_object_unref (obs2); g_assert (TPL_IS_OBSERVER (obs)); /* it points to the same mem area, it should be still valid */ g_assert (TPL_IS_OBSERVER (obs2)); /* register a ChanFactory and test ObserveChannel() */ _tpl_observer_set_channel_factory (obs, mock_factory); /* proper disposal for the singleton when no references are present */ g_object_unref (obs); g_assert (!TPL_IS_OBSERVER (obs)); return 0; }
#include <telepathy-logger/channel-factory-internal.h> #include <telepathy-logger/observer-internal.h> static gint factory_counter = 0; static TplChannel * mock_factory (const gchar *chan_type, TpConnection *conn, const gchar *object_path, GHashTable *tp_chan_props, TpAccount *tp_acc, GError **error) { factory_counter += 1; return NULL; } int main (int argc, char **argv) { TplObserver *obs, *obs2; g_type_init (); obs = _tpl_observer_new (); /* TplObserver is a singleton, be sure both references point to the same * memory address */ obs2 = _tpl_observer_new (); g_assert (obs == obs2); /* unref the second singleton pointer and check that the it is still * valid: checking correct object ref-counting after each _dup() call */ g_object_unref (obs2); g_assert (TPL_IS_OBSERVER (obs)); /* it points to the same mem area, it should be still valid */ g_assert (TPL_IS_OBSERVER (obs2)); /* register a ChanFactory and test ObserveChannel() */ _tpl_observer_set_channel_factory (obs, mock_factory); /* proper disposal for the singleton when no references are present */ g_object_unref (obs); return 0; }
Fix invalid read in pseudo observer test
Fix invalid read in pseudo observer test
C
lgpl-2.1
freedesktop-unofficial-mirror/telepathy__telepathy-logger,freedesktop-unofficial-mirror/telepathy__telepathy-logger,freedesktop-unofficial-mirror/telepathy__telepathy-logger
da6d42acfb7f6b65bbc95e52e01147d2335f490f
include/guard_overflow.h
include/guard_overflow.h
// // include/guard_overflow.h // tbd // // Created by inoahdev on 12/29/18. // Copyright © 2018 - 2019 inoahdev. All rights reserved. // #ifndef GUARD_OVERFLOW_H #define GUARD_OVERFLOW_H #include <stdint.h> #define guard_overflow_add(left_in, right) _Generic((left_in), \ uint32_t *: __builtin_uadd_overflow, \ uint64_t *: __builtin_uaddl_overflow \ ) (*left_in, right, left_in) #define guard_overflow_mul(left_in, right) _Generic((left_in), \ uint32_t *: __builtin_umul_overflow, \ uint64_t *: __builtin_umull_overflow \ ) (*left_in, right, left_in) #define guard_overflow_shift_left(left_in, right) _Generic((left_in), \ uint32_t *: guard_overflow_shift_left_uint32, \ uint64_t *: guard_overflow_shift_left_uint64 \ ) (left_in, right) int guard_overflow_shift_left_uint32(uint32_t *left_in, uint32_t right); int guard_overflow_shift_left_uint64(uint64_t *left_in, uint64_t right); #endif /* GUARD_OVERFLOW_H */
// // include/guard_overflow.h // tbd // // Created by inoahdev on 12/29/18. // Copyright © 2018 - 2019 inoahdev. All rights reserved. // #ifndef GUARD_OVERFLOW_H #define GUARD_OVERFLOW_H #include <stdint.h> #define guard_overflow_add(left_in, right) \ __builtin_add_overflow(*left_in, right, left_in) #define guard_overflow_mul(left_in, right) \ __builtin_mul_overflow(*left_in, right, left_in) #define guard_overflow_shift_left(left_in, right) _Generic((left_in), \ uint32_t *: guard_overflow_shift_left_uint32, \ uint64_t *: guard_overflow_shift_left_uint64 \ ) (left_in, right) int guard_overflow_shift_left_uint32(uint32_t *left_in, uint32_t right); int guard_overflow_shift_left_uint64(uint64_t *left_in, uint64_t right); #endif /* GUARD_OVERFLOW_H */
Fix compile errors with different integer-types
Fix compile errors with different integer-types
C
mit
inoahdev/tbd,inoahdev/tbd
3e705f279a942471b258b1c7a9e54aa8ff36b89f
include/linux/root_dev.h
include/linux/root_dev.h
#ifndef _ROOT_DEV_H_ #define _ROOT_DEV_H_ #include <linux/major.h> enum { Root_NFS = MKDEV(UNNAMED_MAJOR, 255), Root_RAM0 = MKDEV(RAMDISK_MAJOR, 0), Root_RAM1 = MKDEV(RAMDISK_MAJOR, 1), Root_FD0 = MKDEV(FLOPPY_MAJOR, 0), Root_HDA1 = MKDEV(IDE0_MAJOR, 1), Root_HDA2 = MKDEV(IDE0_MAJOR, 2), Root_SDA1 = MKDEV(SCSI_DISK0_MAJOR, 1), Root_SDA2 = MKDEV(SCSI_DISK0_MAJOR, 2), Root_HDC1 = MKDEV(IDE1_MAJOR, 1), Root_SR0 = MKDEV(SCSI_CDROM_MAJOR, 0), }; extern dev_t ROOT_DEV; #endif
#ifndef _ROOT_DEV_H_ #define _ROOT_DEV_H_ #include <linux/major.h> #include <linux/types.h> #include <linux/kdev_t.h> enum { Root_NFS = MKDEV(UNNAMED_MAJOR, 255), Root_RAM0 = MKDEV(RAMDISK_MAJOR, 0), Root_RAM1 = MKDEV(RAMDISK_MAJOR, 1), Root_FD0 = MKDEV(FLOPPY_MAJOR, 0), Root_HDA1 = MKDEV(IDE0_MAJOR, 1), Root_HDA2 = MKDEV(IDE0_MAJOR, 2), Root_SDA1 = MKDEV(SCSI_DISK0_MAJOR, 1), Root_SDA2 = MKDEV(SCSI_DISK0_MAJOR, 2), Root_HDC1 = MKDEV(IDE1_MAJOR, 1), Root_SR0 = MKDEV(SCSI_CDROM_MAJOR, 0), }; extern dev_t ROOT_DEV; #endif
Fix broken kernel headers preventing ARM build
[PATCH] Fix broken kernel headers preventing ARM build As a result of 894673ee6122a3ce1958e1fe096901ba5356a96b, the ARM architecture is more or less unbuildable - only one defconfig appears to build, with all others erroring out with: CC arch/arm/kernel/setup.o In file included from /home/rmk/git/linux-2.6-rmk/arch/arm/kernel/setup.c:22: /home/rmk/git/linux-2.6-rmk/include/linux/root_dev.h:7: warning: implicit declaration of function `MKDEV' ... Essentially, root_dev.h uses MKDEV and dev_t, but does not include any headers which provide either of these definitions. The reason it worked previously is that linux/tty.h just happened to include the required headers for linux/root_dev.h. Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk> Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
2ace9385a27d77e3fbf1f987b3bf3f0ce6af7ebc
src/protocols/ssh/ttymode.h
src/protocols/ssh/ttymode.h
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef GUAC_SSH_TTYMODE_H #define GUAC_SSH_TTYMODE_H #include "config.h" #define GUAC_SSH_TTY_OP_END 0 #define GUAC_SSH_TTY_OP_VERASE 3 #define GUAC_SSH_TERM_DEFAULT_BACKSPACE 127 extern const char GUAC_SSH_TTY_MODES[6]; #endif
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef GUAC_SSH_TTYMODE_H #define GUAC_SSH_TTYMODE_H #include "config.h" /** * The SSH TTY mode encoding opcode that terminates * the list of TTY modes. */ #define GUAC_SSH_TTY_OP_END 0 /** * The SSH tty mode encoding opcode that configures * the TTY erase code to configure the server * backspace key. */ #define GUAC_SSH_TTY_OP_VERASE 3 /** * The default ASCII code to send for the backspace * key that will be sent to the SSH server. */ #define GUAC_SSH_TERM_DEFAULT_BACKSPACE 127 /** * The array of TTY mode encoding data to send to the * SSH server. These consist of pairs of byte codes * and uint32 (4-byte) values, with a 0 to terminate * the list. */ extern const char GUAC_SSH_TTY_MODES[6]; #endif
Add documentation for the defines and variables.
GUACAMOLE-269: Add documentation for the defines and variables.
C
apache-2.0
glyptodon/guacamole-server,mike-jumper/incubator-guacamole-server,glyptodon/guacamole-server,apache/guacamole-server,apache/guacamole-server,mike-jumper/incubator-guacamole-server,mike-jumper/incubator-guacamole-server,mike-jumper/incubator-guacamole-server,glyptodon/guacamole-server,apache/guacamole-server
de6438d1b0800bbc285201962356476fe816c2a1
lang/python36/files/patch-Modules___ssl.c
lang/python36/files/patch-Modules___ssl.c
--- Modules/_ssl.c.orig +++ Modules/_ssl.c @@ -99,7 +99,8 @@ struct py_ssl_library_code { /* Include generated data (error codes) */ #include "_ssl_data.h" -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && \ + (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) # define OPENSSL_VERSION_1_1 1 #endif @@ -133,6 +134,9 @@ struct py_ssl_library_code { /* OpenSSL 1.1.0+ */ #ifndef OPENSSL_NO_SSL2 #define OPENSSL_NO_SSL2 +#endif +#if defined(LIBRESSL_VERSION_NUMBER) && defined(WITH_THREAD) +#define HAVE_OPENSSL_CRYPTO_LOCK #endif #else /* OpenSSL < 1.1.0 */ #if defined(WITH_THREAD)
$OpenBSD: patch-Modules__ssl_c,v 1.2 2018/03/17 22:30:04 sthen Exp $ XXX maybe the second hunk can go away now we have auto-init, I'm not sure exactly what python's lock protects Index: Modules/_ssl.c --- Modules/_ssl.c.orig +++ Modules/_ssl.c @@ -99,7 +99,8 @@ struct py_ssl_library_code { /* Include generated data (error codes) */ #include "_ssl_data.h" -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && \ + (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) # define OPENSSL_VERSION_1_1 1 #endif @@ -133,6 +134,9 @@ struct py_ssl_library_code { /* OpenSSL 1.1.0+ */ #ifndef OPENSSL_NO_SSL2 #define OPENSSL_NO_SSL2 +#endif +#if defined(LIBRESSL_VERSION_NUMBER) && defined(WITH_THREAD) +#define HAVE_OPENSSL_CRYPTO_LOCK #endif #else /* OpenSSL < 1.1.0 */ #if defined(WITH_THREAD)
Fix libressl patch python 3.6
Fix libressl patch python 3.6
C
mit
nrosier/bunbun,nrosier/bunbun,nrosier/bunbun,nrosier/bunbun
8b3a08698c86a94a3943ec941fe35b930046cd25
tornado/speedups.c
tornado/speedups.c
#define PY_SSIZE_T_CLEAN #include <Python.h> static PyObject* websocket_mask(PyObject* self, PyObject* args) { const char* mask; Py_ssize_t mask_len; const char* data; Py_ssize_t data_len; Py_ssize_t i; PyObject* result; char* buf; if (!PyArg_ParseTuple(args, "s#s#", &mask, &mask_len, &data, &data_len)) { return NULL; } result = PyBytes_FromStringAndSize(NULL, data_len); if (!result) { return NULL; } buf = PyBytes_AsString(result); for (i = 0; i < data_len; i++) { buf[i] = data[i] ^ mask[i % 4]; } return result; } static PyMethodDef methods[] = { {"websocket_mask", websocket_mask, METH_VARARGS, ""}, {NULL, NULL, 0, NULL} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef speedupsmodule = { PyModuleDef_HEAD_INIT, "speedups", NULL, -1, methods }; PyMODINIT_FUNC PyInit_speedups() { return PyModule_Create(&speedupsmodule); } #else // Python 2.x PyMODINIT_FUNC initspeedups() { Py_InitModule("tornado.speedups", methods); } #endif
#define PY_SSIZE_T_CLEAN #include <Python.h> static PyObject* websocket_mask(PyObject* self, PyObject* args) { const char* mask; Py_ssize_t mask_len; const char* data; Py_ssize_t data_len; Py_ssize_t i; PyObject* result; char* buf; if (!PyArg_ParseTuple(args, "s#s#", &mask, &mask_len, &data, &data_len)) { return NULL; } result = PyBytes_FromStringAndSize(NULL, data_len); if (!result) { return NULL; } buf = PyBytes_AsString(result); for (i = 0; i < data_len; i++) { buf[i] = data[i] ^ mask[i % 4]; } return result; } static PyMethodDef methods[] = { {"websocket_mask", websocket_mask, METH_VARARGS, ""}, {NULL, NULL, 0, NULL} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef speedupsmodule = { PyModuleDef_HEAD_INIT, "speedups", NULL, -1, methods }; PyMODINIT_FUNC PyInit_speedups(void) { return PyModule_Create(&speedupsmodule); } #else // Python 2.x PyMODINIT_FUNC initspeedups(void) { Py_InitModule("tornado.speedups", methods); } #endif
Add void to empty function parameter
Add void to empty function parameter This fixes the gcc warning: tornado/speedups.c:49:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes] initspeedups() { ^
C
apache-2.0
hhru/tornado,jehiah/tornado,mr-ping/tornado,arthurdarcet/tornado,tornadoweb/tornado,wsyzxcn/tornado,eklitzke/tornado,hhru/tornado,zguangyu/tornado,mehmetkose/tornado,NoyaInRain/tornado,lilydjwg/tornado,NoyaInRain/tornado,jehiah/tornado,eklitzke/tornado,mivade/tornado,fengsp/tornado,ColorFuzzy/tornado,wujuguang/tornado,arthurdarcet/tornado,hhru/tornado,mr-ping/tornado,Lancher/tornado,bdarnell/tornado,zguangyu/tornado,mehmetkose/tornado,ajdavis/tornado,bdarnell/tornado,SuminAndrew/tornado,legnaleurc/tornado,mr-ping/tornado,SuminAndrew/tornado,cyrusin/tornado,cyrusin/tornado,ajdavis/tornado,wujuguang/tornado,ifduyue/tornado,mivade/tornado,ifduyue/tornado,NoyaInRain/tornado,jehiah/tornado,ovidiucp/tornado,Lancher/tornado,hhru/tornado,wujuguang/tornado,mehmetkose/tornado,mehmetkose/tornado,legnaleurc/tornado,jsjohnst/tornado,SuminAndrew/tornado,tornadoweb/tornado,Lancher/tornado,dongpinglai/my_tornado,ColorFuzzy/tornado,mivade/tornado,zguangyu/tornado,mehmetkose/tornado,ColorFuzzy/tornado,arthurdarcet/tornado,lilydjwg/tornado,ifduyue/tornado,NoyaInRain/tornado,zguangyu/tornado,ovidiucp/tornado,cyrusin/tornado,tornadoweb/tornado,jsjohnst/tornado,allenl203/tornado,dongpinglai/my_tornado,bdarnell/tornado,legnaleurc/tornado,wsyzxcn/tornado,jehiah/tornado,cyrusin/tornado,wsyzxcn/tornado,jsjohnst/tornado,dongpinglai/my_tornado,eklitzke/tornado,wsyzxcn/tornado,obsh/tornado,ColorFuzzy/tornado,dongpinglai/my_tornado,NoyaInRain/tornado,legnaleurc/tornado,jsjohnst/tornado,cyrusin/tornado,fengsp/tornado,ajdavis/tornado,ColorFuzzy/tornado,wujuguang/tornado,obsh/tornado,ovidiucp/tornado,NoyaInRain/tornado,mehmetkose/tornado,mivade/tornado,ifduyue/tornado,cyrusin/tornado,dongpinglai/my_tornado,jehiah/tornado,allenl203/tornado,ovidiucp/tornado,legnaleurc/tornado,mr-ping/tornado,fengsp/tornado,eklitzke/tornado,SuminAndrew/tornado,lilydjwg/tornado,ajdavis/tornado,eklitzke/tornado,zguangyu/tornado,tornadoweb/tornado,wsyzxcn/tornado,obsh/tornado,arthurdarcet/tornado,Lancher/tornado,jsjohnst/tornado,arthurdarcet/tornado,Lancher/tornado,SuminAndrew/tornado,ColorFuzzy/tornado,jsjohnst/tornado,hhru/tornado,obsh/tornado,wsyzxcn/tornado,bdarnell/tornado,mr-ping/tornado,allenl203/tornado,bdarnell/tornado,obsh/tornado,lilydjwg/tornado,fengsp/tornado,obsh/tornado,ajdavis/tornado,fengsp/tornado,ifduyue/tornado,ovidiucp/tornado,allenl203/tornado,arthurdarcet/tornado,mivade/tornado,mr-ping/tornado,fengsp/tornado,ovidiucp/tornado,allenl203/tornado,zguangyu/tornado,wsyzxcn/tornado,dongpinglai/my_tornado,wujuguang/tornado
18d9955dfa631cc4963aa1df4959bd834ae4c8d6
Classes/ios/FlatUIKit.h
Classes/ios/FlatUIKit.h
// // FlatUIKit.h // FlatUI // // Created by Keisuke Kimura on 6/8/13. // Copyright (c) 2013 Keisuke Kimura. All rights reserved. // #ifndef FlatUI_FlatUIKit_h #define FlatUI_FlatUIKit_h #ifndef __IPHONE_5_0 #error "FlatUIKit uses features only available in iOS SDK 5.0 and later." #endif #if TARGET_OS_IPHONE #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #endif #endif #import "FUIAlertView.h" #import "FUIButton.h" #import "FUICellBackgroundView.h" #import "FUISegmentedControl.h" #import "FUISwitch.h" #import "UIBarButtonItem+FlatUI.h" #import "UIColor+FlatUI.h" #import "UIFont+FlatUI.h" #import "UIImage+FlatUI.h" #import "UINavigationBar+FlatUI.h" #import "UIProgressView+FlatUI.h" #import "UISlider+FlatUI.h" #import "UITabBar+FlatUI.h" #import "UITableViewCell+FlatUI.h" #ifdef __IPHONE_6_0 #import "UIStepper+FlatUI.h" #endif
// // FlatUIKit.h // FlatUI // // Created by Keisuke Kimura on 6/8/13. // Copyright (c) 2013 Keisuke Kimura. All rights reserved. // #ifndef FlatUI_FlatUIKit_h #define FlatUI_FlatUIKit_h #ifndef __IPHONE_5_0 #error "FlatUIKit uses features only available in iOS SDK 5.0 and later." #endif #if TARGET_OS_IPHONE #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #endif #endif #import "FUIAlertView.h" #import "FUIButton.h" #import "FUICellBackgroundView.h" #import "FUISegmentedControl.h" #import "FUISwitch.h" #import "UIBarButtonItem+FlatUI.h" #import "UIColor+FlatUI.h" #import "UIFont+FlatUI.h" #import "UIImage+FlatUI.h" #import "UINavigationBar+FlatUI.h" #import "UIProgressView+FlatUI.h" #import "UIStepper+FlatUI.h" #import "UISlider+FlatUI.h" #import "UITabBar+FlatUI.h" #import "UITableViewCell+FlatUI.h"
Remove OSVersion check of import "UIStepper+FlatUI.h"
Remove OSVersion check of import "UIStepper+FlatUI.h"
C
mit
hessu/FlatUIKit,zyprosoft/FlatUIKit,Grouper/FlatUIKit,lydonchandra/FlatUIKit,tfrank64/FlatUIKit,somedev/FlatUIKit,imjerrybao/FlatUIKit,lioonline/FlatUIKit,tuanpa199/FlatUIKit,AmitaiB/FlatUIKit,SummerHanada/FlatUIKit,ajrulez/FlatUIKit,applexiaohao/FlatUIKit,GuanKunLuo/FlatUIKit,fromeflow/FlatUIKit,0x73/FlatUIKit,hieutn/FlatUIKit,yangchenghu/FlatUIKit,ChaosCoder/FlatUIKit,brextonpham/FlatUIKit,yungfan/FlatUIKit,hanangellove/FlatUIKit,nathankot/FlatUIKit,algoaccess/FlatUIKit
0a422f6007fab2b8c41cb0c0b6d76e941b3fb913
c/sum_of_even_squares.c
c/sum_of_even_squares.c
int sum_of_even_squares(int* a, unsigned int length) { int total = 0; for (unsigned int i = 0; i < length; i++) { if (a[i] % 2 == 0) { total += a[i] * a[i]; } } return total; }
int sum_of_even_squares(int* a, unsigned int length) { int total = 0; for (unsigned int i = 0; i < length; i++) { if (a[i] % 2 == 0) { total += a[i] * a[i]; } } return total; } #include <assert.h> static int a[] = {7, 3, -8, 4, 1, 0, 11, 2}; int main() { assert(sum_of_even_squares(a, 0) == 0); assert(sum_of_even_squares(a, 1) == 0); assert(sum_of_even_squares(a, 2) == 0); assert(sum_of_even_squares(a, 3) == 64); assert(sum_of_even_squares(a, 4) == 80); assert(sum_of_even_squares(a, 5) == 80); assert(sum_of_even_squares(a, 6) == 80); assert(sum_of_even_squares(a, 7) == 80); assert(sum_of_even_squares(a, 8) == 84); return 0; }
Add asserts to C sum of even squares
Add asserts to C sum of even squares
C
mit
rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple
fccd0e6b8314ecc95bde542fe7031bc881dac722
components/libc/minilibc/sys/types.h
components/libc/minilibc/sys/types.h
#ifndef __TYPES_H__ #define __TYPES_H__ #include <rtthread.h> typedef long off_t; typedef rt_size_t size_t; typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef rt_uint8_t u_char; typedef rt_uint16_t u_short; typedef rt_ubase_t u_int; typedef rt_uint32_t u_long; typedef rt_time_t time_t; typedef int mode_t; typedef unsigned long clockid_t; typedef int pid_t; #ifndef NULL #define NULL RT_NULL #endif #define __u_char_defined #endif
#ifndef __TYPES_H__ #define __TYPES_H__ #include <rtthread.h> typedef long off_t; typedef __SIZE_TYPE__ size_t; typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef rt_uint8_t u_char; typedef rt_uint16_t u_short; typedef rt_ubase_t u_int; typedef rt_uint32_t u_long; typedef rt_time_t time_t; typedef int mode_t; typedef unsigned long clockid_t; typedef int pid_t; #ifndef NULL #define NULL RT_NULL #endif #define __u_char_defined #endif
Use __SIZE_TYPE__ instead of rt_size_t in minilibc.
[libc] Use __SIZE_TYPE__ instead of rt_size_t in minilibc.
C
apache-2.0
zhaojuntao/rt-thread,nongxiaoming/rt-thread,hezlog/rt-thread,wolfgangz2013/rt-thread,nongxiaoming/rt-thread,geniusgogo/rt-thread,yongli3/rt-thread,geniusgogo/rt-thread,weety/rt-thread,hezlog/rt-thread,weiyuliang/rt-thread,ArdaFu/rt-thread,ArdaFu/rt-thread,AubrCool/rt-thread,geniusgogo/rt-thread,AubrCool/rt-thread,wolfgangz2013/rt-thread,RT-Thread/rt-thread,ArdaFu/rt-thread,wolfgangz2013/rt-thread,zhaojuntao/rt-thread,AubrCool/rt-thread,gbcwbz/rt-thread,hezlog/rt-thread,zhaojuntao/rt-thread,armink/rt-thread,FlyLu/rt-thread,igou/rt-thread,armink/rt-thread,hezlog/rt-thread,weiyuliang/rt-thread,AubrCool/rt-thread,FlyLu/rt-thread,nongxiaoming/rt-thread,igou/rt-thread,geniusgogo/rt-thread,weiyuliang/rt-thread,FlyLu/rt-thread,weety/rt-thread,ArdaFu/rt-thread,wolfgangz2013/rt-thread,FlyLu/rt-thread,igou/rt-thread,armink/rt-thread,weety/rt-thread,wolfgangz2013/rt-thread,FlyLu/rt-thread,RT-Thread/rt-thread,yongli3/rt-thread,AubrCool/rt-thread,weiyuliang/rt-thread,AubrCool/rt-thread,RT-Thread/rt-thread,geniusgogo/rt-thread,armink/rt-thread,zhaojuntao/rt-thread,RT-Thread/rt-thread,gbcwbz/rt-thread,ArdaFu/rt-thread,nongxiaoming/rt-thread,yongli3/rt-thread,RT-Thread/rt-thread,FlyLu/rt-thread,igou/rt-thread,weiyuliang/rt-thread,yongli3/rt-thread,armink/rt-thread,geniusgogo/rt-thread,wolfgangz2013/rt-thread,AubrCool/rt-thread,weety/rt-thread,weety/rt-thread,igou/rt-thread,gbcwbz/rt-thread,weiyuliang/rt-thread,zhaojuntao/rt-thread,yongli3/rt-thread,hezlog/rt-thread,weiyuliang/rt-thread,zhaojuntao/rt-thread,armink/rt-thread,igou/rt-thread,RT-Thread/rt-thread,nongxiaoming/rt-thread,gbcwbz/rt-thread,hezlog/rt-thread,weety/rt-thread,zhaojuntao/rt-thread,ArdaFu/rt-thread,nongxiaoming/rt-thread,weety/rt-thread,igou/rt-thread,RT-Thread/rt-thread,armink/rt-thread,geniusgogo/rt-thread,yongli3/rt-thread,gbcwbz/rt-thread,yongli3/rt-thread,wolfgangz2013/rt-thread,FlyLu/rt-thread,ArdaFu/rt-thread,nongxiaoming/rt-thread,gbcwbz/rt-thread,gbcwbz/rt-thread,hezlog/rt-thread
bf94028e883779ee7ee9da58a970796ab8b0be25
program2.c
program2.c
/* * CIS 314 Fall 2015 Lab 1 * Assigned project * * This program reads a sorted array from a file and finds a requested number * using recursive or iterative binary search. The array is read from a file * defined by FILE_NAME, which should be written as the number of elements * followed by the elements themselses. each number can be deliniated with * any whitepace character. Also, the maximum size of the array is defined * as MAX_SIZE. * * NOTE: The array must be sorted!! * */ #include <stdio.h> #include <stdlib.h> #include <time.h> #define MAX_SIZE 150 #define FILE_NAME "array.dat" //must include quotes // Implement the rest of the program int main(void) { FILE *in_file; int array[MAX_SIZE]; int size; char in_file_name[] = FILE_NAME; printf("\n\n=== CIS314 Fall 2014 - Lab 1: Part 2: Program 2 ===\n\n"); printf("\n\n"); return 0; } int recursiveBinarySearch(int list_of_numbers[], int desired_number, int low_number, int high_number) { } int iterativeBinarySearch(int list_of_numbers[], int desired_number) { }
/* * CIS 314 Fall 2015 Lab 1 * Assigned project * * This program reads a sorted array from a file and finds a requested number * using recursive or iterative binary search. The array is read from a file * defined by FILE_NAME, which should be written as the number of elements * followed by the elements themselses. each number can be deliniated with * any whitepace character. Also, the maximum size of the array is defined * as MAX_SIZE. * * NOTE: The array must be sorted!! * */ #include <stdio.h> #include <stdlib.h> #include <time.h> #define MAX_SIZE 150 #define FILE_NAME "array.dat" //must include quotes // Implement the rest of the program int main(void) { FILE *in_file; int array[MAX_SIZE]; int size; char in_file_name[] = FILE_NAME; printf("\n\n=== CIS314 Fall 2014 - Lab 1: Part 2: Program 2 ===\n\n"); printf("\n\n"); return 0; } int recursiveBinarySearch(int list_of_numbers[], int desired_number, int low_number, int high_number) { } int iterativeBinarySearch(int list_of_numbers[], int desired_number) { int low = 0; int high = (sizeof(list_of_numbers)/sizeof(list_of_numbers[0])) - 1 }
Add high and low in iterative
Add high and low in iterative
C
mit
jacobbieker/CIS314_Lab_1
814fd55d1b26335f1765ed59fda4b6325893a9ad
include/win32/strings.h
include/win32/strings.h
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2014 Couchbase, 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. */ #pragma once #include <stdarg.h> #include <platform/visibility.h> PLATFORM_PUBLIC_API int asprintf(char **ret, const char *format, ...); PLATFORM_PUBLIC_API int vasprintf(char **ret, const char *format, va_list ap); /* * We have a fair amount of use of this file in our code base. * Let's just make a dummy file to aviod a lot of #ifdefs */ #ifndef strcasecmp #define strcasecmp(a, b) _stricmp(a, b) #endif #ifndef snprintf #define snprintf _snprintf #endif
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2014 Couchbase, 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. */ #pragma once #include <stdarg.h> #include <platform/visibility.h> #ifdef __cplusplus extern "C" { #endif PLATFORM_PUBLIC_API int asprintf(char **ret, const char *format, ...); PLATFORM_PUBLIC_API int vasprintf(char **ret, const char *format, va_list ap); #ifdef __cplusplus } #endif /* * We have a fair amount of use of this file in our code base. * Let's just make a dummy file to aviod a lot of #ifdefs */ #ifndef strcasecmp #define strcasecmp(a, b) _stricmp(a, b) #endif #ifndef snprintf #define snprintf _snprintf #endif
Set C linkage for win32 [v]asprintf
Set C linkage for win32 [v]asprintf Change-Id: I7f82255467c05936baa702fa1d532156b0caba12 Reviewed-on: http://review.couchbase.org/52114 Reviewed-by: Dave Rigby <a09264da4832c7ff1d3bf1608a19f4b870f93750@couchbase.com> Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
C
apache-2.0
vmx/platform,vmx/platform
58874bbedc4afe8d2fb9318e965513f1b8219441
DiskSampling/PoissonDiskSampling.h
DiskSampling/PoissonDiskSampling.h
#ifndef POISSON_DISK_SAMPLING_H #define POISSON_DISK_SAMPLING_H #include <vector> class PoissonDiskSampling { public: PoissonDiskSampling() = default; ~PoissonDiskSampling() = default; PoissonDiskSampling(const PoissonDiskSampling& rhs) = default; PoissonDiskSampling(const PoissonDiskSampling&& rhs) = default; PoissonDiskSampling& operator=(const PoissonDiskSampling& rhs) = default; PoissonDiskSampling& operator=(const PoissonDiskSampling&& rhs) = default; public: PoissonDiskSampling(int pointWidth, int pointHeight, double pointMinDist, double pointCount); std::vector<std::pair<double, double>> Generate(); }; #endif
#ifndef POISSON_DISK_SAMPLING_H #define POISSON_DISK_SAMPLING_H #include <vector> class PoissonDiskSampling { public: PoissonDiskSampling() = default; PoissonDiskSampling(int pointWidth, int pointHeight, double pointMinDist, double pointCount); ~PoissonDiskSampling() = default; PoissonDiskSampling(const PoissonDiskSampling& pds) = delete; PoissonDiskSampling(PoissonDiskSampling&& pds) = delete; PoissonDiskSampling& operator=(const PoissonDiskSampling& rhs) = delete; PoissonDiskSampling& operator=(PoissonDiskSampling&& rhs) = delete; std::vector<std::pair<double, double>> Generate(); struct Point { Point() : x(0.0), y(0.0) { } Point(double _x, double _y) : x(_x), y(_y) { } ~Point() = default; Point(const Point& p) : x(p.x), y(p.y) { } Point(Point&& p) : x(p.x), y(p.y) { } Point& operator=(const Point& rhs) { if (this == &rhs) { return; } x = rhs.x; y = rhs.y; return *this; } Point& operator=(Point&& rhs) { if (this == &rhs) { return; } x = rhs.x; y = rhs.y; return *this; } double x, y; }; }; #endif
Fix grammer error and implement Point structure
Fix grammer error and implement Point structure
C
mit
utilForever/PolyMapGenerator
4c6d97a34e6d86721390f3ecb43be45e38e7f1f8
include/IpToCountryDB.h
include/IpToCountryDB.h
/* OpenLieroX reader for IpToCountry database code under LGPL by Albert Zeyer and Dark Charlie */ #ifndef __IPTOCOUNTRY_H__ #define __IPTOCOUNTRY_H__ #include <string> #include "SmartPointer.h" #include "InternDataClass.h" #include "GeoIPDatabase.h" struct SDL_Surface; typedef GeoRecord IpInfo; INTERNDATA_CLASS_BEGIN(IpToCountryDB) private: GeoIPDatabase *m_database; public: IpToCountryDB(const std::string& dbfile); void LoadDBFile(const std::string& dbfile); IpInfo GetInfoAboutIP(const std::string& Address); SmartPointer<SDL_Surface> GetCountryFlag(const std::string& shortcut); int GetProgress() { return 100; } bool Loaded() { return true; } INTERNDATA_CLASS_END extern char *IP_TO_COUNTRY_FILE; extern IpToCountryDB *tIpToCountryDB; #endif
/* OpenLieroX reader for IpToCountry database code under LGPL by Albert Zeyer and Dark Charlie */ #ifndef __IPTOCOUNTRY_H__ #define __IPTOCOUNTRY_H__ #include <string> #include "SmartPointer.h" #include "InternDataClass.h" #include "GeoIPDatabase.h" struct SDL_Surface; typedef GeoRecord IpInfo; INTERNDATA_CLASS_BEGIN(IpToCountryDB) private: GeoIPDatabase *m_database; public: IpToCountryDB(const std::string& dbfile); void LoadDBFile(const std::string& dbfile); IpInfo GetInfoAboutIP(const std::string& Address); SmartPointer<SDL_Surface> GetCountryFlag(const std::string& shortcut); int GetProgress() { return 100; } bool Loaded() { return m_database != NULL && m_database->loaded(); } INTERNDATA_CLASS_END extern char *IP_TO_COUNTRY_FILE; extern IpToCountryDB *tIpToCountryDB; #endif
Fix for checking if the database is loaded
Fix for checking if the database is loaded
C
lgpl-2.1
ProfessorKaos64/openlierox,ProfessorKaos64/openlierox,ProfessorKaos64/openlierox,ProfessorKaos64/openlierox,ProfessorKaos64/openlierox,ProfessorKaos64/openlierox,ProfessorKaos64/openlierox
f2dc1a3e5a5d939fa07f4641dbd1d32a6fed71e5
log.c
log.c
#include <stdio.h> #include <stdarg.h> #include <time.h> #include <unistd.h> #include "log.h" #include "globals.h" void my_log(int priority, const char *format, ...) { va_list ap; va_start(ap, format); #ifndef MINIMALISTIC_BUILD if (globals.no_syslog) { #endif time_t now; struct tm* timeinfo; char timestring[32]; time(&now); timeinfo = localtime(&now); strftime(timestring, sizeof(timestring), "%Y-%m-%d %H:%M:%S", timeinfo); fprintf( stderr, "%s %s[%d]: ", timestring, #ifndef MINIMALISTIC_BUILD globals.daemon_name, #else "ssh-honeypotd", #endif getpid() ); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" vfprintf(stderr, format, ap); #pragma GCC diagnostic pop fprintf(stderr, "\n"); #ifndef MINIMALISTIC_BUILD } else { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" vsyslog(priority, format, ap); #pragma GCC diagnostic pop } #endif va_end(ap); }
#include <stdio.h> #include <stdarg.h> #include <time.h> #include <unistd.h> #include "log.h" #include "globals.h" void my_log(int priority, const char *format, ...) { va_list ap; va_start(ap, format); #ifndef MINIMALISTIC_BUILD if (globals.no_syslog) { #endif time_t now; struct tm timeinfo; char timestring[32]; time(&now); localtime_r(&now, &timeinfo); strftime(timestring, sizeof(timestring), "%Y-%m-%d %H:%M:%S", &timeinfo); fprintf( stderr, "%s %s[%d]: ", timestring, #ifndef MINIMALISTIC_BUILD globals.daemon_name, #else "ssh-honeypotd", #endif getpid() ); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" vfprintf(stderr, format, ap); #pragma GCC diagnostic pop fprintf(stderr, "\n"); #ifndef MINIMALISTIC_BUILD } else { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" vsyslog(priority, format, ap); #pragma GCC diagnostic pop } #endif va_end(ap); }
Address issues found by LGTM
Address issues found by LGTM
C
mit
sjinks/ssh-honeypotd,sjinks/ssh-honeypotd
ee99eef691ae08f3bea6012e0ff81850be1a4906
Quick/Quick.h
Quick/Quick.h
#import <Foundation/Foundation.h> //! Project version number for Quick. FOUNDATION_EXPORT double QuickVersionNumber; //! Project version string for Quick. FOUNDATION_EXPORT const unsigned char QuickVersionString[]; #import <Quick/QuickSpec.h>
#import <Foundation/Foundation.h> //! Project version number for Quick. FOUNDATION_EXPORT double QuickVersionNumber; //! Project version string for Quick. FOUNDATION_EXPORT const unsigned char QuickVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <Quick/PublicHeader.h> #import <Quick/QuickSpec.h> #import <Quick/QCKDSL.h> #import <Quick/QuickConfiguration.h>
Revert "Remove public headers from umbrella header"
Revert "Remove public headers from umbrella header" This reverts commit 3c5ab51a235a400427b364a608e679d91390f96a.
C
apache-2.0
ikesyo/Quick,Quick/Quick,jeffh/Quick,Quick/Quick,jasonchaffee/Quick,jasonchaffee/Quick,paulyoung/Quick,marciok/Quick,jasonchaffee/Quick,phatblat/Quick,ikesyo/Quick,DanielAsher/Quick,ashfurrow/Quick,marciok/Quick,DanielAsher/Quick,paulyoung/Quick,ikesyo/Quick,ashfurrow/Quick,Quick/Quick,mokagio/Quick,paulyoung/Quick,phatblat/Quick,jeffh/Quick,dgdosen/Quick,mokagio/Quick,jeffh/Quick,phatblat/Quick,mokagio/Quick,dgdosen/Quick,Quick/Quick,dgdosen/Quick,phatblat/Quick,marciok/Quick
bdcc37fe2d21afdb01fcc3f0213ae909ebd4f3cb
ObjcNullability/ObjcNullability/BlockExamples.h
ObjcNullability/ObjcNullability/BlockExamples.h
// // BlockExamples.h // ObjcNullability // // Created by Bryan Luby on 5/21/15. // Copyright (c) 2015 Bryan Luby. All rights reserved. // #import <Foundation/Foundation.h> typedef void(^TestBlock)(NSString * __nonnull stuff); typedef void(^TestBlock2)(NSString * __nullable otherStuff); NS_ASSUME_NONNULL_BEGIN typedef void(^TestBlock3)(NSString *aString); NS_ASSUME_NONNULL_END @interface BlockExamples : NSObject - (void)methodThatTakesABlock:(nullable TestBlock)block; - (void)anotherMethodThatTakesABlock:(nonnull TestBlock2)block; @end
// // BlockExamples.h // ObjcNullability // // Created by Bryan Luby on 5/21/15. // Copyright (c) 2015 Bryan Luby. All rights reserved. // #import <Foundation/Foundation.h> typedef void(^TestBlock)(NSString * __nonnull stuff); typedef void(^TestBlock2)(NSString * __nullable otherStuff); NS_ASSUME_NONNULL_BEGIN typedef void(^TestBlock3)(NSString *aString); NS_ASSUME_NONNULL_END typedef NSString *__nonnull(^TestBlock4)(NSString *__nonnull aString); @interface BlockExamples : NSObject - (void)methodThatTakesABlock:(nullable TestBlock)block; - (void)anotherMethodThatTakesABlock:(nonnull TestBlock2)block; @end
Add typedef block with return value
Add typedef block with return value
C
mit
bryanluby/XcodeTestProjects,bryanluby/XcodeTestProjects
a5df96b98e206885fcd5010bec59f080c5b630ab
src/RCoRoutineRunner.h
src/RCoRoutineRunner.h
#ifndef __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #define __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #include <pt/pt.h> class RCoRoutineRunner { public: RCoRoutineRunner(); virtual ~RCoRoutineRunner(); virtual char run(); public: struct pt mPt; }; #endif // __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C
#ifndef __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #define __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C #include <pt/pt.h> class RCoRoutineRunner { public: RCoRoutineRunner(); virtual ~RCoRoutineRunner(); virtual char run() = 0; public: struct pt mPt; }; #endif // __INCLUDED_ECE554E80AF211E7AA6EA088B4D1658C
Mark run() as pure virtual function
Mark run() as pure virtual function
C
mit
starofrainnight/ArduinoRabirdTookit,starofrainnight/ArduinoRabirdToolkit,starofrainnight/ArduinoRabirdToolkit
acc9bf3716be80a19f514f228cb903c0910a1725
test/Index/preamble.c
test/Index/preamble.c
#include "prefix.h" #include "preamble.h" int wibble(int); // RUN: %clang -x c-header -o %t.pch %S/Inputs/prefix.h // RUN: CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -I %S/Inputs -include %t %s | FileCheck %s // CHECK: preamble.c:3:5: FunctionDecl=wibble:3:5 Extent=[3:5 - 3:16] // CHECK: preamble.c:3:15: ParmDecl=:3:15 (Definition) Extent=[3:12 - 3:16]
#include "prefix.h" #include "preamble.h" int wibble(int); // RUN: %clang -x c-header -o %t.pch %S/Inputs/prefix.h // RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -I %S/Inputs -include %t %s | FileCheck %s // CHECK: preamble.c:3:5: FunctionDecl=wibble:3:5 Extent=[3:5 - 3:16] // CHECK: preamble.c:3:15: ParmDecl=:3:15 (Definition) Extent=[3:12 - 3:16]
Use env instead of assuming bash.
tests: Use env instead of assuming bash. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@109864 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
8605544c0b0cbc5ad43d86a71402f3f4075b48e3
paddle/utils/Compiler.h
paddle/utils/Compiler.h
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #pragma once #ifdef __GNUC__ #define GCC_VERSION \ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #else #define GCC_VERSION #endif #if GCC_VERSION >= 30400 #define __must_check __attribute__((warn_unused_result)) #else #define __must_check #endif
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #pragma once /** * This header defines some useful attribute by each compiler. It is the * abstract layer of compilers. */ #ifdef __GNUC__ #define GCC_VERSION \ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #else #define GCC_VERSION #endif /** * __must_check macro. It make the function's return value must be used, * otherwise it will raise a compile warning. And also Paddle treat all compile * warnings as errors. */ #if GCC_VERSION >= 30400 #define __must_check __attribute__((warn_unused_result)) #else #define __must_check #endif
Add some comments to compiler.h
Add some comments to compiler.h
C
apache-2.0
livc/Paddle,livc/Paddle,cxysteven/Paddle,wen-bo-yang/Paddle,lispc/Paddle,yu239/Paddle,yu239/Paddle,reyoung/Paddle,lispc/Paddle,luotao1/Paddle,pengli09/Paddle,hedaoyuan/Paddle,lispc/Paddle,yu239/Paddle,pengli09/Paddle,yu239/Paddle,pkuyym/Paddle,chengduoZH/Paddle,reyoung/Paddle,livc/Paddle,cxysteven/Paddle,Canpio/Paddle,putcn/Paddle,cxysteven/Paddle,lcy-seso/Paddle,pkuyym/Paddle,QiJune/Paddle,luotao1/Paddle,putcn/Paddle,chengduoZH/Paddle,hedaoyuan/Paddle,gangliao/Paddle,emailweixu/Paddle,gangliao/Paddle,emailweixu/Paddle,putcn/Paddle,pengli09/Paddle,lcy-seso/Paddle,chengduoZH/Paddle,PaddlePaddle/Paddle,QiJune/Paddle,reyoung/Paddle,tensor-tang/Paddle,reyoung/Paddle,emailweixu/Paddle,baidu/Paddle,lispc/Paddle,PaddlePaddle/Paddle,wen-bo-yang/Paddle,wen-bo-yang/Paddle,Canpio/Paddle,jacquesqiao/Paddle,pengli09/Paddle,livc/Paddle,lispc/Paddle,lcy-seso/Paddle,putcn/Paddle,cxysteven/Paddle,luotao1/Paddle,yu239/Paddle,luotao1/Paddle,gangliao/Paddle,luotao1/Paddle,luotao1/Paddle,reyoung/Paddle,lispc/Paddle,PaddlePaddle/Paddle,cxysteven/Paddle,tensor-tang/Paddle,pengli09/Paddle,wen-bo-yang/Paddle,emailweixu/Paddle,cxysteven/Paddle,lcy-seso/Paddle,pkuyym/Paddle,hedaoyuan/Paddle,QiJune/Paddle,cxysteven/Paddle,tensor-tang/Paddle,putcn/Paddle,Canpio/Paddle,lcy-seso/Paddle,wen-bo-yang/Paddle,tensor-tang/Paddle,jacquesqiao/Paddle,PaddlePaddle/Paddle,hedaoyuan/Paddle,emailweixu/Paddle,livc/Paddle,PaddlePaddle/Paddle,yu239/Paddle,baidu/Paddle,QiJune/Paddle,tensor-tang/Paddle,pengli09/Paddle,gangliao/Paddle,gangliao/Paddle,pkuyym/Paddle,pkuyym/Paddle,jacquesqiao/Paddle,Canpio/Paddle,lcy-seso/Paddle,pkuyym/Paddle,hedaoyuan/Paddle,reyoung/Paddle,lispc/Paddle,emailweixu/Paddle,gangliao/Paddle,jacquesqiao/Paddle,PaddlePaddle/Paddle,pengli09/Paddle,gangliao/Paddle,Canpio/Paddle,jacquesqiao/Paddle,Canpio/Paddle,yu239/Paddle,QiJune/Paddle,chengduoZH/Paddle,PaddlePaddle/Paddle,yu239/Paddle,jacquesqiao/Paddle,Canpio/Paddle,baidu/Paddle,wen-bo-yang/Paddle,chengduoZH/Paddle,putcn/Paddle,livc/Paddle,baidu/Paddle,lispc/Paddle,baidu/Paddle,QiJune/Paddle,wen-bo-yang/Paddle,emailweixu/Paddle,hedaoyuan/Paddle,Canpio/Paddle,pengli09/Paddle,hedaoyuan/Paddle,livc/Paddle,hedaoyuan/Paddle,luotao1/Paddle
0f723b00387c4fe9134ac41f8d6d658f5b12901e
src/main.c
src/main.c
// Copyright 2016 Mitchell Kember. Subject to the MIT License. #include "translate.h" #include "transmit.h" #include "util.h" #include <stdio.h> #include <unistd.h> int main(int argc, char **argv) { setup_util(argv[0]); // Initialize options to default values. int mode = 'e'; int time_unit = 0; // Get command line options. int c; extern char *optarg; extern int optind, optopt; while ((c = getopt(argc, argv, "hedt:")) != -1) { switch (c) { case 'h': print_usage(stdout); return 0; case 't': if (!parse_int(&time_unit, optarg)) { return 1; } // fall through case 'e': case 'd': mode = c; break; case '?': return 1; } } // Make sure all arguments were processed. if (optind != argc) { print_usage(stderr); return 1; } // Dispatch to the chosen subprogram. switch (mode) { case 'e': return encode(); case 'd': return decode(); case 't': return transmit(time_unit); } }
// Copyright 2016 Mitchell Kember. Subject to the MIT License. #include "translate.h" #include "transmit.h" #include "util.h" #include <stdio.h> #include <unistd.h> int main(int argc, char **argv) { setup_util(argv[0]); // Initialize the default mode. int mode = 'e'; // Get command line options. int c; extern char *optarg; extern int optind, optopt; while ((c = getopt(argc, argv, "hedt")) != -1) { switch (c) { case 'h': print_usage(stdout); return 0; case 'e': case 'd': case 't': mode = c; break; case '?': return 1; } } // Make sure all arguments were processed. if (optind != argc) { print_usage(stderr); return 1; } // Dispatch to the chosen subprogram. switch (mode) { case 'e': return encode(); case 'd': return decode(); case 't': return transmit(); } }
Remove option argument for transmit mode
Remove option argument for transmit mode
C
mit
mk12/morse
f4131aca5d93830c9559440d19cf66aa1838d10b
src/main.c
src/main.c
#include <stdio.h> #include <stdlib.h> #include <sysexits.h> #include <unistd.h> #include "choices.h" #include "config.h" #include "io.h" #include "ui.h" void usage(); void version(); int main(int argc,char **argv) { int ch; struct choices *cs; while ((ch = getopt(argc, argv, "hv")) != -1) switch (ch) { case 'v': version(); default: usage(); } argc -= optind; argv += optind; cs = get_choices(); put_choice(get_selected(cs)); choices_free(cs); return EX_OK; } void usage() { fprintf(stderr, "usage: pick [-h]\n"); fprintf(stderr, " -h display this help message and exit\n"); fprintf(stderr, " -v display the version and exit\n"); exit(EX_USAGE); } void version() { printf("%s\n", PACKAGE_VERSION); exit(EX_OK); }
#include <stdio.h> #include <stdlib.h> #include <sysexits.h> #include <unistd.h> #include "choices.h" #include "config.h" #include "io.h" #include "ui.h" void usage(); void version(); int main(int argc,char **argv) { int ch; struct choices *cs; while ((ch = getopt(argc, argv, "hv")) != -1) switch (ch) { case 'v': version(); default: usage(); } argc -= optind; argv += optind; cs = get_choices(); put_choice(get_selected(cs)); choices_free(cs); return EX_OK; } void usage() { fprintf(stderr, "usage: pick [-h] [-v]\n"); fprintf(stderr, " -h display this help message and exit\n"); fprintf(stderr, " -v display the version and exit\n"); exit(EX_USAGE); } void version() { printf("%s\n", PACKAGE_VERSION); exit(EX_OK); }
Correct usage message option list.
Correct usage message option list.
C
mit
DBOTW/pick,prahlad37/pick,prahlad37/pick,GBuella/pick,temochka/pick,DBOTW/pick,thoughtbot/pick,temochka/pick,calleerlandsson/pick,DBOTW/pick,prahlad37/pick,thoughtbot/pick,thoughtbot/pick,calleerlandsson/pick,calleerlandsson/pick,thoughtbot/pick,GBuella/pick,prahlad37/pick
91b6f8dd73c6cead933c396d27405d50ad1e4633
tcp/main.c
tcp/main.c
#include <stdlib.h> #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { return 0; }
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "timer.h" #include "ports.h" int main(int argc, char *argv[]) { int prt, time; mach_port_t port; tcp_timer_t timer; char buffer[4096]; typeinfo_t tpinfo; timer_message_t* msg = (timer_message_t*)buffer; mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &port); timer = start_timer_thread(port); while(1) { scanf("%d", &prt); scanf("%d", &time); if(time == 0) break; add_timer(timer, time, prt, (uintptr_t)(argv[prt % argc])); } while(1) { if(!receive_data(&port, &tpinfo, buffer, 1024)) continue; printf("Received : %d -> \"%s\"\n", msg->port, (char*)msg->data); if(msg->port == 42) break; } return 0; }
Create code to test timer
Create code to test timer
C
mit
lucas8/ENS_sysres,lucas8/ENS_sysres
af8e53a6a1f592c6d3e4ce1bf100ec7b927ef679
CefSharp.Core/SchemeHandlerFactoryWrapper.h
CefSharp.Core/SchemeHandlerFactoryWrapper.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" #include "include/cef_scheme.h" #include "Internals/AutoLock.h" using namespace System; using namespace System::IO; using namespace System::Collections::Specialized; namespace CefSharp { private class SchemeHandlerFactoryWrapper : public CefSchemeHandlerFactory { gcroot<ISchemeHandlerFactory^> _factory; public: SchemeHandlerFactoryWrapper(ISchemeHandlerFactory^ factory) : _factory(factory) {} ~SchemeHandlerFactoryWrapper() { _factory = nullptr; } virtual CefRefPtr<CefResourceHandler> SchemeHandlerFactoryWrapper::Create(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& scheme_name, CefRefPtr<CefRequest> request) OVERRIDE { auto handler = _factory->Create(); CefRefPtr<ResourceHandlerWrapper> wrapper = new ResourceHandlerWrapper(handler); return static_cast<CefRefPtr<CefResourceHandler>>(wrapper); } IMPLEMENT_REFCOUNTING(SchemeHandlerFactoryWrapper); }; }
// 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" #include "include/cef_scheme.h" #include "Internals/AutoLock.h" using namespace System; using namespace System::IO; using namespace System::Collections::Specialized; namespace CefSharp { private class SchemeHandlerFactoryWrapper : public CefSchemeHandlerFactory { gcroot<ISchemeHandlerFactory^> _factory; public: SchemeHandlerFactoryWrapper(ISchemeHandlerFactory^ factory) : _factory(factory) {} ~SchemeHandlerFactoryWrapper() { _factory = nullptr; } virtual CefRefPtr<CefResourceHandler> Create(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& scheme_name, CefRefPtr<CefRequest> request) OVERRIDE { auto handler = _factory->Create(); CefRefPtr<ResourceHandlerWrapper> wrapper = new ResourceHandlerWrapper(handler); return static_cast<CefRefPtr<CefResourceHandler>>(wrapper); } IMPLEMENT_REFCOUNTING(SchemeHandlerFactoryWrapper); }; }
Remove redundant method prefix (cpp)
Remove redundant method prefix (cpp)
C
bsd-3-clause
rlmcneary2/CefSharp,illfang/CefSharp,windygu/CefSharp,haozhouxu/CefSharp,battewr/CefSharp,joshvera/CefSharp,twxstar/CefSharp,ruisebastiao/CefSharp,ruisebastiao/CefSharp,battewr/CefSharp,jamespearce2006/CefSharp,Haraguroicha/CefSharp,VioletLife/CefSharp,dga711/CefSharp,zhangjingpu/CefSharp,AJDev77/CefSharp,illfang/CefSharp,windygu/CefSharp,windygu/CefSharp,illfang/CefSharp,twxstar/CefSharp,AJDev77/CefSharp,zhangjingpu/CefSharp,joshvera/CefSharp,VioletLife/CefSharp,ruisebastiao/CefSharp,Livit/CefSharp,AJDev77/CefSharp,ITGlobal/CefSharp,yoder/CefSharp,Livit/CefSharp,Livit/CefSharp,gregmartinhtc/CefSharp,dga711/CefSharp,NumbersInternational/CefSharp,joshvera/CefSharp,NumbersInternational/CefSharp,gregmartinhtc/CefSharp,twxstar/CefSharp,ITGlobal/CefSharp,rlmcneary2/CefSharp,rlmcneary2/CefSharp,Haraguroicha/CefSharp,gregmartinhtc/CefSharp,dga711/CefSharp,jamespearce2006/CefSharp,haozhouxu/CefSharp,battewr/CefSharp,dga711/CefSharp,jamespearce2006/CefSharp,Livit/CefSharp,joshvera/CefSharp,yoder/CefSharp,Haraguroicha/CefSharp,wangzheng888520/CefSharp,gregmartinhtc/CefSharp,haozhouxu/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,jamespearce2006/CefSharp,rlmcneary2/CefSharp,twxstar/CefSharp,battewr/CefSharp,illfang/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,NumbersInternational/CefSharp,zhangjingpu/CefSharp,Haraguroicha/CefSharp,NumbersInternational/CefSharp,wangzheng888520/CefSharp,Haraguroicha/CefSharp,ITGlobal/CefSharp,yoder/CefSharp,zhangjingpu/CefSharp,yoder/CefSharp,ITGlobal/CefSharp,windygu/CefSharp,AJDev77/CefSharp,wangzheng888520/CefSharp,ruisebastiao/CefSharp,VioletLife/CefSharp
ac3bb2f33bb0423bc8770aa34140637c0542fbc7
test/Profile/c-linkage-available_externally.c
test/Profile/c-linkage-available_externally.c
// Make sure instrumentation data from available_externally functions doesn't // get thrown out and are emitted with the expected linkage. // RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s // CHECK: @__profc_foo = linkonce_odr hidden global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8 // CHECK: @__profd_foo = linkonce_odr hidden global {{.*}} i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0){{.*}}, section "__DATA,__llvm_prf_data", align 8 inline int foo(void) { return 1; } int main(void) { return foo(); }
// Make sure instrumentation data from available_externally functions doesn't // get thrown out and are emitted with the expected linkage. // RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s // CHECK: @__profc_foo = linkonce_odr hidden global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8 // CHECK: @__profd_foo = linkonce_odr hidden global {{.*}} i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0){{.*}}, section "__DATA,__llvm_prf_data,regular,live_support", align 8 inline int foo(void) { return 1; } int main(void) { return foo(); }
Update testcase for r283948 (NFC)
[Profile] Update testcase for r283948 (NFC) Old: "__DATA,__llvm_prf_data" New: "__DATA,__llvm_prf_data,regular,live_support" This should fix the following bot failure: http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55158 git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@283949 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit 88f1ce548a1e06c1d40dea57346dcd654f718fb7)
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
208d421c4f32fd8fd7dfccedfb18f36a0444168f
hw/mcu/stm/stm32f4xx/include/mcu/cmsis_nvic.h
hw/mcu/stm/stm32f4xx/include/mcu/cmsis_nvic.h
/* mbed Microcontroller Library - cmsis_nvic * Copyright (c) 2009-2011 ARM Limited. All rights reserved. * * CMSIS-style functionality to support dynamic vectors */ #ifndef MBED_CMSIS_NVIC_H #define MBED_CMSIS_NVIC_H #include <stdint.h> #if defined(STM32F407xx) #define MCU_NUM_PERIPH_VECTORS 82 #elif defined(STM32F401xE) #define MCU_NUM_PERIPH_VECTORS 85 #elif defined(STM32F427xx) || defined(STM32F429xx) #define MCU_NUM_PERIPH_VECTORS 91 #elif defined(STM32F413xx) #define MCU_NUM_PERIPH_VECTORS 102 #else #error "Number of peripheral vectors not defined for this MCU." #endif #define NVIC_USER_IRQ_OFFSET 16 #define NVIC_NUM_VECTORS (16 + MCU_NUM_PERIPH_VECTORS) #include "stm32f4xx.h" #ifdef __cplusplus extern "C" { #endif void NVIC_Relocate(void); void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector); uint32_t NVIC_GetVector(IRQn_Type IRQn); #ifdef __cplusplus } #endif #endif
/* mbed Microcontroller Library - cmsis_nvic * Copyright (c) 2009-2011 ARM Limited. All rights reserved. * * CMSIS-style functionality to support dynamic vectors */ #ifndef MBED_CMSIS_NVIC_H #define MBED_CMSIS_NVIC_H #include <stdint.h> #if defined(STM32F401xE) || defined(STM32F407xx) #define MCU_NUM_PERIPH_VECTORS 82 #elif defined(STM32F427xx) || defined(STM32F429xx) #define MCU_NUM_PERIPH_VECTORS 91 #elif defined(STM32F413xx) #define MCU_NUM_PERIPH_VECTORS 102 #else #error "Number of peripheral vectors not defined for this MCU." #endif #define NVIC_USER_IRQ_OFFSET 16 #define NVIC_NUM_VECTORS (16 + MCU_NUM_PERIPH_VECTORS) #include "stm32f4xx.h" #ifdef __cplusplus extern "C" { #endif void NVIC_Relocate(void); void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector); uint32_t NVIC_GetVector(IRQn_Type IRQn); #ifdef __cplusplus } #endif #endif
Fix number of peripheral vectors for stm32f401xE
Fix number of peripheral vectors for stm32f401xE
C
apache-2.0
mlaz/mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/apache-mynewt-core,mlaz/mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,andrzej-kaczmarek/apache-mynewt-core,andrzej-kaczmarek/incubator-mynewt-core,mlaz/mynewt-core
5816b39c53a35978dab03f7c7b30f362e09a9426
src/os/Linux/findself.c
src/os/Linux/findself.c
#define _XOPEN_SOURCE 500 #include "os_common.h" #include <unistd.h> #include <stdlib.h> char *os_find_self(const char *argv0) { (void)argv0; // PATH_MAX (used by readlink(2)) is not necessarily available size_t size = 2048, used = 0; char *path = NULL; do { size *= 2; path = realloc(path, size); used = readlink("/proc/self/exe", path, size); path[used - 1] = '\0'; } while (used >= size); // path has already been dereferencd - can't be NULL return path; }
#define _XOPEN_SOURCE 500 #include "os_common.h" #include <unistd.h> #include <stdlib.h> char *os_find_self(const char *argv0) { (void)argv0; // PATH_MAX (used by readlink(2)) is not necessarily available size_t size = 2048, used = 0; char *path = NULL; do { size *= 2; path = realloc(path, size); used = readlink("/proc/self/exe", path, size); path[used] = '\0'; } while (used >= size); // path has already been dereferencd - can't be NULL return path; }
Correct off-by-one error in os_find_self on Linux
Correct off-by-one error in os_find_self on Linux
C
mit
kulp/tenyr,kulp/tenyr,kulp/tenyr
ac24377fd590cec5723eb588eeb65bd5a47e997c
include/homerun.h
include/homerun.h
// homerun.h // HDHomeRun Wrapper #include <stdint.h> #include "libhdhomerun.h" #ifndef HOMERUN_H #define HOMERUN_H int verifyHomerunTuner(int); struct hdhomerun_discover_device_t getValidDevice(); #endif
// network.h // hdpirun // // HDHomeRun wrapper. Wraps library functionality for use // // Author: Robbie Duncan // Copyright: Copyright (c) 2016 Robbie Duncan // License: See LICENSE // #include <stdint.h> #include "libhdhomerun.h" // #ifndef HOMERUN_H #define HOMERUN_H int verifyHomerunTuner(int); // // Constructs a packet to use to respond to a discovery request. The caller is responsible for destroying the packet struct hdhomerun_pkt_t* getDiscoveryReplyPacket(); struct hdhomerun_discover_device_t getValidDevice(); #endif
Move discovery reply packet construction to the correct file
Move discovery reply packet construction to the correct file
C
mit
robbieduncan/hdpirun,robbieduncan/hdpirun
43a9b8038c5f4a27aa884bcc16b45c473c268bb2
examples/getartist_c.c
examples/getartist_c.c
/* Get artist by id. * * Usage: * getartist 'artist id' * * $Id$ */ #include <stdio.h> #include <musicbrainz3/mb_c.h> int main(int argc, char **argv) { MBQuery query; MBArtist artist; char data[256]; if (argc < 2) { printf("Usage: getartist 'artist id'\n"); return 1; } mb_webservice_init(); query = mb_query_new(NULL, NULL); artist = mb_query_get_artist_by_id(query, argv[1], NULL); if (!artist) { printf("No artist returned.\n"); mb_query_free(query); return 1; } mb_artist_get_id(artist, data, 256); printf("Id : %s\n", data); mb_artist_get_type(artist, data, 256); printf("Type : %s\n", data); mb_artist_get_name(artist, data, 256); printf("Name : %s\n", data); mb_artist_get_sortname(artist, data, 256); printf("SortName: %s\n", data); mb_artist_free(artist); mb_query_free(query); return 0; }
/* Get artist by id. * * Usage: * getartist 'artist id' * * $Id$ */ #include <stdio.h> #include <musicbrainz3/mb_c.h> int main(int argc, char **argv) { MbQuery query; MbArtist artist; char data[256]; if (argc < 2) { printf("Usage: getartist 'artist id'\n"); return 1; } mb_webservice_init(); query = mb_query_new(NULL, NULL); artist = mb_query_get_artist_by_id(query, argv[1], NULL); if (!artist) { printf("No artist returned.\n"); mb_query_free(query); return 1; } mb_artist_get_id(artist, data, 256); printf("Id : %s\n", data); mb_artist_get_type(artist, data, 256); printf("Type : %s\n", data); mb_artist_get_name(artist, data, 256); printf("Name : %s\n", data); mb_artist_get_sortname(artist, data, 256); printf("SortName: %s\n", data); mb_artist_free(artist); mb_query_free(query); return 0; }
Rename MBArtist to MbArtist to make it compile.
Rename MBArtist to MbArtist to make it compile. git-svn-id: 493edb1aabd9361e12d1b994f475f0ee8eea41ad@7847 b0b80210-5d09-0410-99dd-b4bd03f891c0
C
lgpl-2.1
matthewruhland/libmusicbrainz,matthewruhland/libmusicbrainz,sebastinas/libmusicbrainz,metabrainz/libmusicbrainz,sebastinas/libmusicbrainz,matthewruhland/libmusicbrainz,sebastinas/libmusicbrainz,metabrainz/libmusicbrainz,metabrainz/libmusicbrainz
7bb1bf38d038f8bbea217bd6431be6c2749bf8ad
circe-crc32c-sse42-lib/src/main/include/int_types.h
circe-crc32c-sse42-lib/src/main/include/int_types.h
/******************************************************************************* * Copyright 2014 Trevor Robinson * * 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. ******************************************************************************/ #include <stddef.h> // size_t #ifdef _MSC_VER typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; # define SIZE_T_FORMAT "%Iu" #else # include <stdint.h> # define SIZE_T_FORMAT "%zu" #endif
/******************************************************************************* * Copyright 2014 Trevor Robinson * * 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. ******************************************************************************/ #include <stddef.h> // size_t #if defined(_MSC_VER) && _MSC_VER < 1600 // stdint.h added in MSVC 2010 typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; #else # include <stdint.h> #endif #if defined(_MSC_VER) && _MSC_VER < 1900 // MSVC 2015 # define SIZE_T_FORMAT "%Iu" #else # define SIZE_T_FORMAT "%zu" #endif
Use platform stdint.h and standard size_t printf format in newer versions of MSVC
Use platform stdint.h and standard size_t printf format in newer versions of MSVC
C
apache-2.0
trevorr/circe,trevorr/circe,trevorr/circe
06e74f67923c38c03eb38dd819258d4d41040651
src/engine/core/include/halley/core/api/platform_api.h
src/engine/core/include/halley/core/api/platform_api.h
#pragma once namespace Halley { class HTTPResponse { public: virtual ~HTTPResponse() {} virtual int getResponseCode() const = 0; virtual const Bytes& getBody() const = 0; }; class HTTPRequest { public: virtual ~HTTPRequest() {} virtual void setPostData(const String& contentType, const Bytes& data) = 0; virtual Future<std::unique_ptr<HTTPResponse>> send() = 0; }; class AuthorisationToken { public: virtual ~AuthorisationToken() {} virtual String getType() const = 0; virtual bool isSingleUse() const = 0; virtual bool isCancellable() const = 0; virtual void cancel() = 0; virtual const Bytes& getData() const = 0; }; class PlatformAPI { public: virtual ~PlatformAPI() {} virtual void update() = 0; virtual std::unique_ptr<HTTPRequest> makeHTTPRequest(const String& method, const String& url) = 0; virtual bool canProvideAuthToken() const = 0; virtual Future<std::unique_ptr<AuthorisationToken>> getAuthToken() = 0; }; }
#pragma once namespace Halley { class HTTPResponse { public: virtual ~HTTPResponse() {} virtual int getResponseCode() const = 0; virtual const Bytes& getBody() const = 0; }; class HTTPRequest { public: virtual ~HTTPRequest() {} virtual void setPostData(const String& contentType, const Bytes& data) = 0; virtual void setHeader(const String& headerName, const String& headerValue) = 0; virtual Future<std::unique_ptr<HTTPResponse>> send() = 0; }; class AuthorisationToken { public: virtual ~AuthorisationToken() {} virtual String getType() const = 0; virtual bool isSingleUse() const = 0; virtual bool isCancellable() const = 0; virtual void cancel() = 0; virtual const Bytes& getData() const = 0; }; class PlatformAPI { public: virtual ~PlatformAPI() {} virtual void update() = 0; virtual std::unique_ptr<HTTPRequest> makeHTTPRequest(const String& method, const String& url) = 0; virtual bool canProvideAuthToken() const = 0; virtual Future<std::unique_ptr<AuthorisationToken>> getAuthToken() = 0; }; }
Add setHeader to HTTPRequest API
Add setHeader to HTTPRequest API
C
apache-2.0
amzeratul/halley,amzeratul/halley,amzeratul/halley
e4ad8ed638d3147d95d41940a50d59f82597a18f
Python/getcopyright.c
Python/getcopyright.c
/* Return the copyright string. This is updated manually. */ #include "Python.h" static char cprt[] = "Copyright (c) 2000 BeOpen.com; All Rights Reserved.\n\ Copyright (c) 1995-2000 Corporation for National Research Initiatives;\n\ All Rights Reserved.\n\ Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam;\n\ All Rights Reserved."; const char * Py_GetCopyright(void) { return cprt; }
/* Return the copyright string. This is updated manually. */ #include "Python.h" static char cprt[] = "Copyright (c) 2000 BeOpen.com. All Rights Reserved.\n\ Copyright (c) 1995-2000 Corporation for National Research Initiatives.\n\ All Rights Reserved.\n\ Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\n\ All Rights Reserved."; const char * Py_GetCopyright(void) { return cprt; }
Use periods, not semicolons between Copyright and All Rights Reserved.
Use periods, not semicolons between Copyright and All Rights Reserved.
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
51b49a872a45e9e14cedc823b0486a424f23d6eb
src/event.h
src/event.h
#ifndef _EVENT_H_ #define _EVENT_H_ #include "dataStackEntry.h" typedef struct event Event; Event *ev_create(char *name, char *eventData, unsigned long nAUs); Event *ev_reference(Event *event); void ev_release(Event *event); char *ev_data(Event *event); char *ev_topic(Event *event); int ev_theData(Event *event, DataStackEntry **dse); void ev_dump(Event *event); #endif /* _EVENT_H_ */
#ifndef _EVENT_H_ #define _EVENT_H_ /* * Copyright (c) 2013, Court of the University of Glasgow * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of the University of Glasgow nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include "dataStackEntry.h" typedef struct event Event; Event *ev_create(char *name, char *eventData, unsigned long nAUs); Event *ev_reference(Event *event); void ev_release(Event *event); char *ev_data(Event *event); char *ev_topic(Event *event); int ev_theData(Event *event, DataStackEntry **dse); void ev_dump(Event *event); #endif /* _EVENT_H_ */
Add BSD 3-clause open source header
Add BSD 3-clause open source header
C
bsd-3-clause
jsventek/Cache,fergul/Cache,fergul/Cache,fergul/Cache,jsventek/Cache,jsventek/Cache
52f4cfe22d70c06394d12f9b7fd45f753370cd56
os/win/color_space.h
os/win/color_space.h
// LAF OS Library // Copyright (C) 2018-2020 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef OS_WIN_COLOR_SPACE_H_INCLUDED #define OS_WIN_COLOR_SPACE_H_INCLUDED #pragma once #include "os/color_space.h" #ifdef __OBJC__ #include <Cocoa/Cocoa.h> #endif #include <vector> namespace os { std::string get_hmonitor_icc_filename(HMONITOR monitor); os::ColorSpaceRef get_colorspace_from_icc_file(const std::string& iccFilename); os::ColorSpaceRef get_hmonitor_colorspace(HMONITOR monitor); void list_display_colorspaces(std::vector<os::ColorSpaceRef>& list); } // namespace os #endif
// LAF OS Library // Copyright (C) 2018-2021 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef OS_WIN_COLOR_SPACE_H_INCLUDED #define OS_WIN_COLOR_SPACE_H_INCLUDED #pragma once #include "os/color_space.h" #include <vector> namespace os { std::string get_hmonitor_icc_filename(HMONITOR monitor); os::ColorSpaceRef get_colorspace_from_icc_file(const std::string& iccFilename); os::ColorSpaceRef get_hmonitor_colorspace(HMONITOR monitor); void list_display_colorspaces(std::vector<os::ColorSpaceRef>& list); } // namespace os #endif
Remove macOS header from Win32 impl
Remove macOS header from Win32 impl
C
mit
aseprite/laf,aseprite/laf
4ee60d1890ae12729a9afda7e64dd2c12d48776a
src/shims.c
src/shims.c
/* * Copyright (c) 2013-2016 Apple Inc. All rights reserved. * * @APPLE_APACHE_LICENSE_HEADER_START@ * * 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. * * @APPLE_APACHE_LICENSE_HEADER_END@ */ #include "internal.h" #include "shims.h" #if !HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t size) { size_t res = strlen(dst) + strlen(src) + 1; if (size > 0) { size_t n = size - 1; strncpy(dst, src, n); dst[n] = 0; } return res; } #endif
/* * Copyright (c) 2013-2016 Apple Inc. All rights reserved. * * @APPLE_APACHE_LICENSE_HEADER_START@ * * 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. * * @APPLE_APACHE_LICENSE_HEADER_END@ */ #include "internal.h" #include "shims.h" #if !HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t size) { size_t res = strlen(dst) + strlen(src) + 1; if (size > 0) { size_t n = size - 1; strncpy(dst, src, n); dst[n] = 0; } return res; } #endif
Fix formatting to match libdispatch coding style.
Fix formatting to match libdispatch coding style.
C
apache-2.0
apple/swift-corelibs-libdispatch,apple/swift-corelibs-libdispatch,apple/swift-corelibs-libdispatch,apple/swift-corelibs-libdispatch
690964cb69d6675f59b1362d47e5dbaec75a4eb0
rxe.h
rxe.h
#ifndef __RXE_H #define __RXE_H #define MAXBYTES 8 #define MAXBITS 64 void encrypt(char*, char *, char *); void decrypt(char*, char *, char *); #endif /* !__RXE_H */
#ifndef __RXE_H #define __RXE_H #define MAXBYTES 8 #define MAXBITS MAXBYTES*8 void encrypt(char* in, char *out, char *key); void decrypt(char* in, char *out, char *key); #endif /* !__RXE_H */
Make the header more descriptive
Make the header more descriptive
C
mit
SaidinWoT/rx
cf3b23699094494aff3e7adc5e1542e0db87e548
board/lazor/hibernate.c
board/lazor/hibernate.c
/* Copyright 2021 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "common.h" #include "sku.h" #include "system.h" #include "usbc_ppc.h" void board_hibernate(void) { int i; if (!board_is_clamshell()) { /* * Sensors are unpowered in hibernate. Apply PD to the * interrupt lines such that they don't float. */ gpio_set_flags(GPIO_ACCEL_GYRO_INT_L, GPIO_INPUT | GPIO_PULL_DOWN); gpio_set_flags(GPIO_LID_ACCEL_INT_L, GPIO_INPUT | GPIO_PULL_DOWN); } /* * Board rev 5+ has the hardware fix. Don't need the following * workaround. Limozeen's BRD_ID is not monotonically increasing. * 4 is the earliest revision. */ if ((system_get_board_version() >= 5) || (board_is_clamshell() && ((system_get_board_version() != 4)))) return; /* * Enable the PPC power sink path before EC enters hibernate; * otherwise, ACOK won't go High and can't wake EC up. Check the * bug b/170324206 for details. */ for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) ppc_vbus_sink_enable(i, 1); }
/* Copyright 2021 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "common.h" #include "sku.h" #include "system.h" #include "usbc_ppc.h" void board_hibernate(void) { int i; if (!board_is_clamshell()) { /* * Sensors are unpowered in hibernate. Apply PD to the * interrupt lines such that they don't float. */ gpio_set_flags(GPIO_ACCEL_GYRO_INT_L, GPIO_INPUT | GPIO_PULL_DOWN); gpio_set_flags(GPIO_LID_ACCEL_INT_L, GPIO_INPUT | GPIO_PULL_DOWN); } /* * Board rev 5+ has the hardware fix. Don't need the following * workaround. */ if (system_get_board_version() >= 5) return; /* * Enable the PPC power sink path before EC enters hibernate; * otherwise, ACOK won't go High and can't wake EC up. Check the * bug b/170324206 for details. */ for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) ppc_vbus_sink_enable(i, 1); }
Revert "limozeen: Refine the BRD_ID check"
Revert "limozeen: Refine the BRD_ID check" This reverts commit 4860dccf9a0ea7c5ecba92d984491bd7151a31f0. Reason for revert: lomozeen pvt buck ic board version change to 8. Original change's description: > limozeen: Refine the BRD_ID check > > Limozeen's BRD_ID is not monotonically increasing. > The earliest revision is 4. The next BRD_ID after 7 is 0. > Not support PPC workaround when BRD_ID 0 on limozeen. > > BUG=b:190250108 > BRANCH=trogdor > TEST=make buildall success. > > Signed-off-by: David Huang <0bee89a4ff99f17b7e64fbf6530169dc03ff1a24@quanta.corp-partner.google.com> > Change-Id: I16d7ff081306812c14aa31ce2b19af8e2d50ff76 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2952802 > Reviewed-by: Wai-Hong Tam <04b587fdf5845741a0c5a8b9cd59ca72d73ef8fc@google.com> > Commit-Queue: Wai-Hong Tam <04b587fdf5845741a0c5a8b9cd59ca72d73ef8fc@google.com> Bug: b:190250108 Change-Id: Ib15e4d0b7b783c86541775955d5b74c51f2bbce2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2965811 Bot-Commit: Rubber Stamper <d516c4cc2192058ab8dae3d306acbdaf2ce6574f@appspot.gserviceaccount.com> Auto-Submit: David Huang <0bee89a4ff99f17b7e64fbf6530169dc03ff1a24@quanta.corp-partner.google.com> Commit-Queue: Wai-Hong Tam <04b587fdf5845741a0c5a8b9cd59ca72d73ef8fc@google.com>
C
bsd-3-clause
coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec
e89291fb0f04e1585014b5f60446ddc49e4c3ec7
src/api/yawot/version.h
src/api/yawot/version.h
namespace yawot { /** * Return the version of the *library* as an * unsigned integer. The format is XXYYZZ * XX - major version * YY - minor version * ZZ - patch version */ unsigned int version(); }
#ifndef YAWOT_VERSION_H #define YAWOT_VERSION_H namespace yawot { /** * Return the version of the *library* as an * unsigned integer. The format is XXYYZZ * XX - major version * YY - minor version * ZZ - patch version */ unsigned int version(); } #endif /* YAWOT_VERSION_H */
Add header define block to stop multiple header file inclusion.
Add header define block to stop multiple header file inclusion.
C
apache-2.0
hsorby/original-yawot,hsorby/original-yawot,hsorby/original-yawot,hsorby/original-yawot
8c5570bf08f50b76da1038c29ddaab4c0b772997
src/streamindexer/analyzerplugin.h
src/streamindexer/analyzerplugin.h
#include "analyzerfactoryfactory.h" #ifdef STRIGI_IMPORT_API #ifdef WIN32 #define STRIGI_PLUGIN_API __declspec(dllexport) #else #define STRIGI_PLUGIN_API #endif #else #error "You should add STRIGI_IMPORT_API to the top of you plugin, you should not include this header if your code is not a plugin" #endif #define STRIGI_ANALYZER_FACTORY(CLASS) extern "C" { \ const AnalyzerFactoryFactory* getStrigiAnalyzerFactory() { \ return new CLASS(); \ } \ void deleteStrigiAnalyzerFactory(const AnalyzerFactoryFactory* f) { \ delete f; \ } \ }
#include "analyzerfactoryfactory.h" #ifdef STRIGI_IMPORT_API #ifdef WIN32 #define STRIGI_PLUGIN_API __declspec(dllexport) #else #define STRIGI_PLUGIN_API #endif #else #error "You should add STRIGI_IMPORT_API to the top of you plugin, you should not include this header if your code is not a plugin" #endif #define STRIGI_ANALYZER_FACTORY(CLASS) extern "C" { \ const jstreams::AnalyzerFactoryFactory* getStrigiAnalyzerFactory() { \ return new CLASS(); \ } \ void deleteStrigiAnalyzerFactory(const jstreams::AnalyzerFactoryFactory* f) { \ delete f; \ } \ }
Use jstreams namespace in macro definition (not everybody uses the "using" keyword.
Use jstreams namespace in macro definition (not everybody uses the "using" keyword. svn path=/trunk/playground/base/strigi/; revision=611538
C
lgpl-2.1
KDE/strigi
90b8b9aea290c07590dc662542c49dfff76dfb47
BPFoundationExtensions.h
BPFoundationExtensions.h
/* * BPFoundationExtensions.h * BPFoundation * * Created by Jon Olson on 7/9/09. * Copyright 2009 Ballistic Pigeon, LLC. All rights reserved. * */ #ifndef _BPFOUNDATION_EXTENSIONS_H_ #define _BPFOUNDATION_EXTENSIONS_H_ #import "NSArray+BPFoundationExtensions.h" #import "NSMutableArray+BPFoundationExtensions.h" #import "NSSet+BPFoundationExtensions.h" #import "NSDictionary+BPFoundationExtensions.h" #import "NSThread+BPFoundationExtensions.h" #endif
/* * BPFoundationExtensions.h * BPFoundation * * Created by Jon Olson on 7/9/09. * Copyright 2009 Ballistic Pigeon, LLC. All rights reserved. * */ #ifndef _BPFOUNDATION_EXTENSIONS_H_ #define _BPFOUNDATION_EXTENSIONS_H_ #import "NSArray+BPFoundationExtensions.h" #import "NSMutableArray+BPFoundationExtensions.h" #import "NSSet+BPFoundationExtensions.h" #import "NSDictionary+BPFoundationExtensions.h" #import "NSThread+BPFoundationExtensions.h" #import "BPPrimitiveArray.h" #endif
Add primitive array to library header.
Add primitive array to library header.
C
bsd-3-clause
jon/bpfoundationextensions
b597acc2dd049fd051bec2ba5217d2026b01b83c
src/math/p_invsqrt.c
src/math/p_invsqrt.c
#include <pal.h> /** * * Calculates the inverse square root of the input vector 'a'. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @param p Number of processor to use (task parallelism) * * @param team Team to work with ** * @return None * */ #include <math.h> void p_invsqrt_f32(const float *a, float *c, int n, int p, p_team_t team) { int i; for (i = 0; i < n; i++) { *(c + i) = 1.0f / sqrtf(*(a + i)); } }
#include <pal.h> /** * * Calculates the inverse square root of the input vector 'a'. * * This function uses a method of computing the inverse square root * made popular by the Quake 3 source code release. Chris Lomont has * provided an exhaustive analysis here: * http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @param p Number of processor to use (task parallelism) * * @param team Team to work with ** * @return None * */ #include <math.h> void p_invsqrt_f32(const float *a, float *c, int n, int p, p_team_t team) { // This union allows us to type-pun between integers and floats // with fewer strict aliasing concerns than the pointer casts // used in the original source. union { int32_t i; float f; } u; int i; for (i = 0; i < n; i++) { float x = *(a + i); float x2 = x * 0.5f; // Use some bit hacks to get a decent first approximation u.f = x; u.i = 0x5f375a86 - (u.i >> 1); x = u.f; // Perform a couple steps of Newton's method to refine our guess x = x * (1.5f - (x2 * x * x)); x = x * (1.5f - (x2 * x * x)); *(c + i) = x; } }
Implement faster inverse square root function
Implement faster inverse square root function Signed-off-by: Warren Moore <4fdbf0932cf8fc9903ee31afa97cf723d35eb3f3@warrenmoore.net>
C
apache-2.0
debug-de-su-ka/pal,eliteraspberries/pal,debug-de-su-ka/pal,Adamszk/pal3,eliteraspberries/pal,RafaelRMA/pal,RafaelRMA/pal,parallella/pal,debug-de-su-ka/pal,parallella/pal,aolofsson/pal,aolofsson/pal,olajep/pal,8l/pal,RafaelRMA/pal,mateunho/pal,parallella/pal,debug-de-su-ka/pal,mateunho/pal,mateunho/pal,mateunho/pal,parallella/pal,8l/pal,Adamszk/pal3,olajep/pal,olajep/pal,8l/pal,Adamszk/pal3,RafaelRMA/pal,eliteraspberries/pal,Adamszk/pal3,parallella/pal,aolofsson/pal,debug-de-su-ka/pal,mateunho/pal,eliteraspberries/pal,aolofsson/pal,olajep/pal,8l/pal,eliteraspberries/pal
80c88c62ea05233e2f613542b8ce476328422364
libevmjit/CompilerHelper.h
libevmjit/CompilerHelper.h
#pragma once #include "preprocessor/llvm_includes_start.h" #include <llvm/IR/IRBuilder.h> #include "preprocessor/llvm_includes_end.h" namespace dev { namespace eth { namespace jit { class RuntimeManager; /// Base class for compiler helpers like Memory, GasMeter, etc. class CompilerHelper { protected: CompilerHelper(llvm::IRBuilder<>& _builder); CompilerHelper(const CompilerHelper&) = delete; CompilerHelper& operator=(CompilerHelper) = delete; /// Reference to the IR module being compiled llvm::Module* getModule(); /// Reference to the main module function llvm::Function* getMainFunction(); /// Reference to parent compiler IR builder llvm::IRBuilder<>& m_builder; llvm::IRBuilder<>& getBuilder() { return m_builder; } llvm::CallInst* createCall(llvm::Function* _func, std::initializer_list<llvm::Value*> const& _args); friend class RuntimeHelper; }; /// Compiler helper that depends on runtime data class RuntimeHelper : public CompilerHelper { protected: RuntimeHelper(RuntimeManager& _runtimeManager); RuntimeManager& getRuntimeManager() { return m_runtimeManager; } private: RuntimeManager& m_runtimeManager; }; using InsertPointGuard = llvm::IRBuilderBase::InsertPointGuard; } } }
#pragma once #include "preprocessor/llvm_includes_start.h" #include <llvm/IR/IRBuilder.h> #include "preprocessor/llvm_includes_end.h" namespace dev { namespace eth { namespace jit { class RuntimeManager; /// Base class for compiler helpers like Memory, GasMeter, etc. class CompilerHelper { protected: CompilerHelper(llvm::IRBuilder<>& _builder); CompilerHelper(const CompilerHelper&) = delete; CompilerHelper& operator=(CompilerHelper) = delete; /// Reference to the IR module being compiled llvm::Module* getModule(); /// Reference to the main module function llvm::Function* getMainFunction(); /// Reference to parent compiler IR builder llvm::IRBuilder<>& m_builder; llvm::IRBuilder<>& getBuilder() { return m_builder; } llvm::CallInst* createCall(llvm::Function* _func, std::initializer_list<llvm::Value*> const& _args); friend class RuntimeHelper; }; /// Compiler helper that depends on runtime data class RuntimeHelper : public CompilerHelper { protected: RuntimeHelper(RuntimeManager& _runtimeManager); RuntimeManager& getRuntimeManager() { return m_runtimeManager; } private: RuntimeManager& m_runtimeManager; }; struct InsertPointGuard { explicit InsertPointGuard(llvm::IRBuilderBase& _builder): m_builder(_builder), m_insertPoint(_builder.saveIP()) {} ~InsertPointGuard() { m_builder.restoreIP(m_insertPoint); } private: llvm::IRBuilderBase& m_builder; decltype(m_builder.saveIP()) m_insertPoint; }; } } }
Reimplement InsertPointGuard to avoid LLVM ABI incompatibility.
Reimplement InsertPointGuard to avoid LLVM ABI incompatibility. In general, the NDEBUG flag should match cpp-ethereum and LLVM builds. But this is hard to satisfy as we usually have one system-wide build of LLVM and different builds of cpp-ethereum. This ABI incompatibility hit OSX only in release builds as LLVM is built by homebrew with assertions by default.
C
mit
debris/evmjit,ethcore/evmjit,debris/evmjit,ethcore/evmjit
9e8f0fbbc0448faff7072b7f8fd66b031f9abc80
src/entry.h
src/entry.h
#ifndef ENTRY_H #define ENTRY_H #include <string> #include <memory> namespace diaryengine { class Entry { public: Entry(); ~Entry(); void setTitle(std::string title); std::string title(); private: struct Implementation; std::unique_ptr<Implementation> inside_; }; } #endif // ENTRY_H
#ifndef ENTRY_H #define ENTRY_H #include <string> #include <memory> namespace diaryengine { class Entry { public: Entry(); ~Entry(); void setTitle(std::string title); std::string title(); private: struct Implementation; std::unique_ptr<Implementation> _inside; }; } #endif // ENTRY_H
Rename the implementation pointer to respect naming convention
Rename the implementation pointer to respect naming convention
C
bsd-3-clause
Acce0ss/diary-engine
1ee6c2c3fea091cf61d21e190dcf195b2149bc01
src/main.c
src/main.c
/*! @file main.c @brief A simple test program for the C library code. */ #include "stdio.h" #include "verilog_parser.h" int main(int argc, char ** argv) { if(argc < 2) { printf("ERROR. Please supply at least one file path argument.\n"); return 1; } else { int F = 0; for(F = 1; F < argc; F++) { printf("%s", argv[F]);fflush(stdout); // Load the file. FILE * fh = fopen(argv[F], "r"); // Instance the parser. verilog_parser parser = verilog_file_parse(fh); printf(" parser built ");fflush(stdout); // Parse the file and store the result. int result = verilog_parse_buffer(parser); printf(" parser finished");fflush(stdout); verilog_free_parser(parser); printf(" parser freed");fflush(stdout); fclose(fh); if(result == 0) { printf(" - Parse successful\n"); } else { printf(" - Parse failed for\n"); } } } return 0; }
/*! @file main.c @brief A simple test program for the C library code. */ #include "stdio.h" #include "verilog_parser.h" int main(int argc, char ** argv) { if(argc < 2) { printf("ERROR. Please supply at least one file path argument.\n"); return 1; } else { int F = 0; for(F = 1; F < argc; F++) { printf("%s", argv[F]);fflush(stdout); // Load the file. FILE * fh = fopen(argv[F], "r"); // Instance the parser. verilog_parser parser = verilog_file_parse(fh); printf(" parser built ");fflush(stdout); // Parse the file and store the result. int result = verilog_parse_buffer(parser); printf(" parser finished");fflush(stdout); verilog_free_parser(parser); printf(" parser freed");fflush(stdout); fclose(fh); if(result == 0) { printf(" - Parse successful\n"); } else { printf(" - Parse failed for\n"); if(argc<=2) return 1; } } } return 0; }
Fix incorrect reporting of successful parsing. On branch master Your branch is ahead of 'github/master' by 3 commits. (use "git push" to publish your local commits)
Fix incorrect reporting of successful parsing. On branch master Your branch is ahead of 'github/master' by 3 commits. (use "git push" to publish your local commits) Changes to be committed: modified: src/main.c
C
mit
ben-marshall/verilog-parser,ben-marshall/verilog-parser,ben-marshall/verilog-parser
1a9fd1ee0be588aa465a2bc405a86bb4669e3288
src/whitgl/logging.c
src/whitgl/logging.c
#include <stdarg.h> #include <stdio.h> #include <whitgl/logging.h> #define LOG_BUFFER_MAX (256) char _buffer[LOG_BUFFER_MAX]; void whitgl_logit(const char *file, const int line, const char *str, ...) { va_list args; va_start(args, str); vsnprintf(_buffer, LOG_BUFFER_MAX, str, args); printf("%24s:%03d %s\n", file, line, _buffer); } void whitgl_panic(const char *file, const int line, const char *str, ...) { va_list args; va_start(args, str); vsnprintf(_buffer, LOG_BUFFER_MAX, str, args); printf("PANIC %24s:%03d %s\n", file, line, _buffer); __builtin_trap(); }
#include <stdarg.h> #include <stdio.h> #include <whitgl/logging.h> #define LOG_BUFFER_MAX (256) char _buffer[LOG_BUFFER_MAX]; void whitgl_logit(const char *file, const int line, const char *str, ...) { va_list args; va_start(args, str); vsnprintf(_buffer, LOG_BUFFER_MAX, str, args); printf("%24s:%03d %s\n", file, line, _buffer); } void whitgl_panic(const char *file, const int line, const char *str, ...) { va_list args; va_start(args, str); vsnprintf(_buffer, LOG_BUFFER_MAX, str, args); printf("PANIC %24s:%03d %s\n", file, line, _buffer); fflush(stdout); __builtin_trap(); }
Make sure stdout is flushed before trapping in panic
Make sure stdout is flushed before trapping in panic
C
mit
whitingjp/whitgl,whitingjp/whitgl,whitingjp/whitgl,whitingjp/whitgl
082299ce611b1e2878001e0daa2b67dcc01a4a77
MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h
MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h
// // NSManagedObject+JSONHelpers.h // // Created by Saul Mora on 6/28/11. // Copyright 2011 Magical Panda Software LLC. All rights reserved. // #import <CoreData/CoreData.h> extern NSString * const kMagicalRecordImportCustomDateFormatKey; extern NSString * const kMagicalRecordImportDefaultDateFormatString; extern NSString * const kMagicalRecordImportUnixTimeString; extern NSString * const kMagicalRecordImportAttributeKeyMapKey; extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; extern NSString * const kMagicalRecordImportRelationshipMapKey; extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; extern NSString * const kMagicalRecordImportRelationshipTypeKey; @interface NSManagedObject (MagicalRecord_DataImport) - (BOOL) MR_importValuesForKeysWithObject:(id)objectData; + (instancetype) MR_importFromObject:(id)data; + (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; @end @interface NSManagedObject (MagicalRecord_DataImportControls) - (BOOL) shouldImport:(id)data; - (void) willImport:(id)data; - (void) didImport:(id)data; @end
// // NSManagedObject+JSONHelpers.h // // Created by Saul Mora on 6/28/11. // Copyright 2011 Magical Panda Software LLC. All rights reserved. // #import <CoreData/CoreData.h> extern NSString * const kMagicalRecordImportCustomDateFormatKey; extern NSString * const kMagicalRecordImportDefaultDateFormatString; extern NSString * const kMagicalRecordImportUnixTimeString; extern NSString * const kMagicalRecordImportAttributeKeyMapKey; extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; extern NSString * const kMagicalRecordImportRelationshipMapKey; extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; extern NSString * const kMagicalRecordImportRelationshipTypeKey; @interface NSManagedObject (MagicalRecord_DataImport) + (instancetype) MR_importFromObject:(id)data; + (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; @end @interface NSManagedObject (MagicalRecord_DataImportControls) - (BOOL) shouldImport:(id)data; - (void) willImport:(id)data; - (void) didImport:(id)data; @end
Remove unnecessarily public method from interface
Remove unnecessarily public method from interface
C
mit
naqi/MagicalRecord,naqi/MagicalRecord
2cb62ce24b2e2ddb3bc0ddcee36eb377c1c4b083
TLLayoutTransitioning/TLLayoutTransitioning.h
TLLayoutTransitioning/TLLayoutTransitioning.h
// // TLLayoutTransitioning.h // TLLayoutTransitioning // // Created by Tim Moose on 6/29/15. // Copyright (c) 2015 Tractable Labs. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for TLLayoutTransitioning. FOUNDATION_EXPORT double TLLayoutTransitioningVersionNumber; //! Project version string for TLLayoutTransitioning. FOUNDATION_EXPORT const unsigned char TLLayoutTransitioningVersionString[]; <TLLayoutTransitioning/TLTransitionLayout.h> <TLLayoutTransitioning/UICollectionView+TLTransitioning.h>
// // TLLayoutTransitioning.h // TLLayoutTransitioning // // Created by Tim Moose on 6/29/15. // Copyright (c) 2015 Tractable Labs. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for TLLayoutTransitioning. FOUNDATION_EXPORT double TLLayoutTransitioningVersionNumber; //! Project version string for TLLayoutTransitioning. FOUNDATION_EXPORT const unsigned char TLLayoutTransitioningVersionString[]; #import <TLLayoutTransitioning/TLTransitionLayout.h> #import <TLLayoutTransitioning/UICollectionView+TLTransitioning.h>
Fix typo in umbrella header
Fix typo in umbrella header
C
mit
wtmoose/TLLayoutTransitioning
a44f98e67ef60d340e76d19e4c5a94ffb2279b0c
src/os/Linux/findself.c
src/os/Linux/findself.c
#include <unistd.h> #include <limits.h> char *os_find_self(void) { // Using PATH_MAX is generally bad, but that's what readlink() says it uses. size_t size = PATH_MAX; char *path = malloc(size); if (readlink("/proc/self/exe", path, size) == 0) { return path; } else { free(path); return NULL; } }
#include <unistd.h> #include <stdlib.h> char *os_find_self(void) { // PATH_MAX (used by readlink(2)) is not necessarily available size_t size = 4096; char *path = malloc(size); size_t used = readlink("/proc/self/exe", path, size); // need strictly less than size, or else we probably truncated if (used < size) { return path; } else { free(path); return NULL; } }
Mend improper use of readlink(2)
Mend improper use of readlink(2) The return-code checking for readlink(2) would never succeed before this change. Also avoid referencing a PATH_MAX that may be missing.
C
mit
kulp/tenyr,kulp/tenyr,kulp/tenyr
c0bde2429f69dd551c5c5d78b43e958b4b9370c9
MGSFragariaTextViewDelegate.h
MGSFragariaTextViewDelegate.h
// // MGSFragariaTextViewDelegate.h // Fragaria // // Created by Jim Derry on 2/22/15. // // /** * This protocol defines an interface for delegates that wish * to receive notifications from Fragaria's text view. **/ #pragma mark - MGSFragariaTextViewDelegate Protocol @protocol MGSFragariaTextViewDelegate <NSObject> @optional /** * This notification is send when the paste has been accepted. You can use * this delegate method to query the pasteboard for additional pasteboard content * that may be relevant to the application: eg: a plist that may contain custom data. * @param note is an NSNotification instance. **/ - (void)mgsTextDidPaste:(NSNotification *)note; @end
// // MGSFragariaTextViewDelegate.h // Fragaria // // Created by Jim Derry on 2/22/15. // // /** * This protocol defines an interface for delegates that wish * to receive notifications from Fragaria's text view. **/ #pragma mark - MGSFragariaTextViewDelegate Protocol @protocol MGSFragariaTextViewDelegate <NSTextViewDelegate> @optional /** * This notification is send when the paste has been accepted. You can use * this delegate method to query the pasteboard for additional pasteboard content * that may be relevant to the application: eg: a plist that may contain custom data. * @param note is an NSNotification instance. **/ - (void)mgsTextDidPaste:(NSNotification *)note; @end
Make Fragaria's text view delegate protocol compatible with NSTextViewDelegate.
Make Fragaria's text view delegate protocol compatible with NSTextViewDelegate.
C
apache-2.0
shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,vakoc/Fragaria,bitstadium/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,vakoc/Fragaria,shysaur/Fragaria,shysaur/Fragaria,bitstadium/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria
10482dab9d045436ff3b0a97d92cc60aa80386ab
factorial.c
factorial.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "weecrypt.h" void print_factorial(unsigned n); int main(void) { char buf[512]; mpi_t fib; mpi_init(fib); while (printf("Enter N: ") && fgets(buf, sizeof(buf), stdin)) { unsigned n = (unsigned)strtoul(buf, NULL, 10); if (!n) break; print_factorial(n); } return 0; } void print_factorial(unsigned n) { mpi_t f; mpi_init_u32(f, n); for (unsigned m = 2; m < n; ++m) { mpi_mul_u32(f, m, f); } printf("%u! = ", n), mpi_print_dec(f), printf("\n"); printf("As double: %g\n", mpi_get_d(f)); mpi_free(f); }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "weecrypt.h" void print_factorial(unsigned n); int main(void) { char buf[512]; mpi_t fib; mpi_init(fib); while (printf("Enter N: ") && fgets(buf, sizeof(buf), stdin)) { unsigned n = (unsigned)strtoul(buf, NULL, 10); if (!n) break; print_factorial(n); } return 0; } void print_factorial(unsigned n) { mpi_t f; mpi_init_u32(f, n); printf("%u! = ", n); fflush(stdout); for (unsigned m = 2; m < n; ++m) { mpi_mul_u32(f, m, f); } mpi_print_dec(f), printf("\n"); printf("As double: %g\n", mpi_get_d(f)); mpi_free(f); }
Print N before computing F(N)
Print N before computing F(N)
C
bsd-2-clause
fmela/weecrypt,fmela/weecrypt
43a0a428cd1d3a14cb110149c1e7207cd3362c7c
DocFormats/DFTypes.h
DocFormats/DFTypes.h
// Copyright 2012-2014 UX Productivity Pty 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 DocFormats_DFTypes_h #define DocFormats_DFTypes_h #ifdef _MSC_VER #define ATTRIBUTE_ALIGNED(n) #define ATTRIBUTE_FORMAT(archetype,index,first) #else #define ATTRIBUTE_ALIGNED(n) __attribute__ ((aligned (n))) #define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first))) #endif #ifdef WIN32 #define _CRT_SECURE_NO_WARNINGS #endif #include <sys/types.h> #include <stdint.h> #include <stdarg.h> #endif
// Copyright 2012-2014 UX Productivity Pty 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 DocFormats_DFTypes_h #define DocFormats_DFTypes_h #ifdef _MSC_VER #define ATTRIBUTE_ALIGNED(n) #define ATTRIBUTE_FORMAT(archetype,index,first) #else #define ATTRIBUTE_ALIGNED(n) __attribute__ ((aligned (n))) #define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first))) #endif #ifdef WIN32 #define _CRT_SECURE_NO_WARNINGS #include <windows.h> #endif #include <sys/types.h> #include <stdint.h> #include <stdarg.h> #endif
Include windows.h (indirectly) in all files
Win32: Include windows.h (indirectly) in all files
C
apache-2.0
corinthia/corinthia-docformats,apache/incubator-corinthia,apache/incubator-corinthia,apache/incubator-corinthia,corinthia/corinthia-docformats,corinthia/corinthia-docformats,apache/incubator-corinthia,corinthia/corinthia-docformats,apache/incubator-corinthia,corinthia/corinthia-docformats,apache/incubator-corinthia,apache/incubator-corinthia
45211b0254ead7397297746a80c5ec93c8c88f6d
otherlibs/unix/setsid.c
otherlibs/unix/setsid.c
/**************************************************************************/ /* */ /* OCaml */ /* */ /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ /* */ /* Copyright 1997 Institut National de Recherche en Informatique et */ /* en Automatique. */ /* */ /* All rights reserved. This file is distributed under the terms of */ /* the GNU Lesser General Public License version 2.1, with the */ /* special exception on linking described in the file LICENSE. */ /* */ /**************************************************************************/ #include <caml/fail.h> #include <caml/mlvalues.h> #include "unixsupport.h" #ifdef HAS_UNISTD #include <unistd.h> #endif CAMLprim value unix_setsid(value unit) { #ifdef HAS_SETSID return Val_int(setsid()); #else invalid_argument("setsid not implemented"); return Val_unit; #endif }
/**************************************************************************/ /* */ /* OCaml */ /* */ /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ /* */ /* Copyright 1997 Institut National de Recherche en Informatique et */ /* en Automatique. */ /* */ /* All rights reserved. This file is distributed under the terms of */ /* the GNU Lesser General Public License version 2.1, with the */ /* special exception on linking described in the file LICENSE. */ /* */ /**************************************************************************/ #include <caml/fail.h> #include <caml/mlvalues.h> #include "unixsupport.h" #ifdef HAS_UNISTD #include <unistd.h> #endif CAMLprim value unix_setsid(value unit) { #ifdef HAS_SETSID return Val_int(setsid()); #else caml_invalid_argument("setsid not implemented"); return Val_unit; #endif }
Remove use of compatibility macros in Cygwin-specific code.
Remove use of compatibility macros in Cygwin-specific code. This fixes PR #892 (commit 13945a71ed2616df9a4672cfc83f8f450ec437a8): there was one compatibility macro remaining in Cygwin-specific code.
C
lgpl-2.1
gerdstolpmann/ocaml,msprotz/ocaml,yunxing/ocaml,yunxing/ocaml,gerdstolpmann/ocaml,msprotz/ocaml,yunxing/ocaml,gerdstolpmann/ocaml,yunxing/ocaml,gerdstolpmann/ocaml,msprotz/ocaml,yunxing/ocaml,msprotz/ocaml,gerdstolpmann/ocaml,msprotz/ocaml
3ff331a9af67827d17aea5cf75e2f49ee4cb36b9
examples/test/testcases-v1/test-control-in-out.c
examples/test/testcases-v1/test-control-in-out.c
// SPDX-License-Identifier: Apache-2.0 // Copyright 2018 Eotvos Lorand University, Budapest, Hungary #include "test.h" fake_cmd_t t4p4s_testcase_test[][RTE_MAX_LCORE] = { { // table lookup hits {FAKE_PKT, 0, 1, FDATA("AA00"), 200, 123, FDATA("AA22")}, // table lookup misses {FAKE_PKT, 0, 1, FDATA("BB00"), 200, 123, FDATA("BB44")}, FEND, }, { FEND, }, }; testcase_t t4p4s_test_suite[MAX_TESTCASES] = { { "test", &t4p4s_testcase_test }, TEST_SUITE_END, };
// SPDX-License-Identifier: Apache-2.0 // Copyright 2018 Eotvos Lorand University, Budapest, Hungary #include "test.h" fake_cmd_t t4p4s_testcase_test[][RTE_MAX_LCORE] = SINGLE_LCORE( // table lookup hits FAST(1, 123, INOUT("AA00", "AA22")), WAIT_FOR_CTL, WAIT_FOR_CTL, WAIT_FOR_CTL, // table lookup misses FAST(1, 123, INOUT("BB00", "BB11")) ); testcase_t t4p4s_test_suite[MAX_TESTCASES] = { { "test", &t4p4s_testcase_test }, TEST_SUITE_END, };
Simplify and fix test case
Simplify and fix test case
C
apache-2.0
P4ELTE/t4p4s,P4ELTE/t4p4s,P4ELTE/t4p4s
11e298829b132c9f192ff754845de178d736b8b2
include/System/plugin.h
include/System/plugin.h
/* $Id$ */ /* Copyright (c) 2008-2014 Pierre Pronchery <khorben@defora.org> */ /* This file is part of DeforaOS System libSystem */ /* This program 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, version 3 of the License. * * 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 Lesser 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 LIBSYSTEM_SYSTEM_PLUGIN_H # define LIBSYSTEM_SYSTEM_PLUGIN_H # include "string.h" /* Plugin */ typedef void Plugin; /* functions */ Plugin * plugin_new(String const * libdir, String const * package, String const * type, String const * name); Plugin * plugin_new_self(void); void plugin_delete(Plugin * plugin); /* useful */ void * plugin_lookup(Plugin * plugin, String const * symbol); #endif /* !LIBSYSTEM_SYSTEM_PLUGIN_H */
/* $Id$ */ /* Copyright (c) 2008-2014 Pierre Pronchery <khorben@defora.org> */ /* This file is part of DeforaOS System libSystem */ /* This program 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, version 3 of the License. * * 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 Lesser 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 LIBSYSTEM_SYSTEM_PLUGIN_H # define LIBSYSTEM_SYSTEM_PLUGIN_H # include "license.h" # include "string.h" /* Plugin */ typedef void Plugin; typedef struct _PluginHeader { char const * name; char const * icon; char const * description; LicenseFlags license; } PluginHeader; /* functions */ Plugin * plugin_new(String const * libdir, String const * package, String const * type, String const * name); Plugin * plugin_new_self(void); void plugin_delete(Plugin * plugin); /* useful */ void * plugin_lookup(Plugin * plugin, String const * symbol); #endif /* !LIBSYSTEM_SYSTEM_PLUGIN_H */
Define a standard header for plug-ins
Define a standard header for plug-ins
C
bsd-2-clause
DeforaOS/libSystem,DeforaOS/libSystem,DeforaOS/libSystem
7f06a7c107b2051ff24cc6d40bbcf024538281cb
include/perfetto/protozero/contiguous_memory_range.h
include/perfetto/protozero/contiguous_memory_range.h
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_ #define INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_ #include <assert.h> #include <stddef.h> #include <stdint.h> namespace protozero { // Keep this struct trivially constructible (no ctors, no default initializers). struct ContiguousMemoryRange { uint8_t* begin; uint8_t* end; // STL style: one byte past the end of the buffer. inline bool is_valid() const { return begin != nullptr; } inline void reset() { begin = nullptr; } inline size_t size() { return static_cast<size_t>(end - begin); } }; } // namespace protozero #endif // INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_ #define INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_ #include <assert.h> #include <stddef.h> #include <stdint.h> namespace protozero { // Keep this struct trivially constructible (no ctors, no default initializers). struct ContiguousMemoryRange { uint8_t* begin; uint8_t* end; // STL style: one byte past the end of the buffer. inline bool is_valid() const { return begin != nullptr; } inline void reset() { begin = nullptr; } inline size_t size() const { return static_cast<size_t>(end - begin); } }; } // namespace protozero #endif // INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
Mark ContiguousMemoryRange::size as const. am: f2c28cd765 am: 1b5ab79b0b
Mark ContiguousMemoryRange::size as const. am: f2c28cd765 am: 1b5ab79b0b Change-Id: I7516d6d8ab17209681d1925c9c2dacde0c2fcef1
C
apache-2.0
google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto,google/perfetto
4a243af780afa91bc45377560b469a15613a5125
primitiv/c/cuda_device.h
primitiv/c/cuda_device.h
#ifndef PRIMITIV_C_CUDA_DEVICE_H_ #define PRIMITIV_C_CUDA_DEVICE_H_ #include <primitiv/c/define.h> #include <primitiv/c/device.h> /** * Creates a new Device object. * @param device_id ID of the physical GPU. * @param device Pointer to receive a handler. * @return Status code. * @remarks The random number generator is initialized using * `std::random_device`. */ extern PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new( uint32_t device_id, primitiv_Device **device); /** * Creates a new Device object. * @param device_id ID of the physical GPU. * @param rng_seed The seed value of the random number generator. * @param device Pointer to receive a handler. * @return Status code. */ extern PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new_with_seed( uint32_t device_id, uint32_t rng_seed, primitiv_Device **device); /** * Retrieves the number of active hardwares. * @param num_devices Pointer to receive the number of active hardwares. * @return Status code. */ extern PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_num_devices( uint32_t *num_devices); #endif // PRIMITIV_C_CUDA_DEVICE_H_
#ifndef PRIMITIV_C_CUDA_DEVICE_H_ #define PRIMITIV_C_CUDA_DEVICE_H_ #include <primitiv/c/define.h> #include <primitiv/c/device.h> /** * Creates a new Device object. * @param device_id ID of the physical GPU. * @param device Pointer to receive a handler. * @return Status code. * @remarks The random number generator is initialized using * `std::random_device`. */ PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new( uint32_t device_id, primitiv_Device **device); /** * Creates a new Device object. * @param device_id ID of the physical GPU. * @param rng_seed The seed value of the random number generator. * @param device Pointer to receive a handler. * @return Status code. */ PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_new_with_seed( uint32_t device_id, uint32_t rng_seed, primitiv_Device **device); /** * Retrieves the number of active hardwares. * @param num_devices Pointer to receive the number of active hardwares. * @return Status code. */ PRIMITIV_C_API PRIMITIV_C_STATUS primitiv_devices_CUDA_num_devices( uint32_t *num_devices); #endif // PRIMITIV_C_CUDA_DEVICE_H_
Fix calling conventions around CUDA.
Fix calling conventions around CUDA.
C
apache-2.0
odashi/primitiv,odashi/primitiv,odashi/primitiv
f7b356f345a1b91410181d228855552ec0431c76
Framework/MZFormSheetPresentationControllerFramework.h
Framework/MZFormSheetPresentationControllerFramework.h
// // MZFormSheetPresentationControllerFramework.h // MZFormSheetPresentationControllerFramework // #import <UIKit/UIKit.h> //! Project version number for MZFormSheetPresentation. FOUNDATION_EXPORT double MZFormSheetPresentationControllerVersionNumber; //! Project version string for MZFormSheetPresentation. FOUNDATION_EXPORT const unsigned char MZFormSheetPresentationControllerVersionString[]; // In this header, you should import all the public headers of // your framework using statements like // #import <MZFormSheetPresentationController/PublicHeader.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationController.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewController.h> #import <MZFormSheetPresentationController/MZTransition.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerAnimator.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerAnimatedTransitioning.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerInteractiveAnimator.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerInteractiveTransitioning.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationContentSizing.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerSegue.h>
// // MZFormSheetPresentationControllerFramework.h // MZFormSheetPresentationControllerFramework // #import <UIKit/UIKit.h> //! Project version number for MZFormSheetPresentation. FOUNDATION_EXPORT double MZFormSheetPresentationControllerVersionNumber; //! Project version string for MZFormSheetPresentation. FOUNDATION_EXPORT const unsigned char MZFormSheetPresentationControllerVersionString[]; // In this header, you should import all the public headers of // your framework using statements like // #import <MZFormSheetPresentationController/PublicHeader.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationController.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewController.h> #import <MZFormSheetPresentationController/MZTransition.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerAnimator.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerAnimatedTransitioning.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerInteractiveAnimator.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerInteractiveTransitioning.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationContentSizing.h> #import <MZFormSheetPresentationController/MZFormSheetPresentationViewControllerSegue.h> #import <MZFormSheetPresentationController/MZBlurEffectAdapter.h>
Add MZBlurEffectAdapter.h to umbrella header
Add MZBlurEffectAdapter.h to umbrella header
C
mit
m1entus/MZFormSheetPresentationController,m1entus/MZFormSheetPresentationController
0e1a86e027b7c58adc7fa9082093a2e42113c2f3
WordPressCom-Stats-iOS/StatsGroup.h
WordPressCom-Stats-iOS/StatsGroup.h
#import <Foundation/Foundation.h> @interface StatsGroup : NSObject @property (nonatomic, strong) NSArray *items; // StatsItem @property (nonatomic, assign) BOOL moreItemsExist; @property (nonatomic, copy) NSString *titlePrimary; @property (nonatomic, copy) NSString *titleSecondary; @property (nonatomic, strong) NSURL *iconUrl; @end
#import <Foundation/Foundation.h> @interface StatsGroup : NSObject @property (nonatomic, strong) NSArray *items; // StatsItem @property (nonatomic, copy) NSString *titlePrimary; @property (nonatomic, copy) NSString *titleSecondary; @property (nonatomic, strong) NSURL *iconUrl; @end
Revert "Added moreItems boolean to data model for a group"
Revert "Added moreItems boolean to data model for a group" This reverts commit ddbdfa290670584080d841244b53d6d3ede11de3.
C
mit
wordpress-mobile/WordPressCom-Stats-iOS,wordpress-mobile/WordPressCom-Stats-iOS
09e34b78eeb6237a87b8ae5fd1860e7a550dccbd
tests/configs/config-wrapper-malloc-0-null.h
tests/configs/config-wrapper-malloc-0-null.h
/* mbedtls_config.h wrapper that forces calloc(0) to return NULL. * Used for testing. */ /* * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 * * 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. */ #include "mbedtls/mbedtls_config.h" #include <stdlib.h> static inline void *custom_calloc( size_t nmemb, size_t size ) { if( nmemb == 0 || size == 0 ) return( NULL ); return( calloc( nmemb, size ) ); } #define MBEDTLS_PLATFORM_MEMORY #define MBEDTLS_PLATFORM_STD_CALLOC custom_calloc
/* mbedtls_config.h wrapper that forces calloc(0) to return NULL. * Used for testing. */ /* * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 * * 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. */ #include "mbedtls/mbedtls_config.h" #include <stdlib.h> #ifndef MBEDTLS_PLATFORM_STD_CALLOC static inline void *custom_calloc( size_t nmemb, size_t size ) { if( nmemb == 0 || size == 0 ) return( NULL ); return( calloc( nmemb, size ) ); } #define MBEDTLS_PLATFORM_MEMORY #define MBEDTLS_PLATFORM_STD_CALLOC custom_calloc #endif
Add header guard around malloc(0) returning NULL implementation
Add header guard around malloc(0) returning NULL implementation Make it safe to import the config multiple times without having multiple definition errors. (This prevents errors in the fuzzers in a later patch.) Signed-off-by: Daniel Axtens <cf1af486034ab0119a20f38a060e40da25f4cea3@axtens.net>
C
apache-2.0
Mbed-TLS/mbedtls,ARMmbed/mbedtls,Mbed-TLS/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls,ARMmbed/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls
a4e7d742d66ed4fa4f5d0af9c57a2e5c5026d976
content/public/browser/notification_observer.h
content/public/browser/notification_observer.h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_ #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_ #pragma once #include "content/common/content_export.h" namespace content { class NotificationDetails; class NotificationSource; // This is the base class for notification observers. When a matching // notification is posted to the notification service, Observe is called. class CONTENT_EXPORT NotificationObserver { public: virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) = 0; protected: NotificationObserver() {} virtual ~NotificationObserver() {} }; } // namespace content #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_ #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_ #pragma once #include "content/common/content_export.h" namespace content { class NotificationDetails; class NotificationSource; // This is the base class for notification observers. When a matching // notification is posted to the notification service, Observe is called. class CONTENT_EXPORT NotificationObserver { public: virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) = 0; protected: virtual ~NotificationObserver() {} }; } // namespace content #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_OBSERVER_H_
Remove unnecessary constructor from NotificationObserver.
content: Remove unnecessary constructor from NotificationObserver. BUG=98716 R=jam@chromium.org Review URL: https://chromiumcodereview.appspot.com/10449076 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@139931 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,patrickm/chromium.src,mogoweb/chromium-crosswalk,dushu1203/chromium.src,jaruba/chromium.src,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,keishi/chromium,ChromiumWebApps/chromium,dushu1203/chromium.src,Fireblend/chromium-crosswalk,Fireblend/chromium-crosswalk,dednal/chromium.src,patrickm/chromium.src,dednal/chromium.src,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,dednal/chromium.src,mogoweb/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,timopulkkinen/BubbleFish,M4sse/chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,zcbenz/cefode-chromium,keishi/chromium,dushu1203/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,ltilve/chromium,ltilve/chromium,Just-D/chromium-1,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,keishi/chromium,zcbenz/cefode-chromium,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,dednal/chromium.src,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,markYoungH/chromium.src,hujiajie/pa-chromium,zcbenz/cefode-chromium,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,keishi/chromium,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,ltilve/chromium,junmin-zhu/chromium-rivertrail,Chilledheart/chromium,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,ltilve/chromium,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,littlstar/chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,dednal/chromium.src,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dednal/chromium.src,littlstar/chromium.src,nacl-webkit/chrome_deps,ondra-novak/chromium.src,dednal/chromium.src,littlstar/chromium.src,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,Jonekee/chromium.src,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,dushu1203/chromium.src,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,littlstar/chromium.src,Jonekee/chromium.src,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,keishi/chromium,bright-sparks/chromium-spacewalk,Just-D/chromium-1,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,hujiajie/pa-chromium,M4sse/chromium.src,ltilve/chromium,Chilledheart/chromium,axinging/chromium-crosswalk,Jonekee/chromium.src,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,dednal/chromium.src,hujiajie/pa-chromium,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,M4sse/chromium.src,patrickm/chromium.src,bright-sparks/chromium-spacewalk,littlstar/chromium.src,littlstar/chromium.src,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,keishi/chromium,ChromiumWebApps/chromium,hujiajie/pa-chromium,keishi/chromium,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,markYoungH/chromium.src,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,patrickm/chromium.src,ondra-novak/chromium.src,ondra-novak/chromium.src,Chilledheart/chromium,Just-D/chromium-1,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,Just-D/chromium-1,mogoweb/chromium-crosswalk,jaruba/chromium.src,Chilledheart/chromium,anirudhSK/chromium,anirudhSK/chromium,patrickm/chromium.src,zcbenz/cefode-chromium,hgl888/chromium-crosswalk,markYoungH/chromium.src,ondra-novak/chromium.src,dednal/chromium.src,nacl-webkit/chrome_deps,markYoungH/chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,patrickm/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,zcbenz/cefode-chromium,keishi/chromium,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,patrickm/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,markYoungH/chromium.src,chuan9/chromium-crosswalk,dednal/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,junmin-zhu/chromium-rivertrail,axinging/chromium-crosswalk,jaruba/chromium.src,keishi/chromium,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,keishi/chromium,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,timopulkkinen/BubbleFish,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,bright-sparks/chromium-spacewalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,Just-D/chromium-1,zcbenz/cefode-chromium,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,ondra-novak/chromium.src,hujiajie/pa-chromium,dednal/chromium.src,hujiajie/pa-chromium,anirudhSK/chromium,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,keishi/chromium,dushu1203/chromium.src,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,dushu1203/chromium.src,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish
6f5644a98919e0583f134876de768497a769f5fe
messagebox.c
messagebox.c
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <windows.h> #define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\ (v=vs.85).aspx" #define VERSION "0.1.0" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine, int nShowCmd) { LPWSTR *szArgList; int argCount; szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount); if (szArgList == NULL) { fprintf(stderr, "Unable to parse the command line.\n"); return 255; } if (argCount < 3 || argCount > 4) { fprintf(stderr, "Batch MessageBox v" VERSION "\n"); fprintf(stderr, "Usage: %ls message title [type]\n\n", szArgList[0]); fprintf(stderr, "Calls MessageBoxW() with the given arguments. See\n" URL "\nfor the possible values of \"type\". " "ERRORLEVEL is the return value or 255 on\nerror.\n"); return 255; } /* Ignore _wtoi errors. */ int type = _wtoi(szArgList[3]); int button = MessageBoxW(NULL, szArgList[1], szArgList[2], type); LocalFree(szArgList); return button; }
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <windows.h> #define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\ (v=vs.85).aspx" #define VERSION "0.1.0" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine, int nCmdShow) { LPWSTR *szArgList; int argCount; szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount); if (szArgList == NULL) { fprintf(stderr, "Unable to parse the command line.\n"); return 255; } if (argCount < 3 || argCount > 4) { fprintf(stderr, "Batch MessageBox v" VERSION "\n"); fprintf(stderr, "Usage: %ls message title [type]\n\n", szArgList[0]); fprintf(stderr, "Calls MessageBoxW() with the given arguments. See\n" URL "\nfor the possible values of \"type\". " "ERRORLEVEL is the return value or 255 on\nerror.\n"); return 255; } /* Ignore _wtoi errors. */ int type = _wtoi(szArgList[3]); int button = MessageBoxW(NULL, szArgList[1], szArgList[2], type); LocalFree(szArgList); return button; }
Rename WinMain argument nShowCmd "nCmdShow"
Rename WinMain argument nShowCmd "nCmdShow"
C
mit
dbohdan/messagebox,dbohdan/messagebox
54c1def2b9395c3f159df69d826832352168d837
src/hello.c
src/hello.c
/* * Challenger 1P Hello World Program for cc65. */ #include <conio.h> #define VIDEO_RAM_START ((char *) 0xd000) int main() { static const char hello_world[] = "Hello world!"; int scrpos; const char *cp; clrscr(); for (cp = hello_world, scrpos = 0x083; *cp; scrpos += 1, cp += 1) { *(VIDEO_RAM_START + scrpos) = *cp; } while (1) { char c = cgetc(); *(VIDEO_RAM_START + scrpos++) = c; } return 0; }
/* * Challenger 1P Hello World Program for cc65. */ #include <conio.h> #define VIDEO_RAM_START ((char *) 0xd000) int main() { static const char hello_world[] = "Hello world!\n"; const char *cp; unsigned int i; clrscr(); for (cp = hello_world; *cp; cp += 1) { cputc(*cp); } for (i = 0; i < 256; i += 1) { cputc((unsigned char ) i); } cputc(' '); cputc((char) wherex()); while (1) { char c = cgetc(); cputc(c); } return 0; }
Replace direct video memory access with cputc() for character output.
Replace direct video memory access with cputc() for character output.
C
mit
smuehlst/c1pctest,smuehlst/c1pctest
ff54c764470857acc39c47da7c2adcecf09865f8
examples/complex_struct.c
examples/complex_struct.c
#include <stdio.h> typedef struct { int *x; int **y; } inner ; typedef struct { int *g; inner in[3]; } outer; int *ep; int main(int argc, char *argv[]) { outer o; int z = 5; int zzz; printf("%d\n" , z); ep = &z; o.in[2].x = ep; *o.in[2].x = 3; printf("%d\n" , z); inner i; i.x = &zzz; o.in[1] = i; int **ptr = &o.in[0].x; int *p = *ptr; /* outer oo[4]; */ /* oo[2].in[2].y = &ep; */ return 0; }
#include <stdio.h> typedef struct { int *x; int **y; } inner ; typedef struct { int *g; inner in[3]; } outer; int *ep; int main(int argc, char *argv[]) { outer o; int z = 5; int zzz; printf("%d\n" , z); ep = &z; o.in[2].x = ep; *(o.in[2].x) = 3; printf("%d\n" , z); inner i; i.x = &zzz; o.in[1] = i; int **ptr = &(o.in[0].x); int *p = *ptr; /* outer oo[4]; */ /* oo[2].in[2].y = &ep; */ return 0; }
Add parentheses to make example clearer.
Add parentheses to make example clearer.
C
mit
plast-lab/cclyzer,plast-lab/llvm-datalog
a8dcf158b8f6a62e65c8c5fc9b066be8c53260fb
Plugins/Displays/Bezel/GrowlBezelWindowView.h
Plugins/Displays/Bezel/GrowlBezelWindowView.h
// // GrowlBezelWindowView.h // Display Plugins // // Created by Jorge Salvador Caffarena on 09/09/04. // Copyright 2004 Jorge Salvador Caffarena. All rights reserved. // #import <Cocoa/Cocoa.h> #import "GrowlNotificationView.h" @interface GrowlBezelWindowView : GrowlNotificationView { NSImage *icon; NSString *title; NSString *text; SEL action; id target; NSColor *textColor; NSColor *backgroundColor; NSLayoutManager *layoutManager; } - (void) setIcon:(NSImage *)icon; - (void) setTitle:(NSString *)title; - (void) setText:(NSString *)text; - (void) setPriority:(int)priority; - (float) descriptionHeight:(NSString *)text attributes:(NSDictionary *)attributes width:(float)width; - (id) target; - (void) setTarget:(id)object; - (SEL) action; - (void) setAction:(SEL)selector; @end
// // GrowlBezelWindowView.h // Display Plugins // // Created by Jorge Salvador Caffarena on 09/09/04. // Copyright 2004 Jorge Salvador Caffarena. All rights reserved. // #import <Cocoa/Cocoa.h> #import "GrowlNotificationView.h" @interface GrowlBezelWindowView : GrowlNotificationView { NSImage *icon; NSString *title; NSString *text; NSColor *textColor; NSColor *backgroundColor; NSLayoutManager *layoutManager; } - (void) setIcon:(NSImage *)icon; - (void) setTitle:(NSString *)title; - (void) setText:(NSString *)text; - (void) setPriority:(int)priority; - (float) descriptionHeight:(NSString *)text attributes:(NSDictionary *)attributes width:(float)width; - (id) target; - (void) setTarget:(id)object; - (SEL) action; - (void) setAction:(SEL)selector; @end
Remove duplicate members so this compiles again
Remove duplicate members so this compiles again
C
bsd-3-clause
an0nym0u5/growl,Shalaco/shalzers-growl,SalrJupiter/growl,chashion/growl,an0nym0u5/growl,nagyistoce/growl,ylian/growl,ylian/growl,SalrJupiter/growl,chashion/growl,coltonfisher/coltonfisher-growl,ylian/growl,nochkin/growl,CarlosCD/growl,coltonfisher/coltonfisher-growl,timbck2/growl,nagyistoce/growl,nkhorman/archive-growl,tectronics/growl,timbck2/growl,nochkin/growl,morganestes/morganestes-growl,doshinirav/doshinirav-myversion,nkhorman/archive-growl,timbck2/growl,xhruso00/growl,nagyistoce/growl,chashion/growl,coltonfisher/coltonfisher-growl,morganestes/morganestes-growl,Shalaco/shalzers-growl,morganestes/morganestes-growl,doshinirav/doshinirav-myversion,nagyistoce/growl,timbck2/growl,ylian/growl,ylian/growl,CarlosCD/growl,Shalaco/shalzers-growl,SalrJupiter/growl,CarlosCD/growl,an0nym0u5/growl,SalrJupiter/growl,chashion/growl,nochkin/growl,nkhorman/archive-growl,nagyistoce/growl,Shalaco/shalzers-growl,xhruso00/growl,chashion/growl,nochkin/growl,morganestes/morganestes-growl,xhruso00/growl,tectronics/growl,nagyistoce/growl,an0nym0u5/growl,CarlosCD/growl,nochkin/growl,an0nym0u5/growl,xhruso00/growl,tectronics/growl,timbck2/growl,coltonfisher/coltonfisher-growl,doshinirav/doshinirav-myversion,SalrJupiter/growl,tectronics/growl,Shalaco/shalzers-growl,coltonfisher/coltonfisher-growl,nkhorman/archive-growl,nkhorman/archive-growl,coltonfisher/coltonfisher-growl,doshinirav/doshinirav-myversion,an0nym0u5/growl,nochkin/growl,Shalaco/shalzers-growl,morganestes/morganestes-growl,timbck2/growl,Shalaco/shalzers-growl,ylian/growl,doshinirav/doshinirav-myversion,SalrJupiter/growl,morganestes/morganestes-growl,Shalaco/shalzers-growl,tectronics/growl,CarlosCD/growl,Shalaco/shalzers-growl,doshinirav/doshinirav-myversion,doshinirav/doshinirav-myversion,Shalaco/shalzers-growl,Shalaco/shalzers-growl,xhruso00/growl,coltonfisher/coltonfisher-growl,xhruso00/growl,chashion/growl,nkhorman/archive-growl,CarlosCD/growl,CarlosCD/growl,tectronics/growl
d91dc98abb3ebda043eb97d554fe79e83320e9e2
libopenspotify/sp_user.c
libopenspotify/sp_user.c
#include <spotify/api.h> #include "debug.h" #include "sp_opaque.h" SP_LIBEXPORT(const char *) sp_user_canonical_name(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented"); return "not-yet-implemented"; } SP_LIBEXPORT(const char *) sp_user_display_name(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented"); return "not-yet-implemented"; } SP_LIBEXPORT(bool) sp_user_is_loaded(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented"); return 0; }
#include <spotify/api.h> #include "debug.h" #include "sp_opaque.h" SP_LIBEXPORT(const char *) sp_user_canonical_name(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented\n"); return "not-yet-implemented"; } SP_LIBEXPORT(const char *) sp_user_display_name(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented\n"); return "not-yet-implemented"; } SP_LIBEXPORT(bool) sp_user_is_loaded(sp_user *user) { DSFYDEBUG("FIXME: Not yet implemented\n"); return 0; }
Add missing newlines to DSFYDEBUG() calls
Add missing newlines to DSFYDEBUG() calls
C
bsd-2-clause
noahwilliamsson/openspotify,noahwilliamsson/openspotify
2ed55f8d7eef0709bf1c96356d98605dd28ce442
machine/include/config.h
machine/include/config.h
#ifndef KERN_CONFIG #define KERN_CONFIG #define NUM_STACK_PAGES 2 #define MAX_AMOUNT_OF_CONTEXTS 32 #define NUM_FDS 32 // The trampoline must be mapped at the same vaddr for both the kernel and // the userspace processes. The page is mapped to the last VPN slot available // Sv39 has 39bit adresses: 2^39 - PAGESIZE = 0x80'0000'0000 - 0x100 = 0x80'0000'0000 // It will be mapped twice in the kernel address space #define TRAMPOLINE_VADDR 0x7FFFFFFF00 // The top-most stack address for a user process. As the stack grows downwards, it's best to place it after the trap trampoline to prevent collisions. // As specified by the RISC-V ELF psABI (https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md), // we use a descending full stack, i.e. sp points to the last pushed element in the stack // Thus, USERSPACE_STACK_START shall be positioned one above the actual first stack slot. #define USERSPACE_STACK_START TRAMPOLINE_VADDR #endif
#ifndef KERN_CONFIG #define KERN_CONFIG #define NUM_STACK_PAGES 2 #define MAX_AMOUNT_OF_CONTEXTS 32 #define NUM_FDS 32 // The trampoline must be mapped at the same vaddr for both the kernel and // the userspace processes. The page is mapped to the last VPN slot available // Sv39 has 39bit adresses: 2^39 - PAGESIZE = 0x80'0000'0000 - 0x100 = 0x7F'FFFF'F000 // According to the Sv39 documentation, the vaddr "must have bits 63–39 all equal to bit 38, or else a page-fault // exception will occur", thus the actual vaddr is 0xFFFF'FFFF'FFFF'F000 // It will be mapped twice in the kernel address space #define TRAMPOLINE_VADDR 0xFFFFFFFFFFFFF000 // The top-most stack address for a user process. As the stack grows downwards, it's best to place it after the trap trampoline to prevent collisions. // As specified by the RISC-V ELF psABI (https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md), // we use a descending full stack, i.e. sp points to the last pushed element in the stack // Thus, USERSPACE_STACK_START shall be positioned one above the actual first stack slot. #define USERSPACE_STACK_START TRAMPOLINE_VADDR #endif
Fix trap trampoline virtual address
Fix trap trampoline virtual address [skip ci] We want to map the trap trampoline to the highest possible virtual address, i.e. the last PTE possible. However, Sv39 specifies that bits 39-63 must reflect bit 38's state lest the CPU raises a page fault.
C
bsd-2-clause
cksystemsteaching/selfie,ChristianMoesl/selfie,cksystemsteaching/selfie,ChristianMoesl/selfie,cksystemsteaching/selfie
97d015ba572002c65fab1d4d8256678a9ff7d841
elang/base/zone_vector.h
elang/base/zone_vector.h
// Copyright 2014 Project Vogue. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ELANG_BASE_ZONE_VECTOR_H_ #define ELANG_BASE_ZONE_VECTOR_H_ #include <vector> #include "elang/base/zone.h" #include "elang/base/zone_allocator.h" namespace elang { ////////////////////////////////////////////////////////////////////// // // ZoneVector // A wrapper subclass for |std::vector|. // template <typename T> class ZoneVector : public std::vector<T, ZoneAllocator<T>> { public: explicit ZoneVector(Zone* zone) : std::vector<T, ZoneAllocator<T>>(ZoneAllocator<T>(zone)) {} ZoneVector(Zone* zone, size_t size, value_type& val = value_type()) : std::vector<T, ZoneAllocator<T>>(size, val, ZoneAllocator<T>(zone)) {} ZoneVector(Zone* zone, const std::vector<T>& other) : std::vector<T, ZoneAllocator<T>>(other.begin(), other.end(), ZoneAllocator<T>(zone)) {} }; } // namespace elang #endif // ELANG_BASE_ZONE_VECTOR_H_
// Copyright 2014 Project Vogue. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ELANG_BASE_ZONE_VECTOR_H_ #define ELANG_BASE_ZONE_VECTOR_H_ #include <vector> #include "elang/base/zone.h" #include "elang/base/zone_allocator.h" namespace elang { ////////////////////////////////////////////////////////////////////// // // ZoneVector // A wrapper subclass for |std::vector|. // template <typename T> class ZoneVector : public std::vector<T, ZoneAllocator<T>> { public: explicit ZoneVector(Zone* zone) : std::vector<T, ZoneAllocator<T>>(ZoneAllocator<T>(zone)) {} ZoneVector(Zone* zone, size_t size, const value_type& val = value_type()) : std::vector<T, ZoneAllocator<T>>(size, val, ZoneAllocator<T>(zone)) {} ZoneVector(Zone* zone, const std::vector<T>& other) : std::vector<T, ZoneAllocator<T>>(other.begin(), other.end(), ZoneAllocator<T>(zone)) {} }; } // namespace elang #endif // ELANG_BASE_ZONE_VECTOR_H_
Make |ZoneVector| constructor to take const reference.
elang/base: Make |ZoneVector| constructor to take const reference.
C
apache-2.0
eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang,eval1749/elang