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
70f269b59dbd1f483940d401e6e82fe5f2408a92
utils/log.h
utils/log.h
/* * Copyright 2003 James Bursa <bursa@users.sourceforge.net> * Copyright 2004 John Tytgat <John.Tytgat@aaug.net> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * Licenced under the MIT License, * http://www.opensource.org/licenses/mit-license.php */ #include <stdio.h> #ifndef _LIBNSGIF_LOG_H_ #define _LIBNSGIF_LOG_H_ #ifdef NDEBUG # define LOG(x) ((void) 0) #else # ifdef __GNUC__ # define LOG(x) do { printf x, fputc('\n', stdout)); } while (0) # elif defined(__CC_NORCROFT) # define LOG(x) do { printf x, fputc('\n', stdout)); } while (0) # else # define LOG(x) do { printf x, fputc('\n', stdout)); } while (0) # endif #endif #endif
/* * Copyright 2003 James Bursa <bursa@users.sourceforge.net> * Copyright 2004 John Tytgat <John.Tytgat@aaug.net> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * Licenced under the MIT License, * http://www.opensource.org/licenses/mit-license.php */ #include <stdio.h> #ifndef _LIBNSBMP_LOG_H_ #define _LIBNSBMP_LOG_H_ #ifdef NDEBUG # define LOG(x) ((void) 0) #else # ifdef __GNUC__ # define LOG(x) do { printf x, fputc('\n', stdout)); } while (0) # elif defined(__CC_NORCROFT) # define LOG(x) do { printf x, fputc('\n', stdout)); } while (0) # else # define LOG(x) do { printf x, fputc('\n', stdout)); } while (0) # endif #endif #endif
Fix misleading dbl header include protection test.
Fix misleading dbl header include protection test. svn path=/trunk/libnsbmp/; revision=5312
C
mit
dkua/libnsbmp,dkua/libnsbmp
4ef5651e85589e3aaca704c6d2d7ae7e794e5d25
arch/mips/include/asm/bug.h
arch/mips/include/asm/bug.h
#ifndef __ASM_BUG_H #define __ASM_BUG_H #include <linux/compiler.h> #include <asm/sgidefs.h> #ifdef CONFIG_BUG #include <asm/break.h> static inline void __noreturn BUG(void) { __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); /* Fool GCC into thinking the function doesn't return. */ while (1) ; } #define HAVE_ARCH_BUG #if (_MIPS_ISA > _MIPS_ISA_MIPS1) static inline void __BUG_ON(unsigned long condition) { if (__builtin_constant_p(condition)) { if (condition) BUG(); else return; } __asm__ __volatile__("tne $0, %0, %1" : : "r" (condition), "i" (BRK_BUG)); } #define BUG_ON(C) __BUG_ON((unsigned long)(C)) #define HAVE_ARCH_BUG_ON #endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */ #endif #include <asm-generic/bug.h> #endif /* __ASM_BUG_H */
#ifndef __ASM_BUG_H #define __ASM_BUG_H #include <linux/compiler.h> #include <asm/sgidefs.h> #ifdef CONFIG_BUG #include <asm/break.h> static inline void __noreturn BUG(void) { __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); unreachable(); } #define HAVE_ARCH_BUG #if (_MIPS_ISA > _MIPS_ISA_MIPS1) static inline void __BUG_ON(unsigned long condition) { if (__builtin_constant_p(condition)) { if (condition) BUG(); else return; } __asm__ __volatile__("tne $0, %0, %1" : : "r" (condition), "i" (BRK_BUG)); } #define BUG_ON(C) __BUG_ON((unsigned long)(C)) #define HAVE_ARCH_BUG_ON #endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */ #endif #include <asm-generic/bug.h> #endif /* __ASM_BUG_H */
Convert BUG() to use unreachable()
MIPS: Convert BUG() to use unreachable() Use the new unreachable() macro instead of while(1); Signed-off-by: David Daney <0662de36cfb0706ed279bff52abef14720945acc@caviumnetworks.com> Acked-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org> CC: 562397917b9a8bf316569a848858b12fb417723f@linux-mips.org Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas
d3f6edf4589da29a8694b00e797910e2e3f886f5
tools/checkscp.c
tools/checkscp.c
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include "scp.h" unsigned char scp_processheader(FILE *scpfile) { return 0; } void scp_processtrack(FILE *scpfile, const unsigned char track) { } int main(int argc, char **argv) { unsigned char numtracks; unsigned char track; FILE *fp; if (argc!=2) { printf("Specify .scp on command line\n"); return 1; } fp=fopen(argv[1], "rb"); if (fp==NULL) { printf("Unable to open file\n"); return 2; } numtracks=scp_processheader(fp); for (track=0; track<numtracks; track++) scp_processtrack(fp, track); fclose(fp); return 0; }
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include "scp.h" struct scp_header header; unsigned char scp_processheader(FILE *scpfile) { fread(&header, 1, sizeof(header), scpfile); if (strncmp((char *)&header.magic, SCP_MAGIC, strlen(SCP_MAGIC))!=0) { printf("Not an SCP file\n"); return 0; } printf("SCP magic detected\n"); printf("Version: %d.%d\n", header.version>>4, header.version&0x0f); printf("Disk type: %d %d\n", header.disktype>>4, header.disktype&0x0f); printf("Revolutions: %d\n", header.revolutions); printf("Tracks: %d to %d\n", header.starttrack, header.endtrack); printf("Flags: 0x%.2x\n", header.flags); printf("Bitcell encoding: %d bits\n", header.bitcellencoding==0?16:header.bitcellencoding); printf("Heads: %d\n", header.heads); printf("Resolution: %dns\n", (header.resolution+1)*SCP_BASE_NS); printf("Checksum: 0x%.8x\n", header.checksum); printf("Tracks in SCP: %d\n", header.endtrack-header.starttrack); return 0; } void scp_processtrack(FILE *scpfile, const unsigned char track) { } int main(int argc, char **argv) { unsigned char numtracks; unsigned char track; FILE *fp; if (argc!=2) { printf("Specify .scp on command line\n"); return 1; } fp=fopen(argv[1], "rb"); if (fp==NULL) { printf("Unable to open file\n"); return 2; } numtracks=scp_processheader(fp); for (track=0; track<numtracks; track++) scp_processtrack(fp, track); fclose(fp); return 0; }
Check magic and output header fields
Check magic and output header fields
C
mit
picosonic/bbc-fdc,picosonic/bbc-fdc
a1199a9863cc34c78bc0e63e3ea0c9420abeacb1
MFSideMenu/MFSideMenuShadow.h
MFSideMenu/MFSideMenuShadow.h
// // MFSideMenuShadow.h // MFSideMenuDemoSearchBar // // Created by Michael Frederick on 5/13/13. // Copyright (c) 2013 Frederick Development. All rights reserved. // #import <Foundation/Foundation.h> @interface MFSideMenuShadow : NSObject @property (nonatomic, assign) BOOL enabled; @property (nonatomic, assign) CGFloat radius; @property (nonatomic, assign) CGFloat opacity; @property (nonatomic, strong) UIColor *color; @property (nonatomic, assign) UIView *shadowedView; + (MFSideMenuShadow *)shadowWithView:(UIView *)shadowedView; + (MFSideMenuShadow *)shadowWithColor:(UIColor *)color radius:(CGFloat)radius opacity:(CGFloat)opacity; - (void)draw; - (void)shadowedViewWillRotate; - (void)shadowedViewDidRotate; @end
// // MFSideMenuShadow.h // MFSideMenuDemoSearchBar // // Created by Michael Frederick on 5/13/13. // Copyright (c) 2013 Frederick Development. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @interface MFSideMenuShadow : NSObject @property (nonatomic, assign) BOOL enabled; @property (nonatomic, assign) CGFloat radius; @property (nonatomic, assign) CGFloat opacity; @property (nonatomic, strong) UIColor *color; @property (nonatomic, assign) UIView *shadowedView; + (MFSideMenuShadow *)shadowWithView:(UIView *)shadowedView; + (MFSideMenuShadow *)shadowWithColor:(UIColor *)color radius:(CGFloat)radius opacity:(CGFloat)opacity; - (void)draw; - (void)shadowedViewWillRotate; - (void)shadowedViewDidRotate; @end
Include UIKit to h file, because change pch to h for two files in main project and refactor all needed includes.
Include UIKit to h file, because change pch to h for two files in main project and refactor all needed includes.
C
bsd-3-clause
AxialExchange/MFSideMenu
842e55bd409151abc805b2e0595346821c3f6c83
as6502/common.h
as6502/common.h
// // common.h // v6502 // // Created by Daniel Loffgren on H.25/05/05. // Copyright (c) 平成25年 Hello-Channel, LLC. All rights reserved. // #ifndef v6502_common_h #define v6502_common_h void die(const char *reason); #endif
// // common.h // v6502 // // Created by Daniel Loffgren on H.25/05/05. // Copyright (c) 平成25年 Hello-Channel, LLC. All rights reserved. // #ifndef v6502_common_h #define v6502_common_h __attribute((noreturn)) void die(const char *reason); #endif
Make sure static analyzer can see die's noreturn attribute
Make sure static analyzer can see die's noreturn attribute git-svn-id: dd14d189f2554b0b3f4c2209a95c13d2029e3fe8@183 96dfbd92-d197-e211-9ca9-00110a534b34
C
mit
RyuKojiro/v6502
a1893ca13b9fc87ebde6472240436a15645704c0
include/nekit/utils/error.h
include/nekit/utils/error.h
// MIT License // Copyright (c) 2017 Zhuhao Wang // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #pragma once #include <system_error> namespace nekit { namespace utils { typedef std::error_code Error; } // namespace utils } // namespace nekit
// MIT License // Copyright (c) 2017 Zhuhao Wang // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #pragma once #include <system_error> namespace nekit { namespace utils { using Error = std::error_code; } // namespace utils } // namespace nekit
Use `using` instead of `typedef`
STYLE: Use `using` instead of `typedef`
C
mit
zhuhaow/libnekit,zhuhaow/libnekit,zhuhaow/libnekit,zhuhaow/libnekit
1a8eebb5f92e2b2545612ab8d2c5132719c55c96
simulator/kernel/kernel.h
simulator/kernel/kernel.h
/* * kernel.h - base kernel class * @author Vyacheslav Kompan kompan.vo@phystech.edu * Copyright 2018 MIPT-MIPS */ #ifndef KERNEL_H #define KERNEL_H /* Simulator modules */ #include <memory/memory.h> #include <simulator.h> /* Generic C++ */ #include <memory> class Kernel { std::weak_ptr<Simulator> sim; std::shared_ptr<FuncMemory> mem; public: static std::shared_ptr<Kernel> create_kernel() { return std::make_shared<Kernel>(); } void set_simulator( std::shared_ptr<Simulator> sim) { this->sim = sim; } void set_memory( std::shared_ptr<FuncMemory> mem) { this->mem = std::move( mem); } /* Return false if simulator should be stopped, e.g. on 'exit' syscall */ virtual bool execute() { return true; } Kernel() = default; Kernel( const Kernel&) = delete; Kernel( Kernel&&) = delete; Kernel operator=( const Kernel&) = delete; Kernel operator=( Kernel&&) = delete; }; #endif //KERNEL_H
/* * kernel.h - base kernel class * @author Vyacheslav Kompan kompan.vo@phystech.edu * Copyright 2018 MIPT-MIPS */ #ifndef KERNEL_H #define KERNEL_H /* Simulator modules */ #include <memory/memory.h> #include <simulator.h> /* Generic C++ */ #include <memory> class Kernel { std::weak_ptr<Simulator> sim; std::shared_ptr<FuncMemory> mem; public: static std::shared_ptr<Kernel> create_kernel() { return std::make_shared<Kernel>(); } void set_simulator( std::shared_ptr<Simulator> s) { sim = s; } void set_memory( std::shared_ptr<FuncMemory> m) { mem = std::move( m); } /* Return false if simulator should be stopped, e.g. on 'exit' syscall */ virtual bool execute() { return true; } Kernel() = default; Kernel( const Kernel&) = delete; Kernel( Kernel&&) = delete; Kernel operator=( const Kernel&) = delete; Kernel operator=( Kernel&&) = delete; }; #endif //KERNEL_H
Rename Kernel setter methods arguments
Rename Kernel setter methods arguments
C
mit
MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips,MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips,MIPT-ILab/mipt-mips-2015
688499b9a6d027ad71dbc4718f9c3b8a48dba776
src/salut.c
src/salut.c
#include "config.h" #include <glib.h> #include <telepathy-glib/run.h> #include <telepathy-glib/debug.h> #include "salut-connection-manager.h" #include "salut-avahi-discovery-client.h" #include "debug.h" static TpBaseConnectionManager * salut_create_connection_manager (void) { return TP_BASE_CONNECTION_MANAGER ( g_object_new (SALUT_TYPE_CONNECTION_MANAGER, "backend-type", SALUT_TYPE_AVAHI_DISCOVERY_CLIENT, NULL)); } int main (int argc, char **argv) { g_type_init (); g_thread_init (NULL); g_set_prgname ("telepathy-salut"); #ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("SALUT_LOGFILE")); debug_set_flags_from_env (); if (g_getenv ("SALUT_PERSIST")) tp_debug_set_persistent (TRUE); #endif return tp_run_connection_manager ("telepathy-salut", VERSION, salut_create_connection_manager, argc, argv); }
#include "config.h" #include <glib.h> #include <telepathy-glib/run.h> #include <telepathy-glib/debug.h> #include "salut-connection-manager.h" #include "salut-avahi-discovery-client.h" #include "debug.h" static TpBaseConnectionManager * salut_create_connection_manager (void) { return TP_BASE_CONNECTION_MANAGER ( g_object_new (SALUT_TYPE_CONNECTION_MANAGER, "backend-type", SALUT_TYPE_AVAHI_DISCOVERY_CLIENT, NULL)); } int main (int argc, char **argv) { g_type_init (); g_thread_init (NULL); #ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("SALUT_LOGFILE")); debug_set_flags_from_env (); if (g_getenv ("SALUT_PERSIST")) tp_debug_set_persistent (TRUE); #endif return tp_run_connection_manager ("telepathy-salut", VERSION, salut_create_connection_manager, argc, argv); }
Remove use of g_set_prgname in main().
Remove use of g_set_prgname in main(). tp_run_connection_manager calls g_set_prgname internally. It's supposed to only be called once. Calling it in addition to tp_run_connection_manager causes an assertion. This patch removes use of it in main().
C
lgpl-2.1
freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut
fd1f5bb3bf922fcfd5afdb5d6a0faced6eb995b3
include/Genes/Pawn_Structure_Gene.h
include/Genes/Pawn_Structure_Gene.h
#ifndef PAWN_STRUCTURE_GENE_H #define PAWN_STRUCTURE_GENE_H #include <string> #include <map> #include "Genes/Gene.h" #include "Game/Piece.h" #include "Game/Color.h" class Board; class Pawn_Structure_Gene : public Clonable_Gene<Pawn_Structure_Gene> { public: Pawn_Structure_Gene() noexcept; std::string name() const noexcept override; double score_board(const Board& board, Piece_Color perspective, size_t depth, double game_progress) const noexcept override; private: double opening_guarded_by_pawn = 1.0; double opening_guarded_by_pawn_in_one_move = 1.0; double opening_guarded_by_piece = 1.0; double endgame_guarded_by_pawn = 1.0; double endgame_guarded_by_pawn_in_one_move = 1.0; double endgame_guarded_by_piece = 1.0; void gene_specific_mutation() noexcept override; void adjust_properties(std::map<std::string, double>& properties) const noexcept override; void load_gene_properties(const std::map<std::string, double>& properties) override; void normalize_guard_scores() noexcept; }; #endif // PAWN_STRUCTURE_GENE_H
#ifndef PAWN_STRUCTURE_GENE_H #define PAWN_STRUCTURE_GENE_H #include <string> #include <map> #include "Genes/Gene.h" #include "Game/Piece.h" #include "Game/Color.h" class Board; //! \brief A gene to evaluate how well pawns are protected. class Pawn_Structure_Gene : public Clonable_Gene<Pawn_Structure_Gene> { public: Pawn_Structure_Gene() noexcept; std::string name() const noexcept override; private: double opening_guarded_by_pawn = 1.0; double opening_guarded_by_pawn_in_one_move = 1.0; double opening_guarded_by_piece = 1.0; double endgame_guarded_by_pawn = 1.0; double endgame_guarded_by_pawn_in_one_move = 1.0; double endgame_guarded_by_piece = 1.0; double score_board(const Board& board, Piece_Color perspective, size_t depth, double game_progress) const noexcept override; void gene_specific_mutation() noexcept override; void adjust_properties(std::map<std::string, double>& properties) const noexcept override; void load_gene_properties(const std::map<std::string, double>& properties) override; void normalize_guard_scores() noexcept; }; #endif // PAWN_STRUCTURE_GENE_H
Fix public/private members and doxygen comments
Fix public/private members and doxygen comments
C
mit
MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess
a919d4dcbd4286c675d4ef6d720dd80b71be3614
sort_algorithms.c
sort_algorithms.c
/* Author: Dan Wilder * * School: University of Missouri - St. Louis * Semester: Fall 2015 * Class: CS 3130 - Design and Analysis of Algorithms * Instructor: Galina N. Piatnitskaia */ #include "sort_algorithms.h" void swap(int *x, int *y) { int temp = *x; *x = *y *y = temp; } void bubbleSort(int arr[], int n) { /* with swaps counting. n is the size of arr. */ int i, j; for (i = 0; i <= n-1; ++i) for (j = n; j >= i+1; --j) if (arr[j] < arr[j-1]) swap(&arr[j], &arr[j-1]); }
/* Author: Dan Wilder * * School: University of Missouri - St. Louis * Semester: Fall 2015 * Class: CS 3130 - Design and Analysis of Algorithms * Instructor: Galina N. Piatnitskaia */ #include "sort_algorithms.h" void swap(int *x, int *y) { int temp = *x; *x = *y *y = temp; } void bubbleSort(int arr[], int size) { /* with swaps counting. */ int i, j; for (i = 0; i <= size-1; ++i) for (j = size; j >= i+1; --j) if (arr[j] < arr[j-1]) swap(&arr[j], &arr[j-1]); }
Change name of parameter in bubbleSort
Change name of parameter in bubbleSort
C
mit
sentientWilder/Search-and-Sort,sentientWilder/Search-and-Sort
f88f56d7356cd46fcc861a06aa4312e57486dfc5
src/popsift/common/sync_queue.h
src/popsift/common/sync_queue.h
#pragma once #include <condition_variable> #include <mutex> #include <queue> namespace popsift { /************************************************************* * SyncQueue * This is a basic alternative to the Boost sync_queue class. * It lets threads push and pull items off a queue in a thread * safe manner. *************************************************************/ template<typename T> class SyncQueue { public: SyncQueue() = default; /* Push an item onto the queue and signal it's available. */ void push(const T& value) { std::unique_lock<std::mutex> lock(mtx_); items_.push(value); lock.unlock(); signal_.notify_one(); } /* Check if the queue is empty - thread safety via mutex. */ bool empty() { std::unique_lock<std::mutex> lock(mtx_); return items_.empty(); } /* BLOCKING. Pull an item off the queue, or, wait until one arrives. */ T pull() { std::unique_lock<std::mutex> lock(mtx_); signal_.wait(lock, [this] { return !items_.empty(); }); auto ans = items_.front(); items_.pop(); return ans; } private: std::mutex mtx_; std::queue<T> items_; std::condition_variable signal_; }; } // namespace popsift
#pragma once #include <condition_variable> #include <mutex> #include <queue> namespace popsift { /** * @brief A thread safe wrapper around std::queue (replaces boost::sync_queue). * @tparam T the value type that's stored in the queue. */ template<typename T> class SyncQueue { public: SyncQueue() = default; /** * @brief Push an item onto the queue and signal it's available. * @param[in] value the item to add to the queue. */ void push(const T& value) { std::unique_lock<std::mutex> lock(mtx_); items_.push(value); lock.unlock(); signal_.notify_one(); } /** * @brief Check if the queue is empty - thread safety via mutex. * @return True if the queue is empty. */ bool empty() { std::unique_lock<std::mutex> lock(mtx_); return items_.empty(); } /** * @brief Pull an item off the queue, or, wait until one arrives. Blocking. * @return The front item that was popped off the queue. */ T pull() { std::unique_lock<std::mutex> lock(mtx_); signal_.wait(lock, [this] { return !items_.empty(); }); auto ans = items_.front(); items_.pop(); return ans; } private: std::mutex mtx_; std::queue<T> items_; std::condition_variable signal_; }; } // namespace popsift
Add doxygen comments to SyncQueue.
Add doxygen comments to SyncQueue.
C
mpl-2.0
alicevision/popsift,alicevision/popsift,alicevision/popsift
deaddeb464bb6922424a399be2cf62a57e90d7b5
MoblicoSDK/Services/MLCSettingsService.h
MoblicoSDK/Services/MLCSettingsService.h
/* Copyright 2012 Moblico Solutions LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #import <MoblicoSDK/MLCService.h> @class MLCSettings; NS_ASSUME_NONNULL_BEGIN typedef void(^MLCSettingsServiceCompletionHandler)(id _Nullable MLCSettings, NSError * _Nullable error, NSHTTPURLResponse * _Nullable response); @interface MLCSettingsService : MLCService + (instancetype)readSettings:(MLCSettingsServiceCompletionHandler)handler; + (MLCSettings *)settings; + (void)overrideSettings:(nullable NSDictionary *)settings; @end @interface MLCSettings : NSObject - (nullable id)objectForKey:(NSString *)key; - (nullable id)objectForKeyedSubscript:(NSString *)key; @end NS_ASSUME_NONNULL_END
/* Copyright 2012 Moblico Solutions LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #import <MoblicoSDK/MLCService.h> @class MLCSettings; NS_ASSUME_NONNULL_BEGIN typedef void(^MLCSettingsServiceCompletionHandler)(MLCSettings * _Nullable MLCSettings, NSError * _Nullable error, NSHTTPURLResponse * _Nullable response); @interface MLCSettingsService : MLCService + (instancetype)readSettings:(MLCSettingsServiceCompletionHandler)handler; + (MLCSettings *)settings; + (void)overrideSettings:(nullable NSDictionary *)settings; @end @interface MLCSettings : NSObject - (nullable id)objectForKey:(NSString *)key; - (nullable id)objectForKeyedSubscript:(NSString *)key; @end NS_ASSUME_NONNULL_END
Update type in SettingsService callback.
Update type in SettingsService callback.
C
apache-2.0
Moblico/MoblicoSDK-iOS
a7792a50ca0d22f595d01d191252ab20f5cb206c
integration/cocos2d-x-v2/include/bee/Cocos2dxBeehive.h
integration/cocos2d-x-v2/include/bee/Cocos2dxBeehive.h
// // Created by Dawid Drozd aka Gelldur on 08.10.17. // #pragma once #include <map> #include <string> #include <vector> #include <bee/Beehive.h> namespace cocos2d { class CCNode; } namespace Bee { class Graph; class Node; class Cocos2dxBeehive { public: Cocos2dxBeehive(const std::vector<std::string>& searchPaths); ~Cocos2dxBeehive(); cocos2d::CCNode* createView(const std::string& content); cocos2d::CCNode* findViewById(const std::string& id); private: Graph* _graph; std::shared_ptr<sel::State> _state; Bee::Beehive _beehive; void addRelation(Node* nodeParent, Node* nodeChild); }; }
// // Created by Dawid Drozd aka Gelldur on 08.10.17. // #pragma once #include <map> #include <string> #include <vector> #include <bee/Beehive.h> namespace cocos2d { class CCNode; } namespace Bee { class Graph; class Node; class Cocos2dxBeehive { public: Cocos2dxBeehive(const std::vector<std::string>& searchPaths); ~Cocos2dxBeehive(); cocos2d::CCNode* createView(const std::string& content); cocos2d::CCNode* findViewById(const std::string& id); const std::shared_ptr<sel::State>& getState() { return _state; } private: Graph* _graph; std::shared_ptr<sel::State> _state; Bee::Beehive _beehive; void addRelation(Node* nodeParent, Node* nodeChild); }; }
Add getter for lua state
Add getter for lua state
C
apache-2.0
gelldur/Bee
62313cd8de5b7809f748801fccd8010334cb4851
src/include/cdb/cdbsrlz.h
src/include/cdb/cdbsrlz.h
/*------------------------------------------------------------------------- * * cdbsrlz.h * definitions for paln serialization utilities * * Copyright (c) 2004-2008, Greenplum inc * * NOTES * *------------------------------------------------------------------------- */ #ifndef CDBSRLZ_H #define CDBSRLZ_H #include "nodes/nodes.h" extern char *serializeNode(Node *node, int *size, int *uncompressed_size); extern Node *deserializeNode(const char *strNode, int size); #endif /* CDBSRLZ_H */
/*------------------------------------------------------------------------- * * cdbsrlz.h * definitions for plan serialization utilities * * Copyright (c) 2004-2008, Greenplum inc * * NOTES * *------------------------------------------------------------------------- */ #ifndef CDBSRLZ_H #define CDBSRLZ_H #include "nodes/nodes.h" extern char *serializeNode(Node *node, int *size, int *uncompressed_size); extern Node *deserializeNode(const char *strNode, int size); #endif /* CDBSRLZ_H */
Fix typo in header file comment
Fix typo in header file comment
C
apache-2.0
janebeckman/gpdb,atris/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,50wu/gpdb,kaknikhil/gpdb,foyzur/gpdb,tangp3/gpdb,chrishajas/gpdb,atris/gpdb,Quikling/gpdb,rvs/gpdb,jmcatamney/gpdb,0x0FFF/gpdb,Quikling/gpdb,atris/gpdb,janebeckman/gpdb,zaksoup/gpdb,cjcjameson/gpdb,ashwinstar/gpdb,Quikling/gpdb,kaknikhil/gpdb,0x0FFF/gpdb,lintzc/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,Quikling/gpdb,chrishajas/gpdb,chrishajas/gpdb,rvs/gpdb,zaksoup/gpdb,Chibin/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,50wu/gpdb,lisakowen/gpdb,50wu/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,xinzweb/gpdb,xinzweb/gpdb,Quikling/gpdb,royc1/gpdb,Chibin/gpdb,edespino/gpdb,rubikloud/gpdb,lintzc/gpdb,lintzc/gpdb,foyzur/gpdb,lpetrov-pivotal/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,Quikling/gpdb,jmcatamney/gpdb,0x0FFF/gpdb,edespino/gpdb,yuanzhao/gpdb,CraigHarris/gpdb,ahachete/gpdb,lintzc/gpdb,Chibin/gpdb,yuanzhao/gpdb,atris/gpdb,greenplum-db/gpdb,adam8157/gpdb,randomtask1155/gpdb,rvs/gpdb,ashwinstar/gpdb,lisakowen/gpdb,rubikloud/gpdb,royc1/gpdb,atris/gpdb,lintzc/gpdb,atris/gpdb,CraigHarris/gpdb,ahachete/gpdb,tangp3/gpdb,atris/gpdb,ashwinstar/gpdb,edespino/gpdb,cjcjameson/gpdb,ahachete/gpdb,kaknikhil/gpdb,zaksoup/gpdb,Chibin/gpdb,xinzweb/gpdb,lpetrov-pivotal/gpdb,ahachete/gpdb,cjcjameson/gpdb,edespino/gpdb,rvs/gpdb,foyzur/gpdb,Quikling/gpdb,xinzweb/gpdb,randomtask1155/gpdb,0x0FFF/gpdb,lintzc/gpdb,janebeckman/gpdb,lintzc/gpdb,lpetrov-pivotal/gpdb,kaknikhil/gpdb,randomtask1155/gpdb,janebeckman/gpdb,royc1/gpdb,lpetrov-pivotal/gpdb,xuegang/gpdb,xuegang/gpdb,50wu/gpdb,tangp3/gpdb,chrishajas/gpdb,zaksoup/gpdb,zaksoup/gpdb,janebeckman/gpdb,royc1/gpdb,adam8157/gpdb,atris/gpdb,xinzweb/gpdb,lpetrov-pivotal/gpdb,edespino/gpdb,xuegang/gpdb,yuanzhao/gpdb,randomtask1155/gpdb,Chibin/gpdb,ahachete/gpdb,Quikling/gpdb,50wu/gpdb,edespino/gpdb,lisakowen/gpdb,lisakowen/gpdb,tangp3/gpdb,edespino/gpdb,Quikling/gpdb,tangp3/gpdb,rubikloud/gpdb,jmcatamney/gpdb,foyzur/gpdb,royc1/gpdb,greenplum-db/gpdb,xinzweb/gpdb,kaknikhil/gpdb,chrishajas/gpdb,jmcatamney/gpdb,rubikloud/gpdb,lintzc/gpdb,yuanzhao/gpdb,foyzur/gpdb,adam8157/gpdb,CraigHarris/gpdb,rvs/gpdb,ahachete/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,foyzur/gpdb,rubikloud/gpdb,lisakowen/gpdb,tangp3/gpdb,cjcjameson/gpdb,CraigHarris/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,zaksoup/gpdb,lisakowen/gpdb,lisakowen/gpdb,rubikloud/gpdb,janebeckman/gpdb,kaknikhil/gpdb,randomtask1155/gpdb,xuegang/gpdb,greenplum-db/gpdb,0x0FFF/gpdb,ashwinstar/gpdb,adam8157/gpdb,xuegang/gpdb,yuanzhao/gpdb,50wu/gpdb,yuanzhao/gpdb,janebeckman/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,chrishajas/gpdb,royc1/gpdb,CraigHarris/gpdb,edespino/gpdb,randomtask1155/gpdb,zaksoup/gpdb,xuegang/gpdb,rvs/gpdb,rvs/gpdb,Chibin/gpdb,rvs/gpdb,ashwinstar/gpdb,kaknikhil/gpdb,zaksoup/gpdb,0x0FFF/gpdb,adam8157/gpdb,xinzweb/gpdb,janebeckman/gpdb,cjcjameson/gpdb,lpetrov-pivotal/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,CraigHarris/gpdb,xuegang/gpdb,edespino/gpdb,lpetrov-pivotal/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,foyzur/gpdb,rvs/gpdb,lisakowen/gpdb,janebeckman/gpdb,lintzc/gpdb,adam8157/gpdb,chrishajas/gpdb,rvs/gpdb,kaknikhil/gpdb,edespino/gpdb,randomtask1155/gpdb,Chibin/gpdb,adam8157/gpdb,foyzur/gpdb,lpetrov-pivotal/gpdb,rubikloud/gpdb,yuanzhao/gpdb,royc1/gpdb,ahachete/gpdb,tangp3/gpdb,Quikling/gpdb,royc1/gpdb,50wu/gpdb,tangp3/gpdb,xuegang/gpdb,yuanzhao/gpdb,50wu/gpdb,ahachete/gpdb,xuegang/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,Chibin/gpdb,ashwinstar/gpdb,kaknikhil/gpdb,ashwinstar/gpdb,janebeckman/gpdb,rubikloud/gpdb,adam8157/gpdb,Chibin/gpdb,Chibin/gpdb,chrishajas/gpdb,randomtask1155/gpdb,xinzweb/gpdb,yuanzhao/gpdb
a911ff6cc87fa430dac4cbe0017633796907b839
src/test/resources/testmodule.c
src/test/resources/testmodule.c
#include "redismodule.h" #include <stdlib.h> int HelloworldRand_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { RedisModule_ReplyWithLongLong(ctx,rand()); return REDISMODULE_OK; } int RedisModule_OnLoad(RedisModuleCtx *ctx) { if (RedisModule_Init(ctx,"testmodule",1,REDISMODULE_APIVER_1) == REDISMODULE_ERR) return REDISMODULE_ERR; if (RedisModule_CreateCommand(ctx,"testmodule.simple", HelloworldRand_RedisCommand, "write deny-oom",1,2,1) == REDISMODULE_ERR) return REDISMODULE_ERR; }
#include "redismodule.h" #include <stdlib.h> int HelloworldRand_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { RedisModule_ReplyWithLongLong(ctx,rand()); return REDISMODULE_OK; } int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { if (RedisModule_Init(ctx,"testmodule",1,REDISMODULE_APIVER_1) == REDISMODULE_ERR) return REDISMODULE_ERR; if (RedisModule_CreateCommand(ctx,"testmodule.simple", HelloworldRand_RedisCommand, "readonly",0,0,0) == REDISMODULE_ERR) return REDISMODULE_ERR; }
Fix OnLoad signature and configure command parameters properly
Fix OnLoad signature and configure command parameters properly
C
mit
RedisLabs/jedis,HeartSaVioR/jedis,yapei123/jedis,sazzad16/jedis,mosoft521/jedis,mosoft521/jedis,HeartSaVioR/jedis,smagellan/jedis,sazzad16/jedis,zts1993/jedis,yapei123/jedis,smagellan/jedis,xetorthio/jedis,xetorthio/jedis,zts1993/jedis,RedisLabs/jedis
71db9767599b54ee8f8622bee2420daf78603dcf
arch/x86_64/rsp/vmov.c
arch/x86_64/rsp/vmov.c
// // arch/x86_64/rsp/vmov.c // // This file is subject to the terms and conditions defined in // 'LICENSE', which is part of this source code package. // #include "common.h" #include "rsp/cpu.h" #include "rsp/rsp.h" __m128i rsp_vmov(struct rsp *rsp, unsigned src, unsigned e, unsigned dest, unsigned de) { uint16_t data; // Get the element from VT. data = rsp->cp2.div_in = rsp->cp2.regs[src].e[e]; // Write out the upper part of the result. rsp->cp2.regs[dest].e[de] = data; return rsp_vect_load_unshuffled_operand(rsp->cp2.regs[dest].e); }
// // arch/x86_64/rsp/vmov.c // // This file is subject to the terms and conditions defined in // 'LICENSE', which is part of this source code package. // #include "common.h" #include "rsp/cpu.h" #include "rsp/rsp.h" __m128i rsp_vmov(struct rsp *rsp, unsigned src, unsigned e, unsigned dest, unsigned de) { uint16_t data; // Get the element from VT. data = rsp->cp2.regs[src].e[e]; // Write out the upper part of the result. rsp->cp2.regs[dest].e[de] = data; return rsp_vect_load_unshuffled_operand(rsp->cp2.regs[dest].e); }
Fix a typo in the VMOV implementation.
Fix a typo in the VMOV implementation.
C
bsd-3-clause
tj90241/cen64,LuigiBlood/cen64,tj90241/cen64,LuigiBlood/cen64
a2301921e37925bcc77fd2326249d13ff6a2792d
src/trm/ft_trmsignalhook.c
src/trm/ft_trmsignalhook.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_trmsignalhook.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: ncoden <ncoden@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/05/14 17:12:55 by ncoden #+# #+# */ /* Updated: 2015/05/18 16:04:52 by ncoden ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void ft_trmsignalhook(t_trm *trm, char sig, void (*func)(void *), void *data) { t_ilst_evnt *event; if ((event = (t_ilst_evnt *)ft_ilstpushfront__(sizeof(t_ilst_evnt), (t_ilst **)&trm->on_signal, sig))) { event->event.func = func; event->event.data = data; } }
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_trmsignalhook.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: ncoden <ncoden@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/05/14 17:12:55 by ncoden #+# #+# */ /* Updated: 2015/05/23 23:50:08 by ncoden ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void ft_trmsignalhook(t_trm *trm, char sig, void (*func)(void *), void *data) { t_ilst_evnt *event; if ((event = (t_ilst_evnt *)ft_ilstpush__(sizeof(t_ilst_evnt), (t_ilst **)&trm->on_signal, sig))) { event->event.func = func; event->event.data = data; } }
Change the ilst content (2)
Change the ilst content (2)
C
apache-2.0
ncoden/libft
c10dc660e2f20fa099f7186bf4867f685a398758
qt/database.h
qt/database.h
/* * Copyright (C) 2014 Matthias Klumpp <matthias@tenstral.net> * * Licensed under the GNU Lesser General Public License Version 2.1 * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 of the license, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DATABASE_H #define DATABASE_H #include <QtCore> #include "appstream-qt_global.h" #include "component.h" namespace Appstream { class DatabasePrivate; class ASQTSHARED_EXPORT Database : public QObject { Q_OBJECT public: Database(QObject *parent = 0); ~Database(); bool open(); Component* getComponentById(QString id); QList<Component*> getAllComponents(); QList<Component*> getComponentsByKind(Component::Kind kind); QList<Component*> findComponentsByString(QString searchTerms, QString categories = ""); private: DatabasePrivate *priv; }; } // End of namespace: Appstream #endif // DATABASE_H
/* * Copyright (C) 2014 Matthias Klumpp <matthias@tenstral.net> * * Licensed under the GNU Lesser General Public License Version 2.1 * * This library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 of the license, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DATABASE_H #define DATABASE_H #include <QtCore> #include "appstream-qt_global.h" #include "component.h" namespace Appstream { class DatabasePrivate; class ASQTSHARED_EXPORT Database : public QObject { Q_OBJECT public: Database(QObject *parent = 0); ~Database(); bool open(); Component* getComponentById(QString id); QList<Component*> getAllComponents(); QList<Component*> getComponentsByKind(Component::Kind kind); QList<Component*> findComponentsByString(QString searchTerms, QString categories = QString()); private: DatabasePrivate *priv; }; } // End of namespace: Appstream #endif // DATABASE_H
Use QString() as default paramater for an empty string
trivial: Use QString() as default paramater for an empty string
C
lgpl-2.1
ximion/appstream,ximion/appstream,ximion/appstream,ximion/appstream
31f9fa46901ed41ea21f43b1a05481112370e8f1
PaymentKit/PKCardNumber.h
PaymentKit/PKCardNumber.h
// // CardNumber.h // PKPayment Example // // Created by Alex MacCaw on 1/22/13. // Copyright (c) 2013 Stripe. All rights reserved. // #import <Foundation/Foundation.h> #import "PKCardType.h" @interface PKCardNumber : NSObject @property (nonatomic, readonly) PKCardType cardType; @property (nonatomic, readonly) NSString * last4; @property (nonatomic, readonly) NSString * lastGroup; @property (nonatomic, readonly) NSString * string; @property (nonatomic, readonly) NSString * formattedString; @property (nonatomic, readonly) NSString * formattedStringWithTrail; + (id) cardNumberWithString:(NSString *)string; - (id) initWithString:(NSString *)string; - (BOOL)isValid; - (BOOL)isValidLength; - (BOOL)isValidLuhn; - (BOOL)isPartiallyValid; @end
// // CardNumber.h // PKPayment Example // // Created by Alex MacCaw on 1/22/13. // Copyright (c) 2013 Stripe. All rights reserved. // #import <Foundation/Foundation.h> #import "PKCardType.h" @interface PKCardNumber : NSObject @property (nonatomic, readonly) PKCardType cardType; @property (nonatomic, readonly) NSString * last4; @property (nonatomic, readonly) NSString * lastGroup; @property (nonatomic, readonly) NSString * string; @property (nonatomic, readonly) NSString * formattedString; @property (nonatomic, readonly) NSString * formattedStringWithTrail; @property (nonatomic, readonly, getter = isValid) BOOL valid; @property (nonatomic, readonly, getter = isValidLength) BOOL validLength; @property (nonatomic, readonly, getter = isValidLuhn) BOOL validLuhn; @property (nonatomic, readonly, getter = isPartiallyValid) BOOL partiallyValid; + (id) cardNumberWithString:(NSString *)string; - (id) initWithString:(NSString *)string; @end
Make validity booleans properties as well
Make validity booleans properties as well
C
mit
onevcat/PaymentKit,loudnate/PaymentKit,tictail/TICPaymentKit,spinlister/PaymentKit,RidePal/PaymentKit,loudnate/PaymentKit,mobitar/PaymentKit,oanaBan/PaymentKit,jonathanrauch/PaymentKit,vikas100/Vikas,tictail/TICPaymentKit,jonathanrauch/PaymentKit,zsw12abc/PaymentKit,bobbyski/PaymentKit,stripe/PaymentKit,prolificinteractive/PaymentKit,ichu501/PaymentKit,andris-zalitis/PaymentKit,baoquanjing/newss,spinlister/PaymentKit,vikas100/Vikas,bobbyski/PaymentKit,Dwellers/PaymentKit,insanoid/PaymentKit,Dwellers/PaymentKit,mobitar/PaymentKit,baoquanjing/newss,RidePal/PaymentKit,triposo/PaymentKit,oanaBan/PaymentKit,zsw12abc/PaymentKit,ernestopino/PaymentKit,ernestopino/PaymentKit,andris-zalitis/PaymentKit,heetch/PaymentKit,heetch/PaymentKit
3c2fc5241d63758ffd4e4c072df9742c8dda3595
chrome/gpu/gpu_config.h
chrome/gpu/gpu_config.h
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_GPU_GPU_CONFIG_H_ #define CHROME_GPU_GPU_CONFIG_H_ // This file declares common preprocessor configuration for the GPU process. #include "build/build_config.h" #if defined(OS_LINUX) && !defined(ARCH_CPU_X86) // Only define GLX support for Intel CPUs for now until we can get the // proper dependencies and build setup for ARM. #define GPU_USE_GLX #endif #endif // CHROME_GPU_GPU_CONFIG_H_
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_GPU_GPU_CONFIG_H_ #define CHROME_GPU_GPU_CONFIG_H_ // This file declares common preprocessor configuration for the GPU process. #include "build/build_config.h" #if defined(OS_LINUX) && defined(ARCH_CPU_X86) // Only define GLX support for Intel CPUs for now until we can get the // proper dependencies and build setup for ARM. #define GPU_USE_GLX #endif #endif // CHROME_GPU_GPU_CONFIG_H_
Fix stupid error for Linux build.
Fix stupid error for Linux build. TEST=none BUG=none Review URL: http://codereview.chromium.org/555096 git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@37093 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
C
bsd-3-clause
wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser
4f81bce800c91bf0676cdff4267ce474d88ebf5a
OpenAL32/Include/alThunk.h
OpenAL32/Include/alThunk.h
#ifndef _AL_THUNK_H_ #define _AL_THUNK_H_ #include "config.h" #include "AL/al.h" #include "AL/alc.h" #ifdef __cplusplus extern "C" { #endif void alThunkInit(void); void alThunkExit(void); ALuint alThunkAddEntry(ALvoid * ptr); void alThunkRemoveEntry(ALuint index); ALvoid *alThunkLookupEntry(ALuint index); #if (SIZEOF_VOIDP > SIZEOF_UINT) #define ALTHUNK_INIT() alThunkInit() #define ALTHUNK_EXIT() alThunkExit() #define ALTHUNK_ADDENTRY(p) alThunkAddEntry(p) #define ALTHUNK_REMOVEENTRY(i) alThunkRemoveEntry(i) #define ALTHUNK_LOOKUPENTRY(i) alThunkLookupEntry(i) #else #define ALTHUNK_INIT() #define ALTHUNK_EXIT() #define ALTHUNK_ADDENTRY(p) ((ALuint)p) #define ALTHUNK_REMOVEENTRY(i) #define ALTHUNK_LOOKUPENTRY(i) ((ALvoid*)(i)) #endif // (SIZEOF_VOIDP > SIZEOF_INT) #ifdef __cplusplus } #endif #endif //_AL_THUNK_H_
#ifndef _AL_THUNK_H_ #define _AL_THUNK_H_ #include "config.h" #include "AL/al.h" #include "AL/alc.h" #ifdef __cplusplus extern "C" { #endif void alThunkInit(void); void alThunkExit(void); ALuint alThunkAddEntry(ALvoid *ptr); void alThunkRemoveEntry(ALuint index); ALvoid *alThunkLookupEntry(ALuint index); #if (SIZEOF_VOIDP > SIZEOF_UINT) #define ALTHUNK_INIT() alThunkInit() #define ALTHUNK_EXIT() alThunkExit() #define ALTHUNK_ADDENTRY(p) alThunkAddEntry(p) #define ALTHUNK_REMOVEENTRY(i) alThunkRemoveEntry(i) #define ALTHUNK_LOOKUPENTRY(i) alThunkLookupEntry(i) #else #define ALTHUNK_INIT() #define ALTHUNK_EXIT() #define ALTHUNK_ADDENTRY(p) ((ALuint)p) #define ALTHUNK_REMOVEENTRY(i) ((ALvoid)i) #define ALTHUNK_LOOKUPENTRY(i) ((ALvoid*)(i)) #endif // (SIZEOF_VOIDP > SIZEOF_INT) #ifdef __cplusplus } #endif #endif //_AL_THUNK_H_
Improve a macro to reference its parameter
Improve a macro to reference its parameter
C
lgpl-2.1
alexxvk/openal-soft,Wemersive/openal-soft,soundsrc/openal-soft,aaronmjacobs/openal-soft,EddieRingle/openal-soft,aaronmjacobs/openal-soft,mmozeiko/OpenAL-Soft,mmozeiko/OpenAL-Soft,AerialX/openal-soft-android,irungentoo/openal-soft-tox,arkana-fts/openal-soft,soundsrc/openal-soft,EddieRingle/openal-soft,BeamNG/openal-soft,rryan/openal-soft,jims/openal-soft,alexxvk/openal-soft,rryan/openal-soft,cambridgehackers/klaatu-openal-soft,arkana-fts/openal-soft,irungentoo/openal-soft-tox,franklixuefei/openal-soft,cambridgehackers/klaatu-openal-soft,dapetcu21/openal-soft,jims/openal-soft,cambridgehackers/klaatu-openal-soft,BeamNG/openal-soft,Wemersive/openal-soft,franklixuefei/openal-soft
e8323b47a5feb3aad3dc68e1cce892808391ca57
roofit/histfactory/inc/RooStats/HistFactory/HistFactoryException.h
roofit/histfactory/inc/RooStats/HistFactory/HistFactoryException.h
// @(#)root/roostats:$Id$ // Author: George Lewis, Kyle Cranmer /************************************************************************* * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef HISTFACTORY_EXCEPTION #define HISTFACTORY_EXCEPTION #include <iostream> #include <exception> namespace RooStats{ namespace HistFactory{ class hf_exc: public std::exception { virtual const char* what() const noexcept { return "HistFactory - Exception"; } }; } } //static hf_exc bad_hf; #endif
// @(#)root/roostats:$Id$ // Author: George Lewis, Kyle Cranmer /************************************************************************* * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef HISTFACTORY_EXCEPTION #define HISTFACTORY_EXCEPTION #include <exception> #include <string> namespace RooStats{ namespace HistFactory{ class hf_exc: public std::exception { public: hf_exc(std::string message = "") : _message("HistFactory - Exception " + message) { } virtual const char* what() const noexcept { return _message.c_str(); } private: const std::string _message; }; } } #endif
Allow for messages in HistFactory exceptions.
[HF] Allow for messages in HistFactory exceptions.
C
lgpl-2.1
olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root
e5666f371e863ac73d8fa7c15bef9c9ba0359b82
draft/zmq42draft.h
draft/zmq42draft.h
#if ZMQ_VERSION_MINOR == 2 #ifdef ZMQ_BUILD_DRAFT_API #define ZMQ42HASDRAFT #endif #endif #ifndef ZMQ42HASDRAFT #define ZMQ_SERVER -12 #define ZMQ_CLIENT -13 #define ZMQ_RADIO -14 #define ZMQ_DISH -15 #define ZMQ_GATHER -16 #define ZMQ_SCATTER -17 #define ZMQ_DGRAM -18 #endif
#if ZMQ_VERSION_MINOR >= 2 #ifdef ZMQ_BUILD_DRAFT_API #define ZMQ42HASDRAFT #endif #endif #ifndef ZMQ42HASDRAFT #define ZMQ_SERVER -12 #define ZMQ_CLIENT -13 #define ZMQ_RADIO -14 #define ZMQ_DISH -15 #define ZMQ_GATHER -16 #define ZMQ_SCATTER -17 #define ZMQ_DGRAM -18 #endif
Make draft compile with ZeroMQ 4.3.0
Make draft compile with ZeroMQ 4.3.0
C
bsd-2-clause
pebbe/zmq4,pebbe/zmq4
a804609334035658ed74f5e0664dd4c380e68955
bin/src/hr.c
bin/src/hr.c
/**************************************************\ * A port of LuRsT's hr to C * * Sam Stuewe (C) 2014 Licensed under the terms of * * the GNU Public License version 2 * \**************************************************/ // Libraries // #include <stdio.h> #include <string.h> #include <sys/ioctl.h> // Main Function // int main (int argc, char * * argv) { struct winsize w; ioctl(0, TIOCGWINSZ, &w); int COLS; if ( w.ws_col <= 0 ) { COLS = 80; } else { COLS = w.ws_col; } if ( argc <= 1 ) { for ( int i = 0; i < COLS; i ++ ) { printf("#"); } printf("\n"); } else { for ( int i = 1; i < argc; i ++ ) { for ( int j = 0; j < (COLS/strlen(argv[i])); j ++ ) { printf(argv[i]); } printf("\n"); } } return 0; } // vim: set tabstop=4 shiftwidth=4 expandtab:
/**************************************************\ * A port of LuRsT's hr to C * * Sam Stuewe (C) 2014 Licensed under the terms of * * the GNU Public License version 2 * \**************************************************/ // Libraries // #include <stdio.h> #include <string.h> #include <sys/ioctl.h> // Main Function // int main (int argc, char * argv []) { struct winsize w; ioctl(0, TIOCGWINSZ, &w); int COLS = ( w.ws_col <= 0 ? 80 : w.ws_col); if ( argc <= 1 ) { for ( int i = 0; i < COLS; i ++ ) { printf("#"); } printf("\n"); } else { for ( int i = 1; i < argc; i ++ ) { for ( int j = 0; j < (COLS/strlen(argv[i])); j ++ ) { printf(argv[i]); } printf("\n"); } } return 0; } // vim: set tabstop=4 shiftwidth=4 expandtab:
Update for style and simplicity
Update for style and simplicity
C
unlicense
HalosGhost/.dotfiles,HalosGhost/.dotfiles
1f561bba70d0746f0b474f39fad689ae7d678517
arch/sgi/include/vmparam.h
arch/sgi/include/vmparam.h
/* $OpenBSD: vmparam.h,v 1.3 2009/05/08 18:42:04 miod Exp $ */ #ifndef _SGI_VMPARAM_H_ #define _SGI_VMPARAM_H_ #define VM_PHYSSEG_MAX 32 /* Max number of physical memory segments */ #define VM_NFREELIST 2 #define VM_FREELIST_DMA32 1 /* memory under 2GB suitable for DMA */ #include <mips64/vmparam.h> #endif /* _SGI_VMPARAM_H_ */
/* $OpenBSD: vmparam.h,v 1.4 2009/10/14 20:18:26 miod Exp $ */ /* public domain */ #ifndef _SGI_VMPARAM_H_ #define _SGI_VMPARAM_H_ #define VM_PHYSSEG_MAX 32 /* Max number of physical memory segments */ /* * On Origin and Octane families, DMA to 32-bit PCI devices is restricted. * * Systems with physical memory after the 2GB boundary needs to ensure * memory which may used for DMA transfers is allocated from the low * memory range. * * Other systems, like the O2, do not have such a restriction, but can not * have more than 2GB of physical memory, so this doesn't affect them. */ #define VM_NFREELIST 2 #define VM_FREELIST_DMA32 1 /* memory suitable for 32-bit DMA */ #include <mips64/vmparam.h> #endif /* _SGI_VMPARAM_H_ */
Add some comments to explain why the DMA32 physseg is really 2**31 bytes long. Prompted by deraadt@ long ago.
Add some comments to explain why the DMA32 physseg is really 2**31 bytes long. Prompted by deraadt@ long ago.
C
isc
orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars
64cdc50fbcc47cbcb957111ff6637e65c5b5f525
config.def.h
config.def.h
/* See LICENSE file for copyright and license details. */ /* Notification, remove DNOTIFY in config.mk if you don't want it */ static char *notifycmd = ""; /* Uses given command if not compiled by DNOTIFY */ static char *notifyext = ""; /* Notify with extra command (eg. play an alarm) */ /* * This is the array which defines all the timer that will be used. * It will be repeated after all of it is executed. */ static Timers timers[] = { /* timer(s) comment */ { 1500, "Time to start working!"}, { 300, "Time to start resting!"}, { 1500, "Time to start working!"}, { 300, "Time to start resting!"}, { 1500, "Time to start working!"}, { 300, "Time to start resting!"}, { 1500, "Time to start working!"}, { 1200, "Time to take a nap!" }, };
/* See LICENSE file for copyright and license details. */ /* Notification, remove DNOTIFY in config.mk if you don't want it */ static char *notifycmd = ""; /* Uses given command if not compiled by DNOTIFY */ static char *notifyext = ""; /* Notify with extra command (eg. play an alarm) */ /* * This is the array which defines all the timer that will be used. * It will be repeated after all of it is executed. */ static Timers timers[] = { /* timer(s) comment */ { 1500, "Time to start working!"}, { 300, "Time to start resting!"}, { 1500, "Time to start working!"}, { 300, "Time to start resting!"}, { 1500, "Time to start working!"}, { 300, "Time to start resting!"}, { 1500, "Time to start working!"}, { 900, "Time to take a nap!" }, };
Reduce nap time to 15 minutes as mentioned in docs
Reduce nap time to 15 minutes as mentioned in docs
C
isc
pickfire/spt,pickfire/spt
a71d3c65375114146bb515b31820c5bf5d670128
test/CodeGen/builtins-arm.c
test/CodeGen/builtins-arm.c
// RUN: %clang_cc1 -triple thumbv7-eabi -target-cpu cortex-a8 -O3 -emit-llvm -o %t %s void *f0() { return __builtin_thread_pointer(); }
// RUN: %clang_cc1 -Wall -Werror -triple thumbv7-eabi -target-cpu cortex-a8 -O3 -emit-llvm -o - %s | FileCheck %s void *f0() { return __builtin_thread_pointer(); } void f1(char *a, char *b) { __clear_cache(a,b); } // CHECK: call void @__clear_cache
Add a test to the previous commit.
Add a test to the previous commit. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@105596 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
28bfcfabf1185f197c49f21abc4b71629cfebcec
test/test_parser_terminal.c
test/test_parser_terminal.c
#include "test_parser_p.h" void terminal_success(void **state) { grammar_t *grammar = grammar_init( non_terminal("HelloWorld"), rule_init("HelloWorld", terminal("hello world") ), 1 ); parse_t *result = parse("hello world", grammar); assert_int_equal(result->length, 11); assert_int_equal(result->start, 0); assert_int_equal(result->n_children, 1); assert_int_equal(result->children[0].n_children, 0); } void terminal_failure(void **state) { grammar_t *grammar = grammar_init( non_terminal("HelloWorld"), rule_init("HelloWorld", terminal("hello world") ), 1 ); parse_t *result = parse("nope", grammar); assert_null(result); }
#include "test_parser_p.h" void terminal_success(void **state) { grammar_t *grammar = grammar_init( non_terminal("HelloWorld"), rule_init("HelloWorld", terminal("hello world") ), 1 ); parse_result_t *result = parse("hello world", grammar); assert_non_null(result); assert_true(is_success(result)); parse_t *suc = result->data.result; assert_int_equal(suc->length, 11); assert_int_equal(suc->start, 0); assert_int_equal(suc->n_children, 1); assert_int_equal(suc->children[0].n_children, 0); } void terminal_failure(void **state) { grammar_t *grammar = grammar_init( non_terminal("HelloWorld"), rule_init("HelloWorld", terminal("hello world") ), 1 ); parse_result_t *result = parse("nope", grammar); assert_non_null(result); assert_true(is_error(result)); }
Use new api for terminal tests
Use new api for terminal tests
C
mit
Baltoli/peggo,Baltoli/peggo
771cb01c0311688f00593cc2a309e32afdbd4b40
benchmark/timer.h
benchmark/timer.h
#include <time.h> clock_t calc_time0,calc_time1; double calc_time; #define TIME_ON calc_time0=clock(); #define TIME_OFF(msg) calc_time1=clock(); \ calc_time=(double)(calc_time1-calc_time0)/CLOCKS_PER_SEC; \ std::cout<<msg<<": iterations="<<i \ <<" CPU Time="<<std::fixed<<calc_time \ <<" iter/s="<<i/calc_time<<std::endl<<std::flush;
#include <time.h> #include <sstream> #include <iostream> clock_t calc_time0,calc_time1; double calc_time; void printTime(const std::string& msg, long long iterations, double iterPerSec) { std::stringstream ss; ss << msg; while (ss.tellp() < 30) { ss << ' '; } ss << " iterations=" << iterations; while (ss.tellp() < 60) { ss << ' '; } ss <<" CPU Time="<<std::fixed<<calc_time; while (ss.tellp() < 80) { ss << ' '; } ss <<" iter/s="<<iterPerSec<<std::endl; std::cout << ss.str() << std::flush; } #define TIME_ON calc_time0=clock(); #define TIME_OFF(msg) calc_time1=clock(); \ calc_time=(double)(calc_time1-calc_time0)/CLOCKS_PER_SEC; \ printTime(msg, i, i/calc_time);
Print times in fixed columns.
Print times in fixed columns. Makes it easier to compare.
C
lgpl-2.1
worldforge/atlas-cpp,worldforge/atlas-cpp,worldforge/atlas-cpp,worldforge/atlas-cpp,worldforge/atlas-cpp,worldforge/atlas-cpp
6c39b5e3015535d249699cf4c7dd9e3bfa9ed550
check/tests/check_check_main.c
check/tests/check_check_main.c
#include <stdlib.h> #include <stdio.h> #include <check.h> #include "check_check.h" int main (void) { int n; SRunner *sr; fork_setup(); setup_fixture(); sr = srunner_create (make_master_suite()); srunner_add_suite(sr, make_list_suite()); srunner_add_suite(sr, make_msg_suite()); srunner_add_suite(sr, make_log_suite()); srunner_add_suite(sr, make_limit_suite()); srunner_add_suite(sr, make_fork_suite()); srunner_add_suite(sr, make_fixture_suite()); srunner_add_suite(sr, make_pack_suite()); setup(); printf ("Ran %d tests in subordinate suite\n", sub_nfailed); srunner_run_all (sr, CK_NORMAL); cleanup(); fork_teardown(); teardown_fixture(); n = srunner_ntests_failed(sr); srunner_free(sr); return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
#include <stdlib.h> #include <stdio.h> #include <check.h> #include "check_check.h" int main (void) { int n; SRunner *sr; fork_setup(); setup_fixture(); sr = srunner_create (make_master_suite()); srunner_add_suite(sr, make_list_suite()); srunner_add_suite(sr, make_msg_suite()); srunner_add_suite(sr, make_log_suite()); srunner_add_suite(sr, make_limit_suite()); srunner_add_suite(sr, make_fork_suite()); srunner_add_suite(sr, make_fixture_suite()); srunner_add_suite(sr, make_pack_suite()); setup(); printf ("Ran %d tests in subordinate suite\n", sub_ntests); srunner_run_all (sr, CK_NORMAL); cleanup(); fork_teardown(); teardown_fixture(); n = srunner_ntests_failed(sr); srunner_free(sr); return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
Use correct variable for number of tests
Use correct variable for number of tests git-svn-id: caee63afe878fe2ec7dbba394a86c9654d9110ca@230 64e312b2-a51f-0410-8e61-82d0ca0eb02a
C
lgpl-2.1
dashaomai/check-code,dashaomai/check-code,svn2github/check,svn2github/check,svn2github/check,dashaomai/check-code,svn2github/check,dashaomai/check-code,svn2github/check
a0b563f277f4fe56bc8af372777301d20c5a419b
src/main.h
src/main.h
#ifndef _MAIN_H_ #define _MAIN_H_ #define PROGRAM_MAJOR_VERSION 0 #define PROGRAM_MINOR_VERSION 1 #define PROGRAM_PATCH_VERSION 1 extern int quit; #endif /* _MAIN_H_ */
#ifndef _MAIN_H_ #define _MAIN_H_ #define PROGRAM_MAJOR_VERSION 0 #define PROGRAM_MINOR_VERSION 2 #define PROGRAM_PATCH_VERSION 0 extern int quit; #endif /* _MAIN_H_ */
Upgrade version number to 0.2.0
Upgrade version number to 0.2.0
C
mit
zear/shisen-seki,zear/shisen-seki
e6bba5feec294deb762bba5b53f6b0440ff81cd7
strsplit.h
strsplit.h
#ifndef __STR_SPLIT_H__ #define __STR_SPLIT_H__ 1 #include <stdlib.h> #include <string.h> int strsplit (char *str, char *parts[], char *delimiter) { char *pch; int i = 0; pch = strtok(str, delimiter); parts[i++] = strdup(pch); while (pch) { pch = strtok(NULL, delimiter); if (NULL == pch) break; parts[i++] = strdup(pch); } free(pch); return i; } #endif
#ifndef __STR_SPLIT_H__ #define __STR_SPLIT_H__ 1 #include <stdlib.h> #include <string.h> int strsplit (char *str, char *parts[], char *delimiter) { char *pch; int i = 0; char *tmp = strdup(str); pch = strtok(tmp, delimiter); parts[i++] = strdup(pch); while (pch) { pch = strtok(NULL, delimiter); if (NULL == pch) break; parts[i++] = strdup(pch); } free(tmp); free(pch); return i; } #endif
Fix bad results when compiling with Apple’s LLVM 5
Fix bad results when compiling with Apple’s LLVM 5
C
mit
jwerle/strsplit.c
ae49b56c52847aadda7be62071dcb33b5c22e6eb
Test/src/minunit.h
Test/src/minunit.h
/* * minunit.h * * Source: http://www.jera.com/techinfo/jtns/jtn002.html */ #include <stdio.h> extern int tests_run; #define mu_assert(message, test) do { \ if (!(test)) { \ return message; \ } \ } while (0) #define mu_run_test(test, name) do { \ test_head(name); \ char const * message = test(); \ tests_run++; \ if (message) { \ test_failure; \ printf(" * %s\n", message); \ } else { \ test_success; \ } \ } while (0) #define test_head(name) printf("Test %s... ", name) #define test_success printf("[OK]\n") #define test_failure printf("[FAIL]\n")
/* * minunit.h * * Source: http://www.jera.com/techinfo/jtns/jtn002.html */ #include <stdio.h> extern int tests_run; #define mu_assert(message, test) do { \ if (!(test)) { \ return message; \ } \ } while (0) #define mu_run_test(test, name) do { \ printf("Test %s... ", name); \ char const * message = test(); \ tests_run++; \ if (message) { \ if (message[0] != '\0') { \ printf("[FAIL]\n * %s\n", message); \ } else { \ printf("[OK]\n"); \ } \ } else { \ printf("\n"); \ } \ } while (0)
Remove useless unit testing definitions.
Remove useless unit testing definitions.
C
mit
AymericGenet/SPHINCS-arduinodue,AymericGenet/SPHINCS-arduinodue,AymericGenet/SPHINCS-arduinodue
bd339f71c7a5a3e2b883f4306689c8bc39077895
test/CodeGen/ext-vector-shuffle.c
test/CodeGen/ext-vector-shuffle.c
// RUN: clang-cc %s -emit-llvm -o - | not grep 'extractelement' && // RUN: clang-cc %s -emit-llvm -o - | not grep 'insertelement' && // RUN: clang-cc %s -emit-llvm -o - | grep 'shufflevector' typedef __attribute__(( ext_vector_type(2) )) float float2; typedef __attribute__(( ext_vector_type(4) )) float float4; float2 test1(float4 V) { return V.xy + V.wz; } float4 test2(float4 V) { float2 W = V.ww; return W.xyxy + W.yxyx; }
// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'extractelement' && // RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'insertelement' && // RUN: clang-cc %s -x cl -emit-llvm -o - | grep 'shufflevector' typedef __attribute__(( ext_vector_type(2) )) float float2; typedef __attribute__(( ext_vector_type(4) )) float float4; float2 test1(float4 V) { return V.xy + V.wz; } float4 test2(float4 V) { float2 W = V.ww; return W.xyxy + W.yxyx; } float4 test3(float4 V1, float4 V2) { return (float4)(V1.zw, V2.xy); }
Add test for OpenCL vector initializer codegen
Add test for OpenCL vector initializer codegen git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@84445 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
93121c92ab02651020f862d5ccc94d63bc3dda00
src/zopfli/hash.c
src/zopfli/hash.c
/* Copyright 2011 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Author: lode.vandevenne@gmail.com (Lode Vandevenne) Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala) */ #include "hash.h" #include <assert.h> #include <stdio.h> #include <stdlib.h> #define HASH_SHIFT 5 #define HASH_MASK 32767 extern ZopfliHash* ZopfliInitHash(size_t window_size); extern void ZopfliResetHash(size_t window_size, ZopfliHash* h); extern void ZopfliCleanHash(ZopfliHash* h); extern void ZopfliUpdateHash(const unsigned char* array, size_t pos, size_t end, ZopfliHash* h); extern void ZopfliWarmupHash(const unsigned char* array, size_t pos, size_t end, ZopfliHash* h);
/* Copyright 2011 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Author: lode.vandevenne@gmail.com (Lode Vandevenne) Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala) */ #include "hash.h" #include <assert.h> #include <stdio.h> #include <stdlib.h> #define HASH_SHIFT 5 #define HASH_MASK 32767 extern ZopfliHash* ZopfliInitHash(size_t window_size); extern void ZopfliResetHash(size_t window_size, ZopfliHash* h); extern void ZopfliCleanHash(ZopfliHash* h); extern void ZopfliUpdateHash(const unsigned char* array, size_t pos, size_t end, ZopfliHash* h); extern void ZopfliWarmupHash(const unsigned char* array, size_t pos, size_t end, ZopfliHash* h);
Remove a temporary fn that never got used
Remove a temporary fn that never got used
C
apache-2.0
carols10cents/zopfli,carols10cents/zopfli
e1399dfc55b246db94616bb0052c565a45300710
tests/escape/proper-escapes/local-phi-to-global-field.c
tests/escape/proper-escapes/local-phi-to-global-field.c
struct S { int *x; int *y; }; struct S s; void addrOfEscape2(int * i1, int * i2, int x) { int * p = i2; if(x > 10) p = i1; s.y = p; }
struct S { int *x; int *y; }; struct S *s; void addrOfEscape2(int * i1, int * i2, int x) { int * p = i2; if(x > 10) p = i1; s->y = p; }
Modify a test to avoid constant GEPs
Modify a test to avoid constant GEPs
C
bsd-3-clause
travitch/foreign-inference,travitch/foreign-inference
eb66fff7d94199f80378bc0b51a06e62ce379b53
drivers/scsi/lpfc/lpfc_version.h
drivers/scsi/lpfc/lpfc_version.h
/******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * * Copyright (C) 2004-2005 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of version 2 of the GNU General * * Public License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful. * * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * * TO BE LEGALLY INVALID. See the GNU General Public License for * * more details, a copy of which can be found in the file COPYING * * included with this package. * *******************************************************************/ #define LPFC_DRIVER_VERSION "8.0.30" #define LPFC_DRIVER_NAME "lpfc" #define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \ LPFC_DRIVER_VERSION #define LPFC_COPYRIGHT "Copyright(c) 2004-2005 Emulex. All rights reserved." #define DFC_API_VERSION "0.0.0"
/******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * * Copyright (C) 2004-2005 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of version 2 of the GNU General * * Public License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful. * * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * * TO BE LEGALLY INVALID. See the GNU General Public License for * * more details, a copy of which can be found in the file COPYING * * included with this package. * *******************************************************************/ #define LPFC_DRIVER_VERSION "8.1.0" #define LPFC_DRIVER_NAME "lpfc" #define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \ LPFC_DRIVER_VERSION #define LPFC_COPYRIGHT "Copyright(c) 2004-2005 Emulex. All rights reserved." #define DFC_API_VERSION "0.0.0"
Change version number to 8.1.0
[SCSI] lpfc: Change version number to 8.1.0 Signed-off-by: James Smart <662b34f26b29c45c7ee4f84b6fca46f06a668477@emulex.com> Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@SteelEye.com>
C
mit
KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
54f611f3c5f8c89b8556fe347525a1dfea222095
src/modules/conf_randr/e_smart_monitor.h
src/modules/conf_randr/e_smart_monitor.h
#ifdef E_TYPEDEFS #else # ifndef E_SMART_MONITOR_H # define E_SMART_MONITOR_H Evas_Object *e_smart_monitor_add(Evas *evas); void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch); void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Randr_Output output); void e_smart_monitor_grid_set(Evas_Object *obj, Evas_Object *grid, Evas_Coord gx, Evas_Coord gy, Evas_Coord gw, Evas_Coord gh); void e_smart_monitor_grid_virtual_size_set(Evas_Object *obj, Evas_Coord vw, Evas_Coord vh); void e_smart_monitor_background_set(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy); void e_smart_monitor_current_geometry_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); # endif #endif
#ifdef E_TYPEDEFS #else # ifndef E_SMART_MONITOR_H # define E_SMART_MONITOR_H Evas_Object *e_smart_monitor_add(Evas *evas); void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch); Ecore_X_Randr_Crtc e_smart_monitor_crtc_get(Evas_Object *obj); void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Randr_Output output); void e_smart_monitor_grid_set(Evas_Object *obj, Evas_Object *grid, Evas_Coord gx, Evas_Coord gy, Evas_Coord gw, Evas_Coord gh); void e_smart_monitor_grid_virtual_size_set(Evas_Object *obj, Evas_Coord vw, Evas_Coord vh); void e_smart_monitor_background_set(Evas_Object *obj, Evas_Coord dx, Evas_Coord dy); void e_smart_monitor_current_geometry_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); void e_smart_monitor_clone_set(Evas_Object *obj, Evas_Object *parent); # endif #endif
Add function prototype for monitor clone set.
Add function prototype for monitor clone set. Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 84208
C
bsd-2-clause
tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,tasn/enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment,rvandegrift/e,rvandegrift/e,tizenorg/platform.upstream.enlightenment,tizenorg/platform.upstream.enlightenment,tasn/enlightenment
eb0fa7bf4c9d8d24ee597e8777fee446ac55c35b
numba/npyufunc/gufunc_scheduler.h
numba/npyufunc/gufunc_scheduler.h
#ifndef GUFUNC_SCHEDULER #define GUFUNC_SCHEDULER #include <stdint.h> #ifndef __SIZEOF_POINTER__ /* MSVC doesn't define __SIZEOF_POINTER__ */ #if defined(_WIN64) #define intp int64_t #define uintp uint64_t #elif defined(_WIN32) #define intp int #define uintp unsigned #else #error "cannot determine size of intp" #endif #elif __SIZEOF_POINTER__ == 8 #define intp int64_t #define uintp uint64_t #else #define intp int #define uintp unsigned #endif #ifdef __cplusplus extern "C" { #endif void do_scheduling(intp num_dim, intp *dims, uintp num_threads, intp *sched, intp debug); #ifdef __cplusplus } #endif #endif
#ifndef GUFUNC_SCHEDULER #define GUFUNC_SCHEDULER /* define int64_t and uint64_t for VC9 */ #ifdef _MSC_VER #define int64_t signed __int64 #define uint64_t unsigned __int64 #else #include <stdint.h> #endif #ifndef __SIZEOF_POINTER__ /* MSVC doesn't define __SIZEOF_POINTER__ */ #if defined(_WIN64) #define intp int64_t #define uintp uint64_t #elif defined(_WIN32) #define intp int #define uintp unsigned #else #error "cannot determine size of intp" #endif #elif __SIZEOF_POINTER__ == 8 #define intp int64_t #define uintp uint64_t #else #define intp int #define uintp unsigned #endif #ifdef __cplusplus extern "C" { #endif void do_scheduling(intp num_dim, intp *dims, uintp num_threads, intp *sched, intp debug); #ifdef __cplusplus } #endif #endif
Fix missing stdint.h on py2.7 vc9
Fix missing stdint.h on py2.7 vc9
C
bsd-2-clause
stonebig/numba,numba/numba,cpcloud/numba,cpcloud/numba,stuartarchibald/numba,gmarkall/numba,seibert/numba,sklam/numba,seibert/numba,sklam/numba,stuartarchibald/numba,jriehl/numba,seibert/numba,jriehl/numba,gmarkall/numba,sklam/numba,IntelLabs/numba,stuartarchibald/numba,stonebig/numba,numba/numba,numba/numba,gmarkall/numba,stuartarchibald/numba,seibert/numba,sklam/numba,gmarkall/numba,stonebig/numba,cpcloud/numba,stonebig/numba,gmarkall/numba,numba/numba,cpcloud/numba,jriehl/numba,stonebig/numba,sklam/numba,IntelLabs/numba,IntelLabs/numba,seibert/numba,cpcloud/numba,numba/numba,IntelLabs/numba,jriehl/numba,jriehl/numba,IntelLabs/numba,stuartarchibald/numba
9f07c8bcc8f4596d39b31f3515b54c5405f663da
JavaScriptCore/wtf/unicode/Unicode.h
JavaScriptCore/wtf/unicode/Unicode.h
// -*- c-basic-offset: 2 -*- /* * This file is part of the KDE libraries * Copyright (C) 2006 George Staikos <staikos@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KJS_UNICODE_H #define KJS_UNICODE_H #include <wtf/Platform.h> #if USE(QT4_UNICODE) #include "qt4/UnicodeQt4.h" #elif USE(ICU_UNICODE) #include <wtf/icu/UnicodeIcu.h> #else #error "Unknown Unicode implementation" #endif #endif // vim: ts=2 sw=2 et
// -*- c-basic-offset: 2 -*- /* * This file is part of the KDE libraries * Copyright (C) 2006 George Staikos <staikos@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KJS_UNICODE_H #define KJS_UNICODE_H #include <wtf/Platform.h> #if USE(QT4_UNICODE) #include "qt4/UnicodeQt4.h" #elif USE(ICU_UNICODE) #include <wtf/unicode/icu/UnicodeIcu.h> #else #error "Unknown Unicode implementation" #endif #endif // vim: ts=2 sw=2 et
Fix mac bustage (more still).
Fix mac bustage (more still). git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@18103 bbb929c8-8fbe-4397-9dbb-9b2b20218538
C
bsd-3-clause
Bysmyyr/blink-crosswalk,smishenk/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,nwjs/blink,smishenk/blink-crosswalk,Pluto-tv/blink-crosswalk,XiaosongWei/blink-crosswalk,modulexcite/blink,kurli/blink-crosswalk,kurli/blink-crosswalk,Bysmyyr/blink-crosswalk,kurli/blink-crosswalk,Pluto-tv/blink-crosswalk,nwjs/blink,hgl888/blink-crosswalk-efl,smishenk/blink-crosswalk,kurli/blink-crosswalk,Pluto-tv/blink-crosswalk,nwjs/blink,ondra-novak/blink,nwjs/blink,crosswalk-project/blink-crosswalk-efl,XiaosongWei/blink-crosswalk,jtg-gg/blink,smishenk/blink-crosswalk,Bysmyyr/blink-crosswalk,ondra-novak/blink,modulexcite/blink,PeterWangIntel/blink-crosswalk,Bysmyyr/blink-crosswalk,nwjs/blink,Pluto-tv/blink-crosswalk,Bysmyyr/blink-crosswalk,PeterWangIntel/blink-crosswalk,smishenk/blink-crosswalk,ondra-novak/blink,PeterWangIntel/blink-crosswalk,nwjs/blink,ondra-novak/blink,crosswalk-project/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,Pluto-tv/blink-crosswalk,hgl888/blink-crosswalk-efl,modulexcite/blink,XiaosongWei/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,ondra-novak/blink,PeterWangIntel/blink-crosswalk,Pluto-tv/blink-crosswalk,XiaosongWei/blink-crosswalk,PeterWangIntel/blink-crosswalk,Pluto-tv/blink-crosswalk,kurli/blink-crosswalk,jtg-gg/blink,modulexcite/blink,PeterWangIntel/blink-crosswalk,Bysmyyr/blink-crosswalk,hgl888/blink-crosswalk-efl,PeterWangIntel/blink-crosswalk,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,jtg-gg/blink,crosswalk-project/blink-crosswalk-efl,ondra-novak/blink,Pluto-tv/blink-crosswalk,jtg-gg/blink,modulexcite/blink,kurli/blink-crosswalk,hgl888/blink-crosswalk-efl,modulexcite/blink,kurli/blink-crosswalk,smishenk/blink-crosswalk,XiaosongWei/blink-crosswalk,nwjs/blink,jtg-gg/blink,nwjs/blink,ondra-novak/blink,PeterWangIntel/blink-crosswalk,PeterWangIntel/blink-crosswalk,Pluto-tv/blink-crosswalk,kurli/blink-crosswalk,Bysmyyr/blink-crosswalk,modulexcite/blink,smishenk/blink-crosswalk,smishenk/blink-crosswalk,hgl888/blink-crosswalk-efl,smishenk/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,Bysmyyr/blink-crosswalk,jtg-gg/blink,crosswalk-project/blink-crosswalk-efl,crosswalk-project/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,Bysmyyr/blink-crosswalk,XiaosongWei/blink-crosswalk,modulexcite/blink,XiaosongWei/blink-crosswalk,jtg-gg/blink,jtg-gg/blink,Pluto-tv/blink-crosswalk,hgl888/blink-crosswalk-efl,modulexcite/blink,kurli/blink-crosswalk,XiaosongWei/blink-crosswalk,modulexcite/blink,XiaosongWei/blink-crosswalk,ondra-novak/blink,jtg-gg/blink,kurli/blink-crosswalk,nwjs/blink,smishenk/blink-crosswalk,nwjs/blink,crosswalk-project/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,jtg-gg/blink,ondra-novak/blink,Bysmyyr/blink-crosswalk
b9ecedf51225867a3060d4de155186855c7de6b7
kernel/x86/apic_timer.c
kernel/x86/apic_timer.c
#include <kernel/x86/apic.h> #include <kernel/port/mmio.h> void apic_timer_init(uint8_t int_no, uint8_t divisor, uint8_t mode) { /** set the divisor: **/ uint32_t reg = get32(DIVIDE_CONF); reg &= ~0xf; /* The representation of the divisor in the divide configuration * register is... weird. We're normalizing it a bit here; it's split up * within the register, and for some reason 7 is divide by 1, where as * the rest are a perfect 2^(n-1). See the intel manual for the * details. */ if (divisor == 0) divisor = 7; else divisor -= 1; reg |= (divisor & 0x3) | ((divisor & 0x4)<<1); put32(DIVIDE_CONF, reg); /** set the lvt entry: **/ LVTEnt lvt_ent; lvt_ent.raw = get32(LVT_TIMER); lvt_ent.v.timer_mode = mode; lvt_ent.v.vector = int_no; lvt_ent.v.masked = 0; put32(LVT_TIMER, lvt_ent.raw); } void apic_timer_set(uint32_t value) { put32(INITIAL_COUNT, value); }
#include <kernel/x86/apic.h> #include <kernel/port/mmio.h> void apic_timer_init(uint8_t int_no, uint8_t divisor, uint8_t mode) { /** set the divisor: **/ uint32_t reg = get32(DIVIDE_CONF); reg &= ~0xf; /* The representation of the divisor in the divide configuration * register is... weird. We're normalizing it a bit here; it's split up * within the register, and for some reason 7 is divide by 1, where as * the rest are a perfect 2^(n-1). See the intel manual for the * details. */ if (divisor == 0) divisor = 7; else divisor -= 1; /* Clear the low 4 bits; the rest is reserved and shouldn't be touched. */ reg &= ~0xf; reg |= (divisor & 0x3) | ((divisor & 0x4)<<1); put32(DIVIDE_CONF, reg); /** set the lvt entry: **/ LVTEnt lvt_ent; lvt_ent.raw = get32(LVT_TIMER); lvt_ent.v.timer_mode = mode; lvt_ent.v.vector = int_no; lvt_ent.v.masked = 0; put32(LVT_TIMER, lvt_ent.raw); } void apic_timer_set(uint32_t value) { put32(INITIAL_COUNT, value); }
Clear existing divisor before setting it.
timer: Clear existing divisor before setting it. This is just a case of being slightly more diligent; there is not currently observed behavior change.
C
isc
zenhack/zero,zenhack/zero,zenhack/zero
df7f12046222ae1b263d9148d493182617edc611
numeric.h
numeric.h
#ifndef H_NUMERIC #define H_NUMERIC #include <cmath> #include <limits> template<class T> typename std::enable_if<!std::numeric_limits<T>::is_integer, bool>::type almost_equal(T x, T y, int ulp=2) { // the machine epsilon has to be scaled to the magnitude of the values used // and multiplied by the desired precision in ULPs (units in the last place) return std::abs(x-y) <= std::numeric_limits<T>::epsilon() * std::abs(x+y) * ulp // unless the result is subnormal || std::abs(x-y) < std::numeric_limits<T>::min(); } template<class T> T half(T x){} template <> float half(float x){return 0.5f * x;} template <> double half(double x){return 0.5 * x;} #endif
#ifndef H_NUMERIC #define H_NUMERIC #include <cmath> #include <limits> /** * @brief use of machine epsilon to compare floating-point values for equality * http://en.cppreference.com/w/cpp/types/numeric_limits/epsilon */ template<class T> typename std::enable_if<!std::numeric_limits<T>::is_integer, bool>::type almost_equal(T x, T y, int ulp=2) { // the machine epsilon has to be scaled to the magnitude of the values used // and multiplied by the desired precision in ULPs (units in the last place) return std::abs(x-y) <= std::numeric_limits<T>::epsilon() * std::abs(x+y) * ulp // unless the result is subnormal || std::abs(x-y) < std::numeric_limits<T>::min(); } template<class T> T half(T x){} template <> float half(float x){return 0.5f * x;} template <> double half(double x){return 0.5 * x;} #endif
Add reference for almost_equal function
Add reference for almost_equal function
C
mit
Bl4ckb0ne/delaunay-triangulation
c6eadf70db6113900a61674fd7195a9977f428a5
RealmSwift/Tests/TestUtils.h
RealmSwift/Tests/TestUtils.h
//////////////////////////////////////////////////////////////////////////// // // Copyright 2015 Realm 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. // //////////////////////////////////////////////////////////////////////////// #import <Foundation/Foundation.h> #import <XCTest/XCTestCase.h> // An XCTestCase that invokes each test in an autorelease pool // Works around a swift 1.1 limitation where `super` can't be used in a block @interface RLMAutoreleasePoolTestCase : XCTestCase @end FOUNDATION_EXTERN void RLMAssertThrows(XCTestCase *self, dispatch_block_t block, NSString *message, NSString *fileName, NSUInteger lineNumber); // Forcibly deallocate the RLMRealm for the given path on the main thread // Will cause crashes if it's alive for a reason other than being leaked by RLMAssertThrows FOUNDATION_EXTERN void RLMDeallocateRealm(NSString *path);
//////////////////////////////////////////////////////////////////////////// // // Copyright 2015 Realm 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. // //////////////////////////////////////////////////////////////////////////// #import <Foundation/Foundation.h> #import <XCTest/XCTestCase.h> // An XCTestCase that invokes each test in an autorelease pool // Works around a swift 1.1 limitation where `super` can't be used in a block @interface RLMAutoreleasePoolTestCase : XCTestCase @end FOUNDATION_EXTERN void RLMAssertThrows(XCTestCase *self, __attribute__((noescape)) dispatch_block_t block, NSString *message, NSString *fileName, NSUInteger lineNumber); // Forcibly deallocate the RLMRealm for the given path on the main thread // Will cause crashes if it's alive for a reason other than being leaked by RLMAssertThrows FOUNDATION_EXTERN void RLMDeallocateRealm(NSString *path);
Annotate RLMAssertThrows' block argument with noescape
[Tests] Annotate RLMAssertThrows' block argument with noescape
C
apache-2.0
duk42111/realm-cocoa,ul7290/realm-cocoa,codyDu/realm-cocoa,kylebshr/realm-cocoa,AlexanderMazaletskiy/realm-cocoa,bugix/realm-cocoa,bestwpw/realm-cocoa,yuuki1224/realm-cocoa,nathankot/realm-cocoa,xmartlabs/realm-cocoa,lumoslabs/realm-cocoa,codyDu/realm-cocoa,lumoslabs/realm-cocoa,imjerrybao/realm-cocoa,lumoslabs/realm-cocoa,Palleas/realm-cocoa,bestwpw/realm-cocoa,kylebshr/realm-cocoa,sunzeboy/realm-cocoa,AlexanderMazaletskiy/realm-cocoa,isaacroldan/realm-cocoa,Havi4/realm-cocoa,ChenJian345/realm-cocoa,thdtjsdn/realm-cocoa,thdtjsdn/realm-cocoa,neonichu/realm-cocoa,kevinmlong/realm-cocoa,vuchau/realm-cocoa,vuchau/realm-cocoa,hejunbinlan/realm-cocoa,dilizarov/realm-cocoa,lumoslabs/realm-cocoa,tenebreux/realm-cocoa,vuchau/realm-cocoa,bestwpw/realm-cocoa,bugix/realm-cocoa,tenebreux/realm-cocoa,hejunbinlan/realm-cocoa,duk42111/realm-cocoa,ul7290/realm-cocoa,dilizarov/realm-cocoa,tenebreux/realm-cocoa,thdtjsdn/realm-cocoa,sunzeboy/realm-cocoa,bestwpw/realm-cocoa,imjerrybao/realm-cocoa,iOSCowboy/realm-cocoa,HuylensHu/realm-cocoa,yuuki1224/realm-cocoa,Palleas/realm-cocoa,zilaiyedaren/realm-cocoa,ul7290/realm-cocoa,sunfei/realm-cocoa,Palleas/realm-cocoa,kevinmlong/realm-cocoa,neonichu/realm-cocoa,ChenJian345/realm-cocoa,zilaiyedaren/realm-cocoa,iOSCowboy/realm-cocoa,sunzeboy/realm-cocoa,ChenJian345/realm-cocoa,xmartlabs/realm-cocoa,kylebshr/realm-cocoa,duk42111/realm-cocoa,sunfei/realm-cocoa,isaacroldan/realm-cocoa,isaacroldan/realm-cocoa,zilaiyedaren/realm-cocoa,nathankot/realm-cocoa,iOS--wsl--victor/realm-cocoa,sunzeboy/realm-cocoa,iOSCowboy/realm-cocoa,isaacroldan/realm-cocoa,brasbug/realm-cocoa,tenebreux/realm-cocoa,iOS--wsl--victor/realm-cocoa,Havi4/realm-cocoa,Havi4/realm-cocoa,iOS--wsl--victor/realm-cocoa,iOSCowboy/realm-cocoa,sunzeboy/realm-cocoa,kevinmlong/realm-cocoa,isaacroldan/realm-cocoa,lumoslabs/realm-cocoa,neonichu/realm-cocoa,codyDu/realm-cocoa,ul7290/realm-cocoa,nathankot/realm-cocoa,hejunbinlan/realm-cocoa,brasbug/realm-cocoa,codyDu/realm-cocoa,iOS--wsl--victor/realm-cocoa,yuuki1224/realm-cocoa,zilaiyedaren/realm-cocoa,vuchau/realm-cocoa,imjerrybao/realm-cocoa,kylebshr/realm-cocoa,dilizarov/realm-cocoa,HuylensHu/realm-cocoa,kylebshr/realm-cocoa,zilaiyedaren/realm-cocoa,Havi4/realm-cocoa,hejunbinlan/realm-cocoa,brasbug/realm-cocoa,HuylensHu/realm-cocoa,hejunbinlan/realm-cocoa,codyDu/realm-cocoa,Palleas/realm-cocoa,Palleas/realm-cocoa,AlexanderMazaletskiy/realm-cocoa,HuylensHu/realm-cocoa,bestwpw/realm-cocoa,xmartlabs/realm-cocoa,ul7290/realm-cocoa,nathankot/realm-cocoa,duk42111/realm-cocoa,yuuki1224/realm-cocoa,bugix/realm-cocoa,thdtjsdn/realm-cocoa,Havi4/realm-cocoa,bugix/realm-cocoa,HuylensHu/realm-cocoa,ChenJian345/realm-cocoa,sunfei/realm-cocoa,xmartlabs/realm-cocoa,imjerrybao/realm-cocoa,neonichu/realm-cocoa,brasbug/realm-cocoa,bugix/realm-cocoa,sunfei/realm-cocoa,iOSCowboy/realm-cocoa,neonichu/realm-cocoa,yuuki1224/realm-cocoa,ChenJian345/realm-cocoa,duk42111/realm-cocoa,AlexanderMazaletskiy/realm-cocoa,kevinmlong/realm-cocoa,kevinmlong/realm-cocoa,dilizarov/realm-cocoa,iOS--wsl--victor/realm-cocoa,tenebreux/realm-cocoa,dilizarov/realm-cocoa,imjerrybao/realm-cocoa,nathankot/realm-cocoa,sunfei/realm-cocoa,xmartlabs/realm-cocoa,thdtjsdn/realm-cocoa,AlexanderMazaletskiy/realm-cocoa,vuchau/realm-cocoa,brasbug/realm-cocoa
c0ae1b727985d3e94549776666a9f0929cbac090
include/erpiko/bigint.h
include/erpiko/bigint.h
#ifndef _BIGINT_H_ #define _BIGINT_H_ #include <memory> namespace Erpiko { /** * BigInt is the class of big integer representation. */ class BigInt { public: /** * Constructor */ BigInt(); /** * Constructor from long integer * @param value to be initialized */ BigInt(unsigned long value); /** * Creates a new BigInt and initialized with the value specified in the string * @param string string containing the value. If it is prefixed with 0x then it is considered as hex string * @return the new BigInt with the value set */ static BigInt* fromString(const std::string string); virtual ~BigInt(); /** * Creates hex string representation of the BigInt * @return string containing hex string */ const std::string toHexString() const; /** * Operator == **/ bool operator== (const BigInt& other) const; /** * Operator = **/ void operator= (const BigInt& other); /** * Operator = **/ void operator= (const unsigned long value); /** * Operator =. * @param string the new value specified as string. String must be valid or the value will not change. **/ void operator= (const std::string string); private: class Impl; std::unique_ptr<Impl> impl; }; } // namespace Erpiko #endif // _BIGINT_H_
#ifndef _BIGINT_H_ #define _BIGINT_H_ #include <string> #include <memory> namespace Erpiko { /** * BigInt is the class of big integer representation. */ class BigInt { public: /** * Constructor */ BigInt(); /** * Constructor from long integer * @param value to be initialized */ BigInt(unsigned long value); /** * Creates a new BigInt and initialized with the value specified in the string * @param string string containing the value. If it is prefixed with 0x then it is considered as hex string * @return the new BigInt with the value set */ static BigInt* fromString(const std::string string); virtual ~BigInt(); /** * Creates hex string representation of the BigInt * @return string containing hex string */ const std::string toHexString() const; /** * Operator == **/ bool operator== (const BigInt& other) const; /** * Operator = **/ void operator= (const BigInt& other); /** * Operator = **/ void operator= (const unsigned long value); /** * Operator =. * @param string the new value specified as string. String must be valid or the value will not change. **/ void operator= (const std::string string); private: class Impl; std::unique_ptr<Impl> impl; }; } // namespace Erpiko #endif // _BIGINT_H_
Add <string> explicitly for Windows complaining without it
Add <string> explicitly for Windows complaining without it
C
bsd-3-clause
mdamt/erpiko,mdamt/erpiko,mdamt/erpiko
469d2ae14fdeeb192a0f152978f433cd2bed840e
core/alsp_src/win32/win32_locate.c
core/alsp_src/win32/win32_locate.c
#include "defs.h" void locate_library_executable(int argc, char *argv[]) { DWORD l; char *endpath; #ifdef DLL HANDLE dll; #endif l = GetModuleFileName(NULL, executable_path, IMAGEDIR_MAX); if (l == 0 || l >= IMAGEDIR_MAX) fatal_error(FE_INFND, 0); #ifdef DLL dll = GetModuleHandle(DLL_NAME); if (dll == NULL) fatal_error(FE_INFND, 0); l = GetModuleFileName(dll, library_path, IMAGEDIR_MAX); if (l == 0 || l >= IMAGEDIR_MAX) fatal_error(FE_INFND, 0); #else strcpy(library_path, executable_path); #endif /* DLL */ strcpy(library_dir, library_path); endpath = strrchr(library_dir, '\\'); if (endpath == NULL) fatal_error(FE_INFND, 0); endpath++; /* include the \ */ *endpath = 0; }
#include "defs.h" void locate_library_executable(int argc, char *argv[]) { DWORD l; char *endpath; #ifdef DLL HANDLE dll; #endif l = GetModuleFileName(NULL, executable_path, PATH_MAX); if (l == 0 || l >= PATH_MAX) fatal_error(FE_INFND, 0); #ifdef DLL dll = GetModuleHandle(DLL_NAME); if (dll == NULL) fatal_error(FE_INFND, 0); l = GetModuleFileName(dll, library_path, PATH_MAX); if (l == 0 || l >= PATH_MAX) fatal_error(FE_INFND, 0); #else strcpy(library_path, executable_path); #endif /* DLL */ strcpy(library_dir, library_path); endpath = strrchr(library_dir, '\\'); if (endpath == NULL) fatal_error(FE_INFND, 0); endpath++; /* include the \ */ *endpath = 0; }
Replace custom IMAGEDIR_MAX with PATH_MAX, ala 13616d1
Replace custom IMAGEDIR_MAX with PATH_MAX, ala 13616d1
C
mit
AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog,AppliedLogicSystems/ALSProlog
c6f56c9c3b29fd74859f237e7357322f4ac9574e
ghighlighter/gh-about-dialog.c
ghighlighter/gh-about-dialog.c
#include <gtk/gtk.h> GtkWidget * gh_about_dialog_create () { GtkWidget *dialog; dialog = gtk_about_dialog_new (); static gchar const *title = "About ghighlighter"; gtk_window_set_title (GTK_WINDOW (dialog), title); return dialog; }
#include <gtk/gtk.h> GtkWidget * gh_about_dialog_create () { GtkWidget *dialog; dialog = gtk_about_dialog_new (); static gchar const *title = "About ghighlighter"; static gchar const *program_name = "ghighlighter"; gtk_window_set_title (GTK_WINDOW (dialog), title); gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (dialog), program_name); return dialog; }
Set about dialog program name
Set about dialog program name
C
mit
chdorner/ghighlighter-c
bb4c88c29ab312e2be118ac857daa7c93399d6e1
src/include/postmaster/fork_process.h
src/include/postmaster/fork_process.h
#ifndef FORK_PROCESS_H #define FORK_PROCESS_H #include "postgres.h" extern pid_t fork_process(void); #endif /* ! FORK_PROCESS_H */
/*------------------------------------------------------------------------- * * fork_process.h * Exports from postmaster/fork_process.c. * * Copyright (c) 1996-2005, PostgreSQL Global Development Group * * $PostgreSQL: pgsql/src/include/postmaster/fork_process.h,v 1.2 2005/03/13 23:32:26 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef FORK_PROCESS_H #define FORK_PROCESS_H extern pid_t fork_process(void); #endif /* FORK_PROCESS_H */
Add missing identification comment, remove entirely inappropriate include of postgres.h.
Add missing identification comment, remove entirely inappropriate include of postgres.h.
C
apache-2.0
50wu/gpdb,lisakowen/gpdb,lpetrov-pivotal/gpdb,greenplum-db/gpdb,zeroae/postgres-xl,adam8157/gpdb,rubikloud/gpdb,zeroae/postgres-xl,cjcjameson/gpdb,xinzweb/gpdb,edespino/gpdb,oberstet/postgres-xl,ahachete/gpdb,lpetrov-pivotal/gpdb,adam8157/gpdb,rubikloud/gpdb,jmcatamney/gpdb,ahachete/gpdb,oberstet/postgres-xl,ovr/postgres-xl,xuegang/gpdb,yuanzhao/gpdb,royc1/gpdb,CraigHarris/gpdb,pavanvd/postgres-xl,ashwinstar/gpdb,snaga/postgres-xl,cjcjameson/gpdb,Quikling/gpdb,janebeckman/gpdb,kmjungersen/PostgresXL,rubikloud/gpdb,randomtask1155/gpdb,oberstet/postgres-xl,chrishajas/gpdb,pavanvd/postgres-xl,kmjungersen/PostgresXL,royc1/gpdb,50wu/gpdb,lintzc/gpdb,50wu/gpdb,greenplum-db/gpdb,yazun/postgres-xl,CraigHarris/gpdb,CraigHarris/gpdb,snaga/postgres-xl,kaknikhil/gpdb,lpetrov-pivotal/gpdb,rvs/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,royc1/gpdb,yuanzhao/gpdb,edespino/gpdb,Quikling/gpdb,foyzur/gpdb,atris/gpdb,techdragon/Postgres-XL,adam8157/gpdb,lintzc/gpdb,zaksoup/gpdb,tangp3/gpdb,tangp3/gpdb,ovr/postgres-xl,jmcatamney/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,Chibin/gpdb,rvs/gpdb,CraigHarris/gpdb,Chibin/gpdb,tangp3/gpdb,xinzweb/gpdb,tangp3/gpdb,lintzc/gpdb,Quikling/gpdb,kaknikhil/gpdb,zaksoup/gpdb,yuanzhao/gpdb,snaga/postgres-xl,yazun/postgres-xl,yuanzhao/gpdb,arcivanov/postgres-xl,zeroae/postgres-xl,Chibin/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,postmind-net/postgres-xl,xinzweb/gpdb,adam8157/gpdb,lisakowen/gpdb,randomtask1155/gpdb,rubikloud/gpdb,tangp3/gpdb,cjcjameson/gpdb,Postgres-XL/Postgres-XL,lpetrov-pivotal/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,ahachete/gpdb,tangp3/gpdb,lpetrov-pivotal/gpdb,ahachete/gpdb,foyzur/gpdb,edespino/gpdb,ahachete/gpdb,ahachete/gpdb,ovr/postgres-xl,janebeckman/gpdb,pavanvd/postgres-xl,janebeckman/gpdb,50wu/gpdb,randomtask1155/gpdb,rvs/gpdb,tangp3/gpdb,tpostgres-projects/tPostgres,tpostgres-projects/tPostgres,rvs/gpdb,jmcatamney/gpdb,lintzc/gpdb,kaknikhil/gpdb,randomtask1155/gpdb,lpetrov-pivotal/gpdb,atris/gpdb,edespino/gpdb,greenplum-db/gpdb,postmind-net/postgres-xl,lisakowen/gpdb,lintzc/gpdb,pavanvd/postgres-xl,atris/gpdb,0x0FFF/gpdb,Chibin/gpdb,Quikling/gpdb,oberstet/postgres-xl,janebeckman/gpdb,edespino/gpdb,xinzweb/gpdb,0x0FFF/gpdb,atris/gpdb,chrishajas/gpdb,oberstet/postgres-xl,lisakowen/gpdb,CraigHarris/gpdb,snaga/postgres-xl,lisakowen/gpdb,royc1/gpdb,Postgres-XL/Postgres-XL,zaksoup/gpdb,yazun/postgres-xl,yuanzhao/gpdb,cjcjameson/gpdb,chrishajas/gpdb,xuegang/gpdb,ashwinstar/gpdb,lisakowen/gpdb,chrishajas/gpdb,ashwinstar/gpdb,foyzur/gpdb,Chibin/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,zeroae/postgres-xl,xinzweb/gpdb,lintzc/gpdb,arcivanov/postgres-xl,Quikling/gpdb,Chibin/gpdb,chrishajas/gpdb,Postgres-XL/Postgres-XL,janebeckman/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,atris/gpdb,adam8157/gpdb,jmcatamney/gpdb,yazun/postgres-xl,cjcjameson/gpdb,edespino/gpdb,foyzur/gpdb,foyzur/gpdb,arcivanov/postgres-xl,kmjungersen/PostgresXL,jmcatamney/gpdb,CraigHarris/gpdb,lintzc/gpdb,randomtask1155/gpdb,xinzweb/gpdb,rvs/gpdb,tpostgres-projects/tPostgres,rubikloud/gpdb,rvs/gpdb,lpetrov-pivotal/gpdb,techdragon/Postgres-XL,CraigHarris/gpdb,50wu/gpdb,xuegang/gpdb,kmjungersen/PostgresXL,zaksoup/gpdb,janebeckman/gpdb,rubikloud/gpdb,arcivanov/postgres-xl,kmjungersen/PostgresXL,jmcatamney/gpdb,postmind-net/postgres-xl,royc1/gpdb,50wu/gpdb,pavanvd/postgres-xl,yuanzhao/gpdb,chrishajas/gpdb,CraigHarris/gpdb,janebeckman/gpdb,arcivanov/postgres-xl,postmind-net/postgres-xl,randomtask1155/gpdb,xuegang/gpdb,janebeckman/gpdb,xuegang/gpdb,edespino/gpdb,adam8157/gpdb,50wu/gpdb,xuegang/gpdb,ashwinstar/gpdb,foyzur/gpdb,kaknikhil/gpdb,rvs/gpdb,yuanzhao/gpdb,Quikling/gpdb,cjcjameson/gpdb,tpostgres-projects/tPostgres,lintzc/gpdb,0x0FFF/gpdb,zeroae/postgres-xl,xuegang/gpdb,tpostgres-projects/tPostgres,xuegang/gpdb,ovr/postgres-xl,lpetrov-pivotal/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,adam8157/gpdb,rvs/gpdb,Quikling/gpdb,lisakowen/gpdb,kaknikhil/gpdb,zaksoup/gpdb,edespino/gpdb,edespino/gpdb,CraigHarris/gpdb,edespino/gpdb,royc1/gpdb,kaknikhil/gpdb,Quikling/gpdb,janebeckman/gpdb,Chibin/gpdb,yazun/postgres-xl,randomtask1155/gpdb,zaksoup/gpdb,foyzur/gpdb,Chibin/gpdb,ashwinstar/gpdb,xinzweb/gpdb,atris/gpdb,0x0FFF/gpdb,chrishajas/gpdb,yuanzhao/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,techdragon/Postgres-XL,0x0FFF/gpdb,greenplum-db/gpdb,arcivanov/postgres-xl,lisakowen/gpdb,Quikling/gpdb,Quikling/gpdb,xuegang/gpdb,zaksoup/gpdb,atris/gpdb,chrishajas/gpdb,zaksoup/gpdb,kaknikhil/gpdb,Chibin/gpdb,adam8157/gpdb,ovr/postgres-xl,snaga/postgres-xl,tangp3/gpdb,rvs/gpdb,royc1/gpdb,greenplum-db/gpdb,ahachete/gpdb,kaknikhil/gpdb,Chibin/gpdb,xinzweb/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,atris/gpdb,rubikloud/gpdb,rubikloud/gpdb,randomtask1155/gpdb,Postgres-XL/Postgres-XL,janebeckman/gpdb,royc1/gpdb,lintzc/gpdb,foyzur/gpdb,50wu/gpdb,ahachete/gpdb,greenplum-db/gpdb,techdragon/Postgres-XL,rvs/gpdb
2a3828f1e477561e574fb9ee4525641832e3dcd9
make/src/config.c
make/src/config.c
#include <stdlib.h> #include <string.h> #include "config.h" struct Config load_config(char *arquivo) { } struct Idioma load_idioma(char *idioma){ char *local_idioma; int loaded; strcpy(local_idioma, "local aqui"); strcat(local_idioma, idioma); strcat(local_idioma, ".conf"); loaded = 1; while(loaded) { strcpy(local_idioma, "local aqui"); strcat(local_idioma, idioma); strcat(local_idioma, ".conf"); //Abre idioma FILE *arquivo = fopen(local_idioma, "r"); if(file) { loaded = 0; } else { printf("Arquivo de idioma não localizado\n"); printf("Will try to load the default language\n"); } } }
#include <stdlib.h> #include <string.h> #include "config.h" struct Config load_config(char *arquivo) { } void load_idioma(struct Idioma *idioma, char *key, char *content){ } void clean_idioma(struct Idioma *idioma) { free(idioma); }
Change functions to handle idioma
Change functions to handle idioma
C
apache-2.0
ezefranca/LogiKiD-Allegro5-Game,ezefranca/LogiKiD-Allegro5-Game,ezefranca/LogiKiD-Allegro5-Game
a4dca78e05e29151fb8d20573f4387d750c10bc3
Paystack/PublicHeaders/PSTCKTransactionParams.h
Paystack/PublicHeaders/PSTCKTransactionParams.h
// // PSTCKTransactionParams.h // Paystack // #import <Foundation/Foundation.h> #import "PSTCKFormEncodable.h" /** * Representation of a user's credit card details. You can assemble these with information that your user enters and * then create Paystack tokens with them using an PSTCKAPIClient. @see https://paystack.com/docs/api#cards */ @interface PSTCKTransactionParams : NSObject<PSTCKFormEncodable> @property (nonatomic, copy, nonnull) NSString *email; @property (nonatomic, nonnull) NSUInteger *amount; @property (nonatomic, copy, nullable) NSString *reference; @property (nonatomic, copy, nullable) NSString *subaccount; @property (nonatomic, nullable) NSUInteger *transactionCharge; @property (nonatomic, copy, nullable) NSString *bearer; @property (nonatomic, copy, nullable) NSString *metadata; @end
// // PSTCKTransactionParams.h // Paystack // #import <Foundation/Foundation.h> #import "PSTCKFormEncodable.h" /** * Representation of a user's credit card details. You can assemble these with information that your user enters and * then create Paystack tokens with them using an PSTCKAPIClient. @see https://paystack.com/docs/api#cards */ @interface PSTCKTransactionParams : NSObject<PSTCKFormEncodable> @property (nonatomic, copy, nonnull) NSString *email; @property (nonatomic) NSUInteger amount; @property (nonatomic, copy, nullable) NSString *reference; @property (nonatomic, copy, nullable) NSString *subaccount; @property (nonatomic) NSUInteger transactionCharge; @property (nonatomic, copy, nullable) NSString *bearer; @property (nonatomic, copy, nullable) NSString *metadata; @end
Make UInt safe on Transaction Params by not using pointer
Make UInt safe on Transaction Params by not using pointer
C
mit
PaystackHQ/paystack-ios,PaystackHQ/paystack-ios,PaystackHQ/paystack-ios,PaystackHQ/paystack-ios
28621d2412f8a353d7a01d007a7811542d60ac0a
src/imap/cmd-close.c
src/imap/cmd-close.c
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!client_verify_open_mailbox(cmd)) return TRUE; storage = mailbox_get_storage(mailbox); client->mailbox = NULL; if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage); client_update_mailbox_flags(client, NULL); client_send_tagline(cmd, "OK Close completed."); return TRUE; }
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!client_verify_open_mailbox(cmd)) return TRUE; storage = mailbox_get_storage(mailbox); client->mailbox = NULL; if (!imap_expunge(mailbox, NULL)) client_send_untagged_storage_error(client, storage); else if (mailbox_sync(mailbox, 0, 0, NULL) < 0) client_send_untagged_storage_error(client, storage); if (mailbox_close(&mailbox) < 0) client_send_untagged_storage_error(client, storage); client_update_mailbox_flags(client, NULL); client_send_tagline(cmd, "OK Close completed."); return TRUE; }
Synchronize the mailbox after expunging messages to actually get them expunged.
CLOSE: Synchronize the mailbox after expunging messages to actually get them expunged.
C
mit
Distrotech/dovecot,Distrotech/dovecot,Distrotech/dovecot,Distrotech/dovecot,Distrotech/dovecot
219d412d13700e86571971075128cd65c2ccd24f
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 87 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 88 #endif
Update Skia milestone to 88
Update Skia milestone to 88 Change-Id: I8d01f643e1cb7327713959ea744de3ae8c82bb6e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321520 Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com> Commit-Queue: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
C
bsd-3-clause
aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia
f1c31c00a26f31c337ab37c37ea529567986bfa2
include/gum/GlyphStyleID.h
include/gum/GlyphStyleID.h
#ifndef _GUM_GLYPH_STYLE_ID_H_ #define _GUM_GLYPH_STYLE_ID_H_ #include "gum/GlyphStyle.h" #include <cu/cu_macro.h> #include <cu/cu_stl.h> namespace gum { class GlyphStyle; class GlyphStyleID { public: int Gen(const GlyphStyle& style); private: static int Hash(const GlyphStyle& style); private: static const int HASH_CAP = 197; private: int m_next_id; std::vector<std::pair<GlyphStyle, int> > m_hash[HASH_CAP]; std::pair<GlyphStyle, int> m_last; CU_SINGLETON_DECLARATION(GlyphStyleID) }; // GlyphStyleID } #endif // _GUM_GLYPH_STYLE_ID_H_
#ifndef _GUM_GLYPH_STYLE_ID_H_ #define _GUM_GLYPH_STYLE_ID_H_ #include "gum/GlyphStyle.h" #include <cu/cu_macro.h> #include <cu/cu_stl.h> namespace gum { class GlyphStyle; class GlyphStyleID { public: int Gen(const GlyphStyle& style); private: static int Hash(const GlyphStyle& style); private: static const int HASH_CAP = 197; private: int m_next_id; CU_VEC<std::pair<GlyphStyle, int> > m_hash[HASH_CAP]; std::pair<GlyphStyle, int> m_last; CU_SINGLETON_DECLARATION(GlyphStyleID) }; // GlyphStyleID } #endif // _GUM_GLYPH_STYLE_ID_H_
Revert "[FIXED] not use allocator, for async draw"
Revert "[FIXED] not use allocator, for async draw" This reverts commit 3cce0321da141d1fb8689d826fd5f5235066c977.
C
mit
xzrunner/gum,xzrunner/gum
89a8e62c03aa2cfe044c9023ec3bbaefb835a7df
test/profile/Posix/instrprof-get-filename-merge-mode.c
test/profile/Posix/instrprof-get-filename-merge-mode.c
// Test __llvm_profile_get_filename when the on-line merging mode is enabled. // // RUN: %clang_pgogen -dynamiclib -o %t.dso %p/Inputs/instrprof-get-filename-dso.c // RUN: %clang_pgogen -o %t %s %t.dso // RUN: env LLVM_PROFILE_FILE="%t-%m.profraw" %run %t #include <string.h> const char *__llvm_profile_get_filename(void); extern const char *get_filename_from_DSO(void); int main(int argc, const char *argv[]) { const char *filename1 = __llvm_profile_get_filename(); const char *filename2 = get_filename_from_DSO(); // Exit with code 1 if the two filenames are the same. return strcmp(filename1, filename2) == 0; }
// Test __llvm_profile_get_filename when the on-line merging mode is enabled. // // RUN: %clang_pgogen -fPIC -shared -o %t.dso %p/../Inputs/instrprof-get-filename-dso.c // RUN: %clang_pgogen -o %t %s %t.dso // RUN: env LLVM_PROFILE_FILE="%t-%m.profraw" %run %t #include <string.h> const char *__llvm_profile_get_filename(void); extern const char *get_filename_from_DSO(void); int main(int argc, const char *argv[]) { const char *filename1 = __llvm_profile_get_filename(); const char *filename2 = get_filename_from_DSO(); // Exit with code 1 if the two filenames are the same. return strcmp(filename1, filename2) == 0; }
Use -fPIC -shared in a test instead of -dynamiclib
[profile] Use -fPIC -shared in a test instead of -dynamiclib This is more portable than -dynamiclib. Also, fix the path to an input file that broke when the test was moved in r375315. git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@375317 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
e539d64784ae5837ca6b7f424e1c6ce3540feceb
runtime/test/tasking/bug_36720.c
runtime/test/tasking/bug_36720.c
// RUN: %libomp-compile-and-run /* Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=36720 Assertion failure at kmp_runtime.cpp(1715): nthreads > 0. OMP: Error #13: Assertion failure at kmp_runtime.cpp(1715). The assertion fails even with OMP_NUM_THREADS=1. If the second task is removed, everything runs to completion. If the "omp parallel for" directives are removed from inside the tasks, once again everything runs fine. */ #define N 1024 int main() { #pragma omp task { #pragma omp parallel for for (int i = 0; i < N; i++) (void)0; } #pragma omp task { #pragma omp parallel for for (int i = 0; i < N; ++i) (void)0; } #pragma omp taskwait return 0; }
// RUN: %libomp-compile-and-run /* Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=36720 Assertion failure at kmp_runtime.cpp(1715): nthreads > 0. OMP: Error #13: Assertion failure at kmp_runtime.cpp(1715). The assertion fails even with OMP_NUM_THREADS=1. If the second task is removed, everything runs to completion. If the "omp parallel for" directives are removed from inside the tasks, once again everything runs fine. */ #define N 1024 int main() { #pragma omp task { int i; #pragma omp parallel for for (i = 0; i < N; i++) (void)0; } #pragma omp task { int i; #pragma omp parallel for for (i = 0; i < N; ++i) (void)0; } #pragma omp taskwait return 0; }
Convert test for PR36720 to c89
[test] Convert test for PR36720 to c89 GCC 4.8.5 defaults to this old C standard. I think we should make the tests pass a newer -std=c99|c11 but that's too intrusive for now... Differential Revision: https://reviews.llvm.org/D50084 git-svn-id: f99161ee8ccfe2101cbe1bdda2220bce2ed25485@338490 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp,llvm-mirror/openmp
3b879e32d7063b4b83867fac9a8c38f042a0fc2b
arch/x86_64/rsp/vmov.c
arch/x86_64/rsp/vmov.c
// // arch/x86_64/rsp/vmov.c // // This file is subject to the terms and conditions defined in // 'LICENSE', which is part of this source code package. // #include "common.h" #include "rsp/cpu.h" #include "rsp/rsp.h" __m128i rsp_vmov(struct rsp *rsp, unsigned src, unsigned e, unsigned dest, rsp_vect_t vt_shuffle) { uint16_t data; // Copy element into data memcpy(&data, (e & 0x7) + (uint16_t *)&vt_shuffle, sizeof(uint16_t)); printf("src %d dest %d el %x data %x\n", src, dest, e, data); fflush(stdout); // Write out the upper part of the result. rsp->cp2.regs[dest].e[e & 0x7] = data; return rsp_vect_load_unshuffled_operand(rsp->cp2.regs[dest].e); }
// // arch/x86_64/rsp/vmov.c // // This file is subject to the terms and conditions defined in // 'LICENSE', which is part of this source code package. // #include "common.h" #include "rsp/cpu.h" #include "rsp/rsp.h" __m128i rsp_vmov(struct rsp *rsp, unsigned src, unsigned e, unsigned dest, rsp_vect_t vt_shuffle) { uint16_t data; // Copy element into data memcpy(&data, (e & 0x7) + (uint16_t *)&vt_shuffle, sizeof(uint16_t)); // Write out the upper part of the result. rsp->cp2.regs[dest].e[e & 0x7] = data; return rsp_vect_load_unshuffled_operand(rsp->cp2.regs[dest].e); }
Remove debug information from VMOV code
Remove debug information from VMOV code
C
bsd-3-clause
tj90241/cen64,tj90241/cen64
8fa7230f1fee1f68f7ae6ed03cdc72c63a8c97b2
modules/acpi/acpi_module.c
modules/acpi/acpi_module.c
/* SPDX-License-Identifier: BSD-2-Clause */ #include <tilck/common/basic_defs.h> #include <tilck/common/printk.h> #include <tilck/kernel/sched.h> #include "osl.h" #include <3rd_party/acpi/acpi.h> #include <3rd_party/acpi/acexcep.h> static ACPI_TABLE_DESC acpi_tables[16]; void early_init_acpi_module(void) { ACPI_STATUS rc; rc = AcpiInitializeSubsystem(); if (rc != AE_OK) panic("AcpiInitializeSubsystem() failed with: %d", rc); rc = AcpiInitializeTables(acpi_tables, 16, false); if (rc != AE_OK) panic("AcpiInitializeTables() failed with: %d", rc); }
/* SPDX-License-Identifier: BSD-2-Clause */ #include <tilck/common/basic_defs.h> #include <tilck/common/printk.h> #include <tilck/kernel/sched.h> #include "osl.h" #include <3rd_party/acpi/acpi.h> #include <3rd_party/acpi/acexcep.h> void early_init_acpi_module(void) { ACPI_STATUS rc; rc = AcpiInitializeSubsystem(); if (rc != AE_OK) panic("AcpiInitializeSubsystem() failed with: %d", rc); rc = AcpiInitializeTables(NULL, 0, true); if (rc != AE_OK) panic("AcpiInitializeTables() failed with: %d", rc); }
Make AcpiInitializeTables to dynamically alloc tables
[acpi] Make AcpiInitializeTables to dynamically alloc tables
C
bsd-2-clause
vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs
32df46c68c5f8756b4383b1228d17df6538ae671
quic/common/test/TestClientUtils.h
quic/common/test/TestClientUtils.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <fizz/protocol/CertificateVerifier.h> namespace quic::test { class TestCertificateVerifier : public fizz::CertificateVerifier { public: ~TestCertificateVerifier() override = default; void verify(const std::vector<std::shared_ptr<const fizz::PeerCert>>&) const override { return; } [[nodiscard]] std::vector<fizz::Extension> getCertificateRequestExtensions() const override { return std::vector<fizz::Extension>(); } }; inline std::unique_ptr<fizz::CertificateVerifier> createTestCertificateVerifier() { return std::make_unique<TestCertificateVerifier>(); } } // namespace quic::test
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <fizz/protocol/CertificateVerifier.h> namespace quic::test { class TestCertificateVerifier : public fizz::CertificateVerifier { public: ~TestCertificateVerifier() override = default; std::shared_ptr<const folly::AsyncTransportCertificate> verify( const std::vector<std::shared_ptr<const fizz::PeerCert>>& certs) const override { return certs.front(); } [[nodiscard]] std::vector<fizz::Extension> getCertificateRequestExtensions() const override { return std::vector<fizz::Extension>(); } }; inline std::unique_ptr<fizz::CertificateVerifier> createTestCertificateVerifier() { return std::make_unique<TestCertificateVerifier>(); } } // namespace quic::test
Replace fizz server cert with leaf cert returned from verification
Replace fizz server cert with leaf cert returned from verification Summary: Added code to return the leaf cert after successfully verification of the server cert. The returned cert is then used for replacing the server cert. Reviewed By: AjanthanAsogamoorthy Differential Revision: D35898220 fbshipit-source-id: 8f542471a711d5aa62d0aad4c1d12b10c2209744
C
mit
facebookincubator/mvfst,facebookincubator/mvfst,facebookincubator/mvfst,facebookincubator/mvfst,facebookincubator/mvfst
b4c1779d143c3555a61ab588589c68549117fea6
subprojects/docs/src/samples/native-binaries/prebuilt/3rd-party-lib/util/src/util/headers/util.h
subprojects/docs/src/samples/native-binaries/prebuilt/3rd-party-lib/util/src/util/headers/util.h
#ifdef _WIN32 #define LIB_FUNC __declspec(dllimport) #else #define LIB_FUNC #endif void LIB_FUNC printBuildType();
#ifdef _WIN32 #define LIB_FUNC __declspec(dllexport) #else #define LIB_FUNC #endif void LIB_FUNC printBuildType();
Use correct syntax for windows DLL export
Use correct syntax for windows DLL export
C
apache-2.0
blindpirate/gradle,robinverduijn/gradle,gradle/gradle,robinverduijn/gradle,lsmaira/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,gstevey/gradle,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,blindpirate/gradle,robinverduijn/gradle,robinverduijn/gradle,gstevey/gradle,lsmaira/gradle,lsmaira/gradle,gstevey/gradle,lsmaira/gradle,gradle/gradle,blindpirate/gradle,lsmaira/gradle,lsmaira/gradle,gradle/gradle,robinverduijn/gradle,gstevey/gradle,gstevey/gradle,robinverduijn/gradle,gstevey/gradle,lsmaira/gradle,blindpirate/gradle,gradle/gradle,gstevey/gradle,blindpirate/gradle,robinverduijn/gradle,gstevey/gradle,gradle/gradle,lsmaira/gradle,robinverduijn/gradle,blindpirate/gradle,lsmaira/gradle,blindpirate/gradle,gradle/gradle,gradle/gradle,lsmaira/gradle,blindpirate/gradle,gradle/gradle,blindpirate/gradle,gstevey/gradle
191574d42fc281cde241ae33013c9801336e8758
net/spdy/spdy_http_utils.h
net/spdy/spdy_http_utils.h
// Copyright (c) 2010 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 NET_SPDY_SPDY_HTTP_UTILS_H_ #define NET_SPDY_SPDY_HTTP_UTILS_H_ #pragma once #include "net/spdy/spdy_framer.h" namespace net { class HttpResponseInfo; class HttpRequestInfo; // Convert a SpdyHeaderBlock into an HttpResponseInfo. // |headers| input parameter with the SpdyHeaderBlock. // |info| output parameter for the HttpResponseInfo. // Returns true if successfully converted. False if there was a failure // or if the SpdyHeaderBlock was invalid. bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers, HttpResponseInfo* response); // Create a SpdyHeaderBlock for a Spdy SYN_STREAM Frame from // a HttpRequestInfo block. void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info, spdy::SpdyHeaderBlock* headers, bool direct); } // namespace net #endif // NET_SPDY_SPDY_HTTP_UTILS_H_
// Copyright (c) 2010 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 NET_SPDY_SPDY_HTTP_UTILS_H_ #define NET_SPDY_SPDY_HTTP_UTILS_H_ #pragma once #include "net/spdy/spdy_framer.h" namespace net { class HttpResponseInfo; struct HttpRequestInfo; // Convert a SpdyHeaderBlock into an HttpResponseInfo. // |headers| input parameter with the SpdyHeaderBlock. // |info| output parameter for the HttpResponseInfo. // Returns true if successfully converted. False if there was a failure // or if the SpdyHeaderBlock was invalid. bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers, HttpResponseInfo* response); // Create a SpdyHeaderBlock for a Spdy SYN_STREAM Frame from // a HttpRequestInfo block. void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info, spdy::SpdyHeaderBlock* headers, bool direct); } // namespace net #endif // NET_SPDY_SPDY_HTTP_UTILS_H_
Change forward declaration of HttpRequestInfo from class to struct to fix build breakage.
Change forward declaration of HttpRequestInfo from class to struct to fix build breakage. BUG=none TEST=none git-svn-id: http://src.chromium.org/svn/trunk/src@59584 4ff67af0-8c30-449e-8e8b-ad334ec8d88c Former-commit-id: cb97ca6c3e6d589f6d40ad33fdc8afb7a19c6999
C
bsd-3-clause
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser
c2cf47ebbd82bf050d338c73f2d9bcd2de3976d2
main.c
main.c
#include <stdio.h> #include <string.h> // Declare functions void get_input(); // Global variables char text_input[32]; int running = 1; // Main Section int main() { while (running == 1) { if (strcmp(text_input, "q") == 0) { running = 0; printf("Goodbye!\n"); } else { get_input(); printf("The message is %s\n", text_input); } } return 0; } // Define functions void get_input() { // Get the string printf("Please enter a number or (q) to quit\n"); fgets(text_input, 32, stdin); // Get the length of the string int length = strlen(text_input) -1; // Remove the newline at the end of the string if it existss if (text_input[length] == '\n') { text_input[length] = '\0'; } }
#include <stdio.h> #include <string.h> // Declare functions void get_input(); int is_valid_number(); // Global variables char text_input[32]; int running = 1; // Main Section int main() { while (running == 1) { if (strcmp(text_input, "q") == 0) { running = 0; printf("Goodbye!\n"); } else { get_input(); if(is_valid_number() == 0) { printf("The message is %s\n", text_input); } } } return 0; } // Define functions void get_input() { // Get the string printf("Please enter a number or (q) to quit\n"); fgets(text_input, 32, stdin); // Get the length of the string int length = strlen(text_input) -1; // Remove the newline at the end of the string if it existss if (text_input[length] == '\n') { text_input[length] = '\0'; } } // Check if string is a valid number int is_valid_number() { char *ptr; long number; number = strtol(text_input, &ptr, 10); if (strlen(ptr) == 0) { return 0; } else { printf("Not a valid number\n"); return 1; } }
Create function to check if text_input is a valid number
Create function to check if text_input is a valid number
C
mit
julian-labuschagne/number_game
c2e36b8f4bcbd3a8bec4d5d4bfc6d5a5a669b5c6
src/utils.h
src/utils.h
/** * @file utils.h * @brief Storj utilities. * * Helper utilities */ #ifndef STORJ_UTILS_H #define STORJ_UTILS_H #include <assert.h> #include <stdint.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <stdarg.h> #include <math.h> #include <stdbool.h> #ifdef _WIN32 #include <windows.h> #include <time.h> ssize_t pread(int fd, void *buf, size_t count, uint64_t offset); #else #include <sys/time.h> #endif int hex2str(unsigned length, uint8_t *data, char *buffer); void print_int_array(uint8_t *array, unsigned length); int str2hex(unsigned length, char *data, uint8_t *buffer); char *str_concat_many(int count, ...); void random_buffer(uint8_t *buf, size_t len); uint64_t shard_size(int hops); uint64_t get_time_milliseconds(); void memset_zero(void *v, size_t n); #endif /* STORJ_UTILS_H */
/** * @file utils.h * @brief Storj utilities. * * Helper utilities */ #ifndef STORJ_UTILS_H #define STORJ_UTILS_H #include <assert.h> #include <stdint.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <stdarg.h> #include <math.h> #include <stdbool.h> #ifdef _WIN32 #include <windows.h> #include <time.h> #include <io.h> ssize_t pread(int fd, void *buf, size_t count, uint64_t offset); #else #include <sys/time.h> #endif int hex2str(unsigned length, uint8_t *data, char *buffer); void print_int_array(uint8_t *array, unsigned length); int str2hex(unsigned length, char *data, uint8_t *buffer); char *str_concat_many(int count, ...); void random_buffer(uint8_t *buf, size_t len); uint64_t shard_size(int hops); uint64_t get_time_milliseconds(); void memset_zero(void *v, size_t n); #endif /* STORJ_UTILS_H */
Include io.h for mingw builds
Include io.h for mingw builds
C
lgpl-2.1
braydonf/libstorj,braydonf/libstorj-c,Storj/libstorj-c,braydonf/libstorj-c,Storj/libstorj-c,aleitner/libstorj-c,aleitner/libstorj-c,braydonf/libstorj
8c47da315e5e6f11bb43c8fa66a2a66fbdaf7b9d
percolation/main.c
percolation/main.c
/* headers */ #include <stdlib.h> #include <time.h> #include "lattice.h" #include "clusters.h" #include "io_helpers.h" /* main body function */ int main(int argc, char ** argv) { int L; /* square lattice size */ double p; /* occupation probability of each lattice site */ int *lattice; /* lattice array */ /* read input arguments; if none provided fallback to default values */ if (argc == 3) { L = atoi(argv[1]); p = atof(argv[2]); } else { L = 10; p = 0.4; } /* initialize random number generator seed */ srand(time(NULL)); /* allocate lattice */ lattice = allocate_lattice(L, L); /* populate lattice with given probability */ populate_lattice(p, lattice, L, L); /* print the generated lattice for visualization */ print_lattice(lattice, L, L, 1); /* label clusters and print result */ label_clusters(lattice, L, L); print_lattice(lattice, L, L, 1); /* free memory before leaving */ free(lattice); return 0; }
/* headers */ #include <stdlib.h> #include <time.h> #include "lattice.h" #include "clusters.h" #include "io_helpers.h" /* main body function */ int main(int argc, char ** argv) { int L; /* square lattice size */ double p; /* occupation probability of each lattice site */ int *lattice; /* lattice array */ unsigned int random_seed; /* random number generator seed */ /* read input arguments; if none provided fallback to default values */ if (argc == 3 || argc == 4) { L = atoi(argv[1]); p = atof(argv[2]); if (argc == 4) { random_seed = atoi(argv[3]); } else { random_seed = (unsigned int)time(NULL); } } else { L = 10; p = 0.4; random_seed = (unsigned int)time(NULL); } /* initialize random number generator seed */ srand(random_seed); /* allocate lattice */ lattice = allocate_lattice(L, L); /* populate lattice with given probability */ populate_lattice(p, lattice, L, L); /* print the generated lattice for visualization */ print_lattice(lattice, L, L, 1); /* label clusters and print result */ label_clusters(lattice, L, L); print_lattice(lattice, L, L, 1); /* free memory before leaving */ free(lattice); return 0; }
Allow passing RNG seed as program argument
[percolation] Allow passing RNG seed as program argument
C
mit
cerisola/fiscomp,cerisola/fiscomp,cerisola/fiscomp
ffe8c67712cb6a7286de055ecf7ecf90c0984831
ch1/e01-01_hello.c
ch1/e01-01_hello.c
/* * Hello World Program * 2013-05-27 */ #include <stdio.h> int main() { printf("Hello, World!\g"); return 0; }
/* * Hello World Program * 2013-05-27 */ #include <stdio.h> int main() { printf("Hello, World!\n"); return 0; }
Add the BSD make build machinery
Add the BSD make build machinery
C
isc
chettrick/tcpl
f83df7374019f922bd30cb751b1206c5f934f7d1
include/config/SkUserConfigManual.h
include/config/SkUserConfigManual.h
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkUserConfigManual_DEFINED #define SkUserConfigManual_DEFINED #define GR_TEST_UTILS 1 #define SK_BUILD_FOR_ANDROID_FRAMEWORK #define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024) #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024) #define SK_USE_FREETYPE_EMBOLDEN // Disable these Ganesh features #define SK_DISABLE_REDUCE_OPLIST_SPLITTING // Check error is expensive. HWUI historically also doesn't check its allocations #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0 // Legacy flags #define SK_IGNORE_GPU_DITHER #define SK_SUPPORT_DEPRECATED_CLIPOPS // Staging flags #define SK_LEGACY_PATH_ARCTO_ENDPOINT // Needed until we fix https://bug.skia.org/2440 #define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG #define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER #define SK_SUPPORT_LEGACY_AA_CHOICE #define SK_SUPPORT_LEGACY_AAA_CHOICE #define SK_DISABLE_DAA // skbug.com/6886 #endif // SkUserConfigManual_DEFINED
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkUserConfigManual_DEFINED #define SkUserConfigManual_DEFINED #define GR_TEST_UTILS 1 #define SK_BUILD_FOR_ANDROID_FRAMEWORK #define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024) #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024) #define SK_USE_FREETYPE_EMBOLDEN // Disable these Ganesh features #define SK_DISABLE_REDUCE_OPLIST_SPLITTING // Check error is expensive. HWUI historically also doesn't check its allocations #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0 // Legacy flags #define SK_IGNORE_GPU_DITHER #define SK_SUPPORT_DEPRECATED_CLIPOPS // Staging flags #define SK_LEGACY_PATH_ARCTO_ENDPOINT #define SK_SUPPORT_LEGACY_MATRIX_IMAGEFILTER // Needed until we fix https://bug.skia.org/2440 #define SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG #define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER #define SK_SUPPORT_LEGACY_AA_CHOICE #define SK_SUPPORT_LEGACY_AAA_CHOICE #define SK_DISABLE_DAA // skbug.com/6886 #endif // SkUserConfigManual_DEFINED
Add flag to stage api change
Add flag to stage api change Test: make Bug: 178700363 Change-Id: I8b22d1436260eafca1819e3210b4bea559be7142
C
bsd-3-clause
aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia
259c5e15797f2de45550a037ecc64975a86c4fd9
sys/sun4v/include/clock.h
sys/sun4v/include/clock.h
/*- * Copyright (c) 2001 Jake Burkholder. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _MACHINE_CLOCK_H_ #define _MACHINE_CLOCK_H_ extern u_long tick_increment; extern u_long tick_freq; extern u_long tick_MHz; extern int adjkerntz; extern int wall_cmos_clock; #endif /* !_MACHINE_CLOCK_H_ */
/*- * Copyright (c) 2001 Jake Burkholder. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _MACHINE_CLOCK_H_ #define _MACHINE_CLOCK_H_ extern u_long tick_increment; extern u_long tick_freq; extern u_long tick_MHz; #endif /* !_MACHINE_CLOCK_H_ */
Remove two variables which are handled MI now.
Remove two variables which are handled MI now.
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
ad8eee60c7ece602d54a98a904d04455a63e979b
cli/main.c
cli/main.c
#include <stdio.h> #include "ot.h" #include "otdecode.h" int main(int argc, const char * argv[]) { char buf[1024]; fputs("Operation 1: ", stdout); fgets(buf, 1024, stdin); char p[64]; ot_op* op = ot_new_op(0, p); ot_decode_err err = ot_decode(op, buf); if (err != OT_ERR_NONE) { puts("Error when decoding JSON."); return err; } char buf2[1024]; fputs("Operation 2: ", stdout); fgets(buf2, 1024, stdin); ot_op* op2 = ot_new_op(0, p); err = ot_decode(op2, buf2); if (err != OT_ERR_NONE) { puts("Error when decoding JSON."); return err; } ot_op* composed = ot_compose(op, op2); char* snapshot = ot_snapshot(composed); puts("Composed: "); puts(snapshot); return 0; }
#include <stdio.h> #include "ot.h" #include "compose.h" #include "otdecode.h" int main(int argc, const char * argv[]) { char buf[1024]; fputs("Operation 1: ", stdout); fgets(buf, 1024, stdin); char p[64]; ot_op* op = ot_new_op(0, p); ot_decode_err err = ot_decode(op, buf); if (err != OT_ERR_NONE) { puts("Error when decoding JSON."); return err; } char buf2[1024]; fputs("Operation 2: ", stdout); fgets(buf2, 1024, stdin); ot_op* op2 = ot_new_op(0, p); err = ot_decode(op2, buf2); if (err != OT_ERR_NONE) { puts("Error when decoding JSON."); return err; } ot_op* composed = ot_compose(op, op2); char* snapshot = ot_snapshot(composed); puts("Composed: "); puts(snapshot); return 0; }
Add compose header to CLI
Add compose header to CLI
C
apache-2.0
polyphony-ot/libot
d31bc5e3c46005c363c656c31436a29ddd975c7f
test/srcs/11-omp-for.c
test/srcs/11-omp-for.c
#include <omp.h> #include <stdio.h> #include <stdlib.h> #include <math.h> int main() { double sinTable[256]; #pragma omp parallel for for(int n=0; n<256; ++n) sinTable[n] = sin(2 * M_PI * n / 256); // the table is now initialized } // RUN: clang -fopenmp -c -g -emit-llvm %s -o %t.1.bc // RUN: opt -instnamer %t.1.bc -o %t.bc // RUN: llvm-epp %t.bc -o %t.profile // RUN: clang -fopenmp -v %t.epp.bc -o %t-exec -lepp-rt -lpthread -lm 2> %t.compile // RUN: %t-exec > %t.log // RUN: llvm-epp -p=%t.profile %t.bc 2> %t.decode // RUN: diff -aub %t.profile %s.txt
#include <omp.h> #include <stdio.h> #include <stdlib.h> #include <math.h> int main() { double sinTable[256]; #pragma omp parallel for for(int n=0; n<256; ++n) sinTable[n] = sin(2 * M_PI * n / 256); // the table is now initialized } // RUN: clang -fopenmp -c -g -emit-llvm %s -o %t.1.bc // RUN: opt -instnamer %t.1.bc -o %t.bc // RUN: llvm-epp %t.bc -o %t.profile // RUN: clang -fopenmp -v %t.epp.bc -o %t-exec -lepp-rt -lpthread -lm 2> %t.compile // RUN: OMP_NUM_THREADS=4 %t-exec > %t.log // RUN: llvm-epp -p=%t.profile %t.bc 2> %t.decode // RUN: diff -aub %t.profile %s.txt
Fix test case 11 to set the number of omp threads and make it portable
Fix test case 11 to set the number of omp threads and make it portable
C
mit
sfu-arch/llvm-epp,sfu-arch/llvm-epp,sfu-arch/llvm-epp
99f7c07130859fd5ee7b0343e9dedcde48ca9f02
extension/kill.c
extension/kill.c
/* A simple Lua module to suspend this process. */ #include <sys/types.h> #include <signal.h> #include <unistd.h> #include <lua.h> #include <lauxlib.h> int l_kill(lua_State *L) { /* Send ourselves the terminal stop signal, equivalent to normally * pressing ^Z. */ kill(0, SIGTSTP); return 0; } /* The module's functions */ struct luaL_Reg functions[] = { { "kill", l_kill }, { 0, 0 }, }; /* Called when importing this module */ int luaopen_kill(lua_State *L) { luaL_newlib(L, functions); return 1; }
/* A simple Lua module to suspend this process. */ #include <sys/types.h> #include <signal.h> #include <unistd.h> #include <lua.h> #include <lauxlib.h> int l_kill(lua_State *L) { /* Send ourselves the terminal stop signal, equivalent to normally * pressing ^Z. */ kill(0, SIGTSTP); /* We may have been restored after a window change; pretend we've * received a WINCH. */ kill(0, SIGWINCH); return 0; } /* The module's functions */ struct luaL_Reg functions[] = { { "kill", l_kill }, { 0, 0 }, }; /* Called when importing this module */ int luaopen_kill(lua_State *L) { luaL_newlib(L, functions); return 1; }
Handle the terminal resizing while suspended, by sending ourselves a SIGWINCH after restoring.
Handle the terminal resizing while suspended, by sending ourselves a SIGWINCH after restoring.
C
mit
erig0/textadept-vi,jugglerchris/textadept-vi,jugglerchris/textadept-vi
e2ee2dab59a8367c3a94f0d7ed74d29e5236b16c
include/stdlib.h
include/stdlib.h
/* * Copyright (C) 2014, Galois, Inc. * This sotware is distributed under a standard, three-clause BSD license. * Please see the file LICENSE, distributed with this software, for specific * terms and conditions. */ #ifndef MINLIBC_STDLIB_H #define MINLIBC_STDLIB_H #define NULL 0 #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 typedef unsigned long int size_t; double atof(const char *nptr); int atoi(const char *nptr); long int strtol(const char *nptr, char **endptr, int base); char *getenv(const char *name); void abort(void); void exit(int status); void *malloc(size_t size); void *realloc(void *ptr, size_t size); void *calloc(size_t nmemb, size_t size); void free(void *ptr); int mkstemp(char *template); void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *)); int putenv(char *str); int unsetenv(const char *name); #endif
/* * Copyright (C) 2014, Galois, Inc. * This sotware is distributed under a standard, three-clause BSD license. * Please see the file LICENSE, distributed with this software, for specific * terms and conditions. */ #ifndef MINLIBC_STDLIB_H #define MINLIBC_STDLIB_H #define NULL 0 #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 typedef unsigned long int size_t; double atof(const char *nptr); int atoi(const char *nptr); long int strtol(const char *nptr, char **endptr, int base); char *getenv(const char *name); void abort(void); void exit(int status); void *malloc(size_t size); void *realloc(void *ptr, size_t size); void *calloc(size_t nmemb, size_t size); void free(void *ptr); int mkstemp(char *template); void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *)); int putenv(char *str); int unsetenv(const char *name); int abs(int j); #endif
Add a prototype for abs().
Add a prototype for abs().
C
bsd-3-clause
GaloisInc/minlibc,GaloisInc/minlibc
ff603e2fa35e8e1ee2744e5ed5817845fdcca666
server/types/JoinableImpl.h
server/types/JoinableImpl.h
#ifndef JOINABLE_IMPL #define JOINABLE_IMPL #include "joinable_types.h" #include "types/MediaObjectImpl.h" using ::com::kurento::kms::api::Joinable; using ::com::kurento::kms::api::Direction; namespace com { namespace kurento { namespace kms { class JoinableImpl : public virtual Joinable, public virtual MediaObjectImpl { public: JoinableImpl(); ~JoinableImpl() throw() {}; void join(const JoinableImpl& to, const Direction::type direction); void unjoin(const JoinableImpl& to); std::vector<Joinable> &getJoinees(); std::vector<Joinable> &getDirectionJoiness(const Direction::type direction); }; }}} // com::kurento::kms #endif /* JOINABLE_IMPL */
#ifndef JOINABLE_IMPL #define JOINABLE_IMPL #include "joinable_types.h" #include "types/MediaObjectImpl.h" using ::com::kurento::kms::api::Joinable; using ::com::kurento::kms::api::Direction; using ::com::kurento::kms::api::StreamType; namespace com { namespace kurento { namespace kms { class JoinableImpl : public virtual Joinable, public virtual MediaObjectImpl { public: JoinableImpl(); ~JoinableImpl() throw() {}; std::vector<StreamType::type> getStreams(const Joinable& joinable); void join(const JoinableImpl& to, const Direction::type direction); void unjoin(const JoinableImpl& to); void join(const JoinableImpl& to, const StreamType::type stream, const Direction::type direction); void unjoin(const JoinableImpl& to, const StreamType::type stream); std::vector<Joinable> &getJoinees(); std::vector<Joinable> &getDirectionJoiness(const Direction::type direction); std::vector<Joinable> &getJoinees(const StreamType::type stream); std::vector<Joinable> &getDirectionJoiness(const StreamType::type stream, const Direction::type direction); }; }}} // com::kurento::kms #endif /* JOINABLE_IMPL */
Add methods to joinable to handle streams
Add methods to joinable to handle streams
C
lgpl-2.1
shelsonjava/kurento-media-server,mparis/kurento-media-server,Kurento/kurento-media-server,Kurento/kurento-media-server,lulufei/kurento-media-server,lulufei/kurento-media-server,mparis/kurento-media-server,TribeMedia/kurento-media-server,todotobe1/kurento-media-server,shelsonjava/kurento-media-server,todotobe1/kurento-media-server,TribeMedia/kurento-media-server
82941052dcbfa55dc20a02e0bb329e693d546477
proctor/include/pcl/proctor/proposer.h
proctor/include/pcl/proctor/proposer.h
#ifndef PROPOSER_H #define PROPOSER_H #include <boost/shared_ptr.hpp> #include <vector> #include <map> #include "proctor/detector.h" #include "proctor/database_entry.h" namespace pcl { namespace proctor { struct Candidate { std::string id; float votes; }; class Proposer { public: typedef boost::shared_ptr<Proposer> Ptr; typedef boost::shared_ptr<const Proposer> ConstPtr; typedef boost::shared_ptr<std::map<std::string, Entry> > DatabasePtr; typedef boost::shared_ptr<const std::map<std::string, Entry> > ConstDatabasePtr; Proposer() {} void setDatabase(const DatabasePtr database) { database_ = database; } virtual void getProposed(int max_num, Entry &query, std::vector<std::string> &input, std::vector<std::string> &output) = 0; virtual void selectBestCandidates(int max_num, vector<Candidate> &ballot, std::vector<std::string> &output); protected: DatabasePtr database_; }; } } #endif
#ifndef PROPOSER_H #define PROPOSER_H #include <boost/shared_ptr.hpp> #include <vector> #include <map> #include "proctor/detector.h" #include "proctor/database_entry.h" namespace pcl { namespace proctor { struct Candidate { std::string id; double votes; }; class Proposer { public: typedef boost::shared_ptr<Proposer> Ptr; typedef boost::shared_ptr<const Proposer> ConstPtr; typedef boost::shared_ptr<std::map<std::string, Entry> > DatabasePtr; typedef boost::shared_ptr<const std::map<std::string, Entry> > ConstDatabasePtr; Proposer() {} void setDatabase(const DatabasePtr database) { database_ = database; } virtual void getProposed(int max_num, Entry &query, std::vector<std::string> &input, std::vector<std::string> &output) = 0; virtual void selectBestCandidates(int max_num, vector<Candidate> &ballot, std::vector<std::string> &output); protected: DatabasePtr database_; }; } } #endif
Change votes to use double.
Change votes to use double. git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@4320 a9d63959-f2ad-4865-b262-bf0e56cfafb6
C
bsd-3-clause
fanxiaochen/mypcltest,nikste/pcl,nh2/pcl,3dtof/pcl,stfuchs/pcl,ipa-rmb/pcl,chenxingzhe/pcl,cascheberg/pcl,msalvato/pcl_kinfu_highres,KevenRing/vlp,v4hn/pcl,stefanbuettner/pcl,shivmalhotra/pcl,stefanbuettner/pcl,msalvato/pcl_kinfu_highres,RufaelDev/pcc-mp3dg,jakobwilm/pcl,lydhr/pcl,stfuchs/pcl,LZRS/pcl,LZRS/pcl,srbhprajapati/pcl,RufaelDev/pcc-mp3dg,3dtof/pcl,KevenRing/pcl,jeppewalther/kinfu_segmentation,mschoeler/pcl,starius/pcl,shyamalschandra/pcl,zavataafnan/pcl-truck,jakobwilm/pcl,fskuka/pcl,lydhr/pcl,chenxingzhe/pcl,damienjadeduff/pcl,locnx1984/pcl,cascheberg/pcl,jeppewalther/kinfu_segmentation,KevenRing/pcl,KevenRing/pcl,stefanbuettner/pcl,srbhprajapati/pcl,krips89/pcl_newfeatures,starius/pcl,krips89/pcl_newfeatures,nikste/pcl,kanster/pcl,pkuhto/pcl,MMiknis/pcl,jeppewalther/kinfu_segmentation,chenxingzhe/pcl,starius/pcl,wgapl/pcl,DaikiMaekawa/pcl,chenxingzhe/pcl,fskuka/pcl,ResByte/pcl,raydtang/pcl,KevenRing/pcl,the-glu/pcl,chatchavan/pcl,shivmalhotra/pcl,Tabjones/pcl,kanster/pcl,v4hn/pcl,jakobwilm/pcl,raydtang/pcl,cascheberg/pcl,closerbibi/pcl,drmateo/pcl,raydtang/pcl,mikhail-matrosov/pcl,stfuchs/pcl,drmateo/pcl,mikhail-matrosov/pcl,lydhr/pcl,fanxiaochen/mypcltest,KevenRing/vlp,soulsheng/pcl,ResByte/pcl,KevenRing/vlp,ipa-rmb/pcl,Nerei/pcl_old_repo,srbhprajapati/pcl,v4hn/pcl,DaikiMaekawa/pcl,damienjadeduff/pcl,Tabjones/pcl,closerbibi/pcl,damienjadeduff/pcl,ResByte/pcl,zhangxaochen/pcl,chatchavan/pcl,locnx1984/pcl,shivmalhotra/pcl,raydtang/pcl,chenxingzhe/pcl,Tabjones/pcl,wgapl/pcl,RufaelDev/pcc-mp3dg,v4hn/pcl,zhangxaochen/pcl,simonleonard/pcl,KevenRing/pcl,sbec/pcl,starius/pcl,jeppewalther/kinfu_segmentation,wgapl/pcl,v4hn/pcl,closerbibi/pcl,DaikiMaekawa/pcl,fanxiaochen/mypcltest,locnx1984/pcl,mikhail-matrosov/pcl,closerbibi/pcl,soulsheng/pcl,stefanbuettner/pcl,lydhr/pcl,zhangxaochen/pcl,shyamalschandra/pcl,jakobwilm/pcl,pkuhto/pcl,lebronzhang/pcl,krips89/pcl_newfeatures,Tabjones/pcl,MMiknis/pcl,zavataafnan/pcl-truck,shyamalschandra/pcl,Tabjones/pcl,lebronzhang/pcl,zhangxaochen/pcl,ipa-rmb/pcl,zhangxaochen/pcl,MMiknis/pcl,Nerei/pcl_old_repo,simonleonard/pcl,wgapl/pcl,soulsheng/pcl,pkuhto/pcl,soulsheng/pcl,drmateo/pcl,msalvato/pcl_kinfu_highres,wgapl/pcl,stfuchs/pcl,lebronzhang/pcl,locnx1984/pcl,jeppewalther/kinfu_segmentation,ResByte/pcl,LZRS/pcl,fskuka/pcl,DaikiMaekawa/pcl,stfuchs/pcl,ipa-rmb/pcl,lebronzhang/pcl,ResByte/pcl,LZRS/pcl,fanxiaochen/mypcltest,kanster/pcl,nh2/pcl,damienjadeduff/pcl,drmateo/pcl,kanster/pcl,mikhail-matrosov/pcl,sbec/pcl,KevenRing/vlp,sbec/pcl,stefanbuettner/pcl,shyamalschandra/pcl,nikste/pcl,shangwuhencc/pcl,cascheberg/pcl,fskuka/pcl,RufaelDev/pcc-mp3dg,chatchavan/pcl,the-glu/pcl,nikste/pcl,the-glu/pcl,pkuhto/pcl,drmateo/pcl,MMiknis/pcl,chatchavan/pcl,cascheberg/pcl,nh2/pcl,MMiknis/pcl,simonleonard/pcl,zavataafnan/pcl-truck,krips89/pcl_newfeatures,raydtang/pcl,jakobwilm/pcl,fskuka/pcl,3dtof/pcl,lebronzhang/pcl,closerbibi/pcl,pkuhto/pcl,nh2/pcl,locnx1984/pcl,DaikiMaekawa/pcl,3dtof/pcl,LZRS/pcl,mschoeler/pcl,mschoeler/pcl,mikhail-matrosov/pcl,sbec/pcl,kanster/pcl,starius/pcl,fanxiaochen/mypcltest,RufaelDev/pcc-mp3dg,msalvato/pcl_kinfu_highres,damienjadeduff/pcl,mschoeler/pcl,sbec/pcl,mschoeler/pcl,krips89/pcl_newfeatures,srbhprajapati/pcl,zavataafnan/pcl-truck,shangwuhencc/pcl,simonleonard/pcl,Nerei/pcl_old_repo,soulsheng/pcl,nikste/pcl,lydhr/pcl,shangwuhencc/pcl,the-glu/pcl,ipa-rmb/pcl,KevenRing/vlp,zavataafnan/pcl-truck,srbhprajapati/pcl,the-glu/pcl,simonleonard/pcl,shivmalhotra/pcl,shangwuhencc/pcl,3dtof/pcl,shangwuhencc/pcl,shivmalhotra/pcl,shyamalschandra/pcl,Nerei/pcl_old_repo,msalvato/pcl_kinfu_highres
7ff3d12d44a03d407f53233d1247370bd85c455b
kalarmd/compat.h
kalarmd/compat.h
/* KDE2 compatibility for KDE Alarm Daemon and KDE Alarm Daemon GUI. This file is part of the KDE alarm daemon. Copyright (c) 2001 David Jarvie <software@astrojar.org.uk> 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. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AD_COMPAT_H #define AD_COMPAT_H // Compatibility with KDE 2.2 #include <qglobal.h> #if QT_VERSION < 300 #define QPtrList QList #define QPtrListIterator QListIterator #endif #include <kapp.h> #if KDE_VERSION < 290 #define Alarm KOAlarm #endif #endif
/* KDE2 compatibility for KDE Alarm Daemon and KDE Alarm Daemon GUI. This file is part of the KDE alarm daemon. Copyright (c) 2001 David Jarvie <software@astrojar.org.uk> 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. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef AD_COMPAT_H #define AD_COMPAT_H // Compatibility with KDE 2.2 #include <qglobal.h> #if QT_VERSION < 300 #define QPtrList QList #define QPtrListIterator QListIterator #endif #include <kapp.h> #if KDE_VERSION < 290 #define Alarm KOAlarm #define uid VUID #endif #endif
Adjust for changes in libkcal
Adjust for changes in libkcal svn path=/trunk/kdepim/; revision=133733
C
lgpl-2.1
lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi
0db041be3be9c84c2949a4f7eb9c3b6cd80ae97c
arch/openrisc/kernel/vmlinux.h
arch/openrisc/kernel/vmlinux.h
#ifndef __OPENRISC_VMLINUX_H_ #define __OPENRISC_VMLINUX_H_ #ifdef CONFIG_BLK_DEV_INITRD extern char __initrd_start, __initrd_end; extern char __initramfs_start; #endif extern u32 __dtb_start[]; #endif
#ifndef __OPENRISC_VMLINUX_H_ #define __OPENRISC_VMLINUX_H_ #ifdef CONFIG_BLK_DEV_INITRD extern char __initrd_start, __initrd_end; #endif extern u32 __dtb_start[]; #endif
Remove unused declaration of __initramfs_start
openrisc: Remove unused declaration of __initramfs_start Signed-off-by: Geert Uytterhoeven <0da414d9d963da4039c2a0525b1844228075aa58@linux-m68k.org> Signed-off-by: Jonas Bonn <35a2c6fae61f8077aab61faa4019722abf05093c@southpole.se>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
3b9b66171c55dfa3e1907c6ea7f9e200652936a0
GCMCocoaExtensions/GCMCocoaExtensions/GCMDeviceInfo.h
GCMCocoaExtensions/GCMCocoaExtensions/GCMDeviceInfo.h
// // GCMDeviceInfo.h // GCMCocoaExtensions // // Created by Jerry Hsu on 11/26/13. // Copyright (c) 2013 GameChanger. All rights reserved. // #import <Foundation/Foundation.h> #define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) #define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) #define IOS7_OR_GREATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0") #define PRE_IOS7 SYSTEM_VERSION_LESS_THAN(@"7.0") @interface GCMDeviceInfo : NSObject + (BOOL)isRetinaDisplay; + (BOOL)iPad; @end
// // GCMDeviceInfo.h // GCMCocoaExtensions // // Created by Jerry Hsu on 11/26/13. // Copyright (c) 2013 GameChanger. All rights reserved. // #import <Foundation/Foundation.h> #define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) #define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) #define IOS7_OR_GREATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0") #define PRE_IOS7 SYSTEM_VERSION_LESS_THAN(@"7.0") #define IOS8_OR_GREATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0") #define PRE_IOS8 SYSTEM_VERSION_LESS_THAN(@"8.0") @interface GCMDeviceInfo : NSObject + (BOOL)isRetinaDisplay; + (BOOL)iPad; @end
Add macros to check for iOS 8
Add macros to check for iOS 8
C
mit
gamechanger/GCMCocoaExtensions,gamechanger/GCMCocoaExtensions,gamechanger/GCMCocoaExtensions
b1382587216ff7fc6a3c0a664d5546c3ec9b594f
components/Echo/src/echo.c
components/Echo/src/echo.c
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #include <Echo.h> #include <string.h> void b__init(void) { } char * b_echo_string(char *s) { return strdup(s); } int b_echo_int(int i) { return i; } float b_echo_float(float f) { return f; } double b_echo_double(double d) { return d; } int b_echo_mix(double d) { return d; } int b_echo_parameter(int pin, int *pout) { *pout = pin; return pin; } void b_increment_parameter(int *x) { *x = *x + 1; }
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #include <Echo.h> #include <string.h> void b__init(void) { } char * b_echo_string(const char *s) { return strdup(s); } int b_echo_int(int i) { return i; } float b_echo_float(float f) { return f; } double b_echo_double(double d) { return d; } int b_echo_mix(double d) { return d; } int b_echo_parameter(int pin, int *pout) { *pout = pin; return pin; } void b_increment_parameter(int *x) { *x = *x + 1; }
Adjust RPC parameter qualification for CAmkES changes.
Adjust RPC parameter qualification for CAmkES changes.
C
bsd-2-clause
seL4/camkes-apps-simple--devel
03763a26c09855a4ebf565ea7550c9f255e26e4d
include/libtrading/proto/fast_feed.h
include/libtrading/proto/fast_feed.h
#ifndef LIBTRADING_FAST_FEED_H #define LIBTRADING_FAST_FEED_H #include "libtrading/proto/fast_session.h" #include <sys/socket.h> #include <sys/types.h> struct fast_feed { struct fast_session *session; struct fast_session_cfg cfg; u64 recv_num; char xml[128]; char lip[32]; char sip[32]; char ip[32]; bool active; int port; }; static inline int socket_setopt(int sockfd, int level, int optname, int optval) { return setsockopt(sockfd, level, optname, (void *) &optval, sizeof(optval)); } static inline struct fast_message *fast_feed_recv(struct fast_feed *feed, int flags) { return fast_session_recv(feed->session, flags); } int fast_feed_close(struct fast_feed *feed); int fast_feed_open(struct fast_feed *feed); #endif /* LIBTRADING_FAST_FEED_H */
#ifndef LIBTRADING_FAST_FEED_H #define LIBTRADING_FAST_FEED_H #include "libtrading/proto/fast_session.h" #include <sys/socket.h> #include <sys/types.h> struct fast_feed { struct fast_session *session; struct fast_session_cfg cfg; u64 recv_num; char xml[128]; char lip[32]; char sip[32]; char ip[32]; bool active; int port; }; static inline int socket_setopt(int sockfd, int level, int optname, int optval) { return setsockopt(sockfd, level, optname, (void *) &optval, sizeof(optval)); } static inline struct fast_message *fast_feed_recv(struct fast_feed *feed, int flags) { if (feed->session->reset) fast_session_reset(feed->session); return fast_session_recv(feed->session, flags); } int fast_feed_close(struct fast_feed *feed); int fast_feed_open(struct fast_feed *feed); #endif /* LIBTRADING_FAST_FEED_H */
Reset a session if implicit reset option is set
FAST: Reset a session if implicit reset option is set Signed-off-by: Marat Stanichenko <146c4a279a7427b2cc19a19b6130cbb7ee404ab1@gmail.com> Signed-off-by: Pekka Enberg <add4fcd06328a394f0ad91feda7ee057316dc5ed@kernel.org>
C
bsd-2-clause
jvirtanen/libtrading,divaykin/libtrading,libtrading/libtrading,mstanichenko/libtrading,divaykin/libtrading,libtrading/libtrading,svdev/libtrading,penberg/libtrading,fengzhyuan/libtrading,femtotrader/libtrading,penberg/libtrading,NunoEdgarGub1/libtrading,etoestja/libtrading,mstanichenko/libtrading,Bitcoinsulting/libtrading,jvirtanen/libtrading,fengzhyuan/libtrading,etoestja/libtrading,femtotrader/libtrading,svdev/libtrading,NunoEdgarGub1/libtrading,Bitcoinsulting/libtrading
85dec0bf899ac18477920095ad381a7443f800b6
cpp/log/cert_submission_handler.h
cpp/log/cert_submission_handler.h
#ifndef CERT_SUBMISSION_HANDLER_H #define CERT_SUBMISSION_HANDLER_H #include <string> #include "base/macros.h" #include "log/cert_checker.h" #include "proto/ct.pb.h" #include "proto/serializer.h" #include "util/status.h" // Parse incoming submissions, do preliminary sanity checks and pass them // through cert checker. // Prepare for signing by parsing the input into an appropriate // log entry structure. class CertSubmissionHandler { public: // Does not take ownership of the cert_checker. explicit CertSubmissionHandler(const cert_trans::CertChecker* cert_checker); // These may change |chain|. // TODO(pphaneuf): These could return StatusOr<ct::LogEntry>. util::Status ProcessX509Submission(cert_trans::CertChain* chain, ct::LogEntry* entry) const; util::Status ProcessPreCertSubmission(cert_trans::PreCertChain* chain, ct::LogEntry* entry) const; // For clients, to reconstruct the bytestring under the signature // from the observed chain. Does not check whether the entry // has valid format (i.e., does not check length limits). static bool X509ChainToEntry(const cert_trans::CertChain& chain, ct::LogEntry* entry); const std::multimap<std::string, const cert_trans::Cert*>& GetRoots() const { return cert_checker_->GetTrustedCertificates(); } private: const cert_trans::CertChecker* const cert_checker_; DISALLOW_COPY_AND_ASSIGN(CertSubmissionHandler); }; #endif
#ifndef CERT_SUBMISSION_HANDLER_H #define CERT_SUBMISSION_HANDLER_H #include <string> #include "base/macros.h" #include "log/cert_checker.h" #include "proto/ct.pb.h" #include "proto/serializer.h" #include "util/status.h" // Parse incoming submissions, do preliminary sanity checks and pass them // through cert checker. // Prepare for signing by parsing the input into an appropriate // log entry structure. class CertSubmissionHandler { public: // Does not take ownership of the cert_checker. explicit CertSubmissionHandler(const cert_trans::CertChecker* cert_checker); // These may change |chain|. // TODO(pphaneuf): These could return StatusOr<ct::LogEntry>. util::Status ProcessX509Submission(cert_trans::CertChain* chain, ct::LogEntry* entry) const; util::Status ProcessPreCertSubmission(cert_trans::PreCertChain* chain, ct::LogEntry* entry) const; // For clients, to reconstruct the bytestring under the signature // from the observed chain. Does not check whether the entry // has valid format (i.e., does not check length limits). static bool X509ChainToEntry(const cert_trans::CertChain& chain, ct::LogEntry* entry); private: const cert_trans::CertChecker* const cert_checker_; DISALLOW_COPY_AND_ASSIGN(CertSubmissionHandler); }; #endif
Remove the unused CertSubmissionHandler::GetRoots method.
Remove the unused CertSubmissionHandler::GetRoots method.
C
apache-2.0
taknira/certificate-transparency,taknira/certificate-transparency,kyprizel/certificate-transparency,phad/certificate-transparency,AlCutter/certificate-transparency,lexibrent/certificate-transparency,pphaneuf/certificate-transparency,grandamp/certificate-transparency,AlCutter/certificate-transparency,lexibrent/certificate-transparency,eranmes/certificate-transparency,benlaurie/certificate-transparency,grandamp/certificate-transparency,eranmes/certificate-transparency,kyprizel/certificate-transparency,kyprizel/certificate-transparency,AlCutter/certificate-transparency,katjoyce/certificate-transparency,lexibrent/certificate-transparency,katjoyce/certificate-transparency,kyprizel/certificate-transparency,eranmes/certificate-transparency,AlCutter/certificate-transparency,RJPercival/certificate-transparency,AlCutter/certificate-transparency,katjoyce/certificate-transparency,phad/certificate-transparency,katjoyce/certificate-transparency,grandamp/certificate-transparency,google/certificate-transparency,eranmes/certificate-transparency,katjoyce/certificate-transparency,kyprizel/certificate-transparency,taknira/certificate-transparency,RJPercival/certificate-transparency,eranmes/certificate-transparency,kyprizel/certificate-transparency,taknira/certificate-transparency,lexibrent/certificate-transparency,benlaurie/certificate-transparency,benlaurie/certificate-transparency,benlaurie/certificate-transparency,RJPercival/certificate-transparency,AlCutter/certificate-transparency,taknira/certificate-transparency,taknira/certificate-transparency,katjoyce/certificate-transparency,eranmes/certificate-transparency,pphaneuf/certificate-transparency,AlCutter/certificate-transparency,eranmes/certificate-transparency,google/certificate-transparency,katjoyce/certificate-transparency,RJPercival/certificate-transparency,taknira/certificate-transparency,benlaurie/certificate-transparency,google/certificate-transparency,pphaneuf/certificate-transparency,phad/certificate-transparency,grandamp/certificate-transparency,benlaurie/certificate-transparency,kyprizel/certificate-transparency,benlaurie/certificate-transparency,phad/certificate-transparency,google/certificate-transparency,pphaneuf/certificate-transparency
b47d70c9531f082cad01e3dd0aa5f1b9827a04b7
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2012 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.03.00-k1"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2012 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.03.00-k2"
Update driver version to 5.03.00-k2
[SCSI] qla4xxx: Update driver version to 5.03.00-k2 Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com> Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
1ceb72f88deed9c7e12ea0a2fe29fb30e4385adb
Socialize/SZSmartAlertUtils.h
Socialize/SZSmartAlertUtils.h
// // SZSmartAlertUtils.h // SocializeSDK // // Created by Nathaniel Griswold on 6/4/12. // Copyright (c) 2012 Socialize, Inc. All rights reserved. // #import <Foundation/Foundation.h> @interface SZSmartAlertUtils : NSObject + (BOOL)isAvailable; + (BOOL)handleNotification:(NSDictionary*)userInfo __attribute__((deprecated("Please use `openNotification:` (which unconditionally opens the notification), instead"))); + (BOOL)isSocializeNotification:(NSDictionary*)userInfo; + (void)registerDeviceToken:(NSData*)deviceToken; + (BOOL)openNotification:(NSDictionary*)userInfo; @end
// // SZSmartAlertUtils.h // SocializeSDK // // Created by Nathaniel Griswold on 6/4/12. // Copyright (c) 2012 Socialize, Inc. All rights reserved. // #import <Foundation/Foundation.h> @interface SZSmartAlertUtils : NSObject + (BOOL)isAvailable; + (BOOL)handleNotification:(NSDictionary*)userInfo; // __attribute__((deprecated("Please use `openNotification:` (which unconditionally opens the notification), instead"))); + (BOOL)isSocializeNotification:(NSDictionary*)userInfo; + (void)registerDeviceToken:(NSData*)deviceToken; + (BOOL)openNotification:(NSDictionary*)userInfo; @end
Remove a deprecation for minor-minor release
Remove a deprecation for minor-minor release
C
mit
socialize/socialize-sdk-ios,socialize/socialize-sdk-ios,socialize/socialize-sdk-ios,dontfallisleep/socialize-sdk-ios,dontfallisleep/socialize-sdk-ios,dontfallisleep/socialize-sdk-ios,socialize/socialize-sdk-ios,dontfallisleep/socialize-sdk-ios,dontfallisleep/socialize-sdk-ios,socialize/socialize-sdk-ios,dontfallisleep/socialize-sdk-ios,socialize/socialize-sdk-ios
2a68fda5672af426733fb9bb9c82bf7318cdc9ca
src/gfx/support/json.h
src/gfx/support/json.h
/* * Copyright (C) 2015 Luke San Antonio * All rights reserved. */ #pragma once #include "rapidjson/document.h" #include "glm/glm.hpp" namespace redc { inline glm::vec3 vec3_from_js(rapidjson::Value const& v) noexcept { return glm::vec3{v["x"].GetDouble(),v["y"].GetDouble(),v["z"].GetDouble()}; } }
/* * Copyright (C) 2015 Luke San Antonio * All rights reserved. */ #pragma once #include "rapidjson/document.h" #include "glm/glm.hpp" namespace redc { inline glm::vec3 vec3_from_js_object(rapidjson::Value const& v) noexcept { return glm::vec3{v["x"].GetDouble(),v["y"].GetDouble(),v["z"].GetDouble()}; } inline glm::vec3 vec3_from_js_array(rapidjson::Value const& v) noexcept { return glm::vec3{v[0].GetDouble(),v[1].GetDouble(),v[2].GetDouble()}; } }
Update / add vec3 => JSON functions
Update / add vec3 => JSON functions Add support for array vectors like this [0.2, 12.5, 4.1]
C
bsd-3-clause
RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine,RedCraneStudio/redcrane-engine
05b970c5ed2b69076f340aa96724237883cff995
sim/log2.h
sim/log2.h
#ifndef LOG2_H #define LOG2_H template <typename T> #ifdef __GNUC__ __attribute__((const)) #endif static bool IsPowerOfTwo(const T& x) { return (x & (x - 1)) == 0; } template<typename T> #ifdef __GNUC__ __attribute__((const)) #endif static inline unsigned ilog2(T n) { // returns the first power of two equal to // or greater than n. For example ilog2(1) = 0, ilog2(4) = 2, ilog2(5) = 3 unsigned l = 0; T r = 1; while (r < n) { l++; r *= 2; } return l; } #endif
#ifndef LOG2_H #define LOG2_H template <typename T> #ifdef __GNUC__ __attribute__((const)) #endif static inline bool IsPowerOfTwo(T x) { return (x & (x - 1)) == 0; } template<typename T> #ifdef __GNUC__ __attribute__((const)) #endif static inline unsigned ilog2(T n) { // returns the first power of two equal to // or greater than n. For example ilog2(1) = 0, ilog2(4) = 2, ilog2(5) = 3 unsigned l = 0; T r = 1; while (r < n) { l++; r *= 2; } return l; } #endif
Work around an optimization bug in IsPowerOfTwo.
Work around an optimization bug in IsPowerOfTwo.
C
mit
Bitblade-org/mgsim,Bitblade-org/mgsim,Bitblade-org/mgsim,Bitblade-org/mgsim
5d70a9c23b0d34ea511b8e1705e2c9a8d6d0a435
src/definitions.h
src/definitions.h
#pragma once #include <cstdint> using uint = unsigned int; using u8 = uint8_t; using u16 = uint16_t; using s8 = int8_t; const int GAMEBOY_WIDTH = 160; const int GAMEBOY_HEIGHT = 144; const int CLOCK_RATE = 4194304; enum class Color { Color0, /* White */ Color1, /* Light gray */ Color2, /* Dark gray */ Color3, /* Black */ }; struct Noncopyable { Noncopyable &operator=(const Noncopyable &) = delete; Noncopyable(const Noncopyable &) = delete; Noncopyable() = default; };
#pragma once #include <cstdint> using uint = unsigned int; using u8 = uint8_t; using u16 = uint16_t; using s8 = int8_t; const int GAMEBOY_WIDTH = 160; const int GAMEBOY_HEIGHT = 144; const int CLOCK_RATE = 4194304; enum class Color { Color0, /* White */ Color1, /* Light gray */ Color2, /* Dark gray */ Color3, /* Black */ }; struct Noncopyable { Noncopyable& operator=(const Noncopyable&) = delete; Noncopyable(const Noncopyable&) = delete; Noncopyable() = default; };
Align & and * to the left always
Align & and * to the left always
C
bsd-3-clause
jgilchrist/emulator,jgilchrist/emulator,jgilchrist/emulator
84f52e954b4baee7ad0ad243648bf61e12f2a84c
test/asan/TestCases/printf-3.c
test/asan/TestCases/printf-3.c
// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: %env_asan_opts=check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: printf is not intercepted on Windows yet. // XFAIL: windows-msvc #include <stdio.h> int main() { #ifdef _MSC_VER // FIXME: The test raises a dialog even though it's XFAILd. return 42; #endif volatile char c = '0'; volatile int x = 12; volatile float f = 1.239; volatile char s[] = "34"; volatile int n[1]; printf("%c %d %.3f %s%n\n", c, x, f, s, &n[1]); return 0; // Check that %n is sanitized. // CHECK-ON: stack-buffer-overflow // CHECK-ON-NOT: 0 12 1.239 34 // CHECK-OFF: 0 12 1.239 34 }
// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: %env_asan_opts=check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: printf is not intercepted on Windows yet. // XFAIL: windows-msvc // New Bionic rejects %n // https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336 // UNSUPPORTED: android #include <stdio.h> int main() { #ifdef _MSC_VER // FIXME: The test raises a dialog even though it's XFAILd. return 42; #endif volatile char c = '0'; volatile int x = 12; volatile float f = 1.239; volatile char s[] = "34"; volatile int n[1]; printf("%c %d %.3f %s%n\n", c, x, f, s, &n[1]); return 0; // Check that %n is sanitized. // CHECK-ON: stack-buffer-overflow // CHECK-ON-NOT: 0 12 1.239 34 // CHECK-OFF: 0 12 1.239 34 }
Disable test incompatible with new Android
[asan] Disable test incompatible with new Android git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@349705 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
1d25a02b388dbd4c22e6a9338aa96580efbc712a
crypto/openssl_bio_string.h
crypto/openssl_bio_string.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 CRYPTO_OPENSSL_BIO_STRING_H_ #define CRYPTO_OPENSSL_BIO_STRING_H_ #include <string> #include "crypto/crypto_export.h" // From <openssl/bio.h> typedef struct bio_st BIO; namespace crypto { // Creates a new BIO that can be used with OpenSSL's various output functions, // and which will write all output directly into |out|. This is primarily // intended as a utility to reduce the amount of copying and separate // allocations when performing extensive string modifications or streaming // within OpenSSL. // // Note: |out| must remain valid for the duration of the BIO. BIO* CRYPTO_EXPORT BIO_new_string(std::string* out); } // namespace crypto #endif // CRYPTO_OPENSSL_BIO_STRING_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 CRYPTO_OPENSSL_BIO_STRING_H_ #define CRYPTO_OPENSSL_BIO_STRING_H_ #include <string> #include "crypto/crypto_export.h" // From <openssl/bio.h> typedef struct bio_st BIO; namespace crypto { // Creates a new BIO that can be used with OpenSSL's various output functions, // and which will write all output directly into |out|. This is primarily // intended as a utility to reduce the amount of copying and separate // allocations when performing extensive string modifications or streaming // within OpenSSL. // // Note: |out| must remain valid for the duration of the BIO. CRYPTO_EXPORT BIO* BIO_new_string(std::string* out); } // namespace crypto #endif // CRYPTO_OPENSSL_BIO_STRING_H_
Fix component build with gcc 4.6 on Android.
Fix component build with gcc 4.6 on Android. CRYPTO_EXPORT macro has to be before the non-void return type. BUG=None TBR=rsleevi@chromium.org Review URL: https://codereview.chromium.org/296223002 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@272363 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,M4sse/chromium.src,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,Jonekee/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,jaruba/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,ltilve/chromium,chuan9/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,ltilve/chromium,Jonekee/chromium.src,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,ondra-novak/chromium.src,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,ltilve/chromium,markYoungH/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,Just-D/chromium-1,M4sse/chromium.src,ltilve/chromium,chuan9/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,bright-sparks/chromium-spacewalk,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk,ltilve/chromium,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,hgl888/chromium-crosswalk,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,dednal/chromium.src,Chilledheart/chromium,jaruba/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,M4sse/chromium.src,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,dednal/chromium.src,dushu1203/chromium.src,dednal/chromium.src,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,chuan9/chromium-crosswalk,littlstar/chromium.src,jaruba/chromium.src,Chilledheart/chromium,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,littlstar/chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,dednal/chromium.src,littlstar/chromium.src,Fireblend/chromium-crosswalk,M4sse/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,dednal/chromium.src,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,Chilledheart/chromium,littlstar/chromium.src,littlstar/chromium.src,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,dushu1203/chromium.src,Just-D/chromium-1,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,bright-sparks/chromium-spacewalk,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,M4sse/chromium.src,krieger-od/nwjs_chromium.src,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,ltilve/chromium,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk
f505abb7da052e109a55b418dfbf3ebb0a6fd71f
PathKit/PathKit.h
PathKit/PathKit.h
// // PathKit.h // PathKit // // Created by Kyle Fuller on 20/11/2014. // Copyright (c) 2014 Cocode. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for PathKit. FOUNDATION_EXPORT double PathKitVersionNumber; //! Project version string for PathKit. FOUNDATION_EXPORT const unsigned char PathKitVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <PathKit/PublicHeader.h>
// // PathKit.h // PathKit // // Created by Kyle Fuller on 20/11/2014. // Copyright (c) 2014 Cocode. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for PathKit. FOUNDATION_EXPORT double PathKitVersionNumber; //! Project version string for PathKit. FOUNDATION_EXPORT const unsigned char PathKitVersionString[];
Remove useless comment from umbrella header
Remove useless comment from umbrella header
C
bsd-2-clause
weby/PathKit,weby/PathKit,kylef/PathKit,RahulKatariya/PathKit,kylef/PathKit,RahulKatariya/PathKit
bd1bb2f7a80f5518a7afbce3f19a547dc2fdc23a
testing/test_irf.c
testing/test_irf.c
#include <stdlib.h> #include <glib.h> #include "bmi/bmi_cem.h" static void test_bmi_initialize(void) { BMI_Model *model = (BMI_Model *)malloc(sizeof(BMI_Model)); int status; register_bmi_cem(model); status = model->initialize(NULL, &(model->self)); g_assert_cmpint(status, ==, BMI_SUCCESS); } static void test_bmi_update(void) { BMI_Model *model = (BMI_Model *)malloc(sizeof(BMI_Model)); int status; register_bmi_cem(model); status = model->initialize(NULL, &(model->self)); g_assert_cmpint(status, ==, BMI_SUCCESS); status = model->update(&(model->self)); g_assert_cmpint(status, ==, BMI_SUCCESS); } int main(int argc, char* argv[]) { g_test_init(&argc, &argv, NULL); g_test_add_func("/bmi/initialize", &test_bmi_initialize); // g_test_add_func("/bmi/update", &test_bmi_update); return g_test_run(); }
#include <stdlib.h> #include <glib.h> #include "bmi/bmi_cem.h" static void test_bmi_initialize(void) { BMI_Model *model = (BMI_Model *)malloc(sizeof(BMI_Model)); int status; register_bmi_cem(model); status = model->initialize(NULL, &(model->self)); g_assert_cmpint(status, ==, BMI_SUCCESS); } static void test_bmi_update(void) { BMI_Model *model = (BMI_Model *)malloc(sizeof(BMI_Model)); int status; register_bmi_cem(model); status = model->initialize(NULL, &(model->self)); g_assert_cmpint(status, ==, BMI_SUCCESS); status = model->update(&(model->self)); g_assert_cmpint(status, ==, BMI_SUCCESS); } int main(int argc, char* argv[]) { g_test_init(&argc, &argv, NULL); g_test_add_func("/bmi/initialize", &test_bmi_initialize); g_test_add_func("/bmi/update", &test_bmi_update); return g_test_run(); }
Add test for update function.
Add test for update function.
C
mit
csdms-contrib/cem
f2ec24fd42d52a52829070b5e31d9a17d145df30
arch/microblaze/include/asm/entry.h
arch/microblaze/include/asm/entry.h
/* * Definitions used by low-level trap handlers * * Copyright (C) 2008 Michal Simek * Copyright (C) 2007 - 2008 PetaLogix * Copyright (C) 2007 John Williams <john.williams@petalogix.com> * * This file is subject to the terms and conditions of the GNU General * Public License. See the file COPYING in the main directory of this * archive for more details. */ #ifndef _ASM_MICROBLAZE_ENTRY_H #define _ASM_MICROBLAZE_ENTRY_H #include <asm/percpu.h> #include <asm/ptrace.h> /* * These are per-cpu variables required in entry.S, among other * places */ #define PER_CPU(var) per_cpu__##var # ifndef __ASSEMBLY__ DECLARE_PER_CPU(unsigned int, KSP); /* Saved kernel stack pointer */ DECLARE_PER_CPU(unsigned int, KM); /* Kernel/user mode */ DECLARE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */ DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */ DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */ DECLARE_PER_CPU(unsigned int, SYSCALL_SAVE); /* Saved syscall number */ # endif /* __ASSEMBLY__ */ #endif /* _ASM_MICROBLAZE_ENTRY_H */
/* * Definitions used by low-level trap handlers * * Copyright (C) 2008 Michal Simek * Copyright (C) 2007 - 2008 PetaLogix * Copyright (C) 2007 John Williams <john.williams@petalogix.com> * * This file is subject to the terms and conditions of the GNU General * Public License. See the file COPYING in the main directory of this * archive for more details. */ #ifndef _ASM_MICROBLAZE_ENTRY_H #define _ASM_MICROBLAZE_ENTRY_H #include <asm/percpu.h> #include <asm/ptrace.h> /* * These are per-cpu variables required in entry.S, among other * places */ #define PER_CPU(var) per_cpu__##var # ifndef __ASSEMBLY__ DECLARE_PER_CPU(unsigned int, KSP); /* Saved kernel stack pointer */ DECLARE_PER_CPU(unsigned int, KM); /* Kernel/user mode */ DECLARE_PER_CPU(unsigned int, ENTRY_SP); /* Saved SP on kernel entry */ DECLARE_PER_CPU(unsigned int, R11_SAVE); /* Temp variable for entry */ DECLARE_PER_CPU(unsigned int, CURRENT_SAVE); /* Saved current pointer */ # endif /* __ASSEMBLY__ */ #endif /* _ASM_MICROBLAZE_ENTRY_H */
Remove unneded per cpu SYSCALL_SAVE variable
microblaze: Remove unneded per cpu SYSCALL_SAVE variable Signed-off-by: Michal Simek <3a191dd2be46e826fee926d532b136ed65cb5318@monstr.eu>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
05e7220cccf9e335700e91b14c2de91d84c6fe3d
src/keyboard-layout-observer.h
src/keyboard-layout-observer.h
#ifndef SRC_KEYBORD_LAYOUT_OBSERVER_H_ #define SRC_KEYBORD_LAYOUT_OBSERVER_H_ #include "nan.h" using namespace v8; // NOLINT class KeyboardLayoutObserver : public node::ObjectWrap { public: static void Init(Handle<Object> target); void HandleKeyboardLayoutChanged(); private: KeyboardLayoutObserver(NanCallback *callback); ~KeyboardLayoutObserver(); static NAN_METHOD(New); static NAN_METHOD(GetCurrentKeyboardLayout); NanCallback *callback; }; #endif // SRC_KEYBORD_LAYOUT_OBSERVER_H_
#ifndef SRC_KEYBORD_LAYOUT_OBSERVER_H_ #define SRC_KEYBORD_LAYOUT_OBSERVER_H_ #include "nan.h" using namespace v8; // NOLINT class KeyboardLayoutObserver : public node::ObjectWrap { public: static void Init(Handle<Object> target); void HandleKeyboardLayoutChanged(); private: KeyboardLayoutObserver(NanCallback *callback); ~KeyboardLayoutObserver(); static NAN_METHOD(New); static NAN_METHOD(GetCurrentKeyboardLayout); static NAN_METHOD(GetInstalledKeyboardLayouts); NanCallback *callback; }; #endif // SRC_KEYBORD_LAYOUT_OBSERVER_H_
Add our new method to get the list of installed layouts
Add our new method to get the list of installed layouts
C
mit
atom/keyboard-layout,atom/keyboard-layout,atom/keyboard-layout
cefc69e635bdcabbf8191627913af238b9f974f2
UIKit/UIPanGestureRecognizer+Private.h
UIKit/UIPanGestureRecognizer+Private.h
@interface UIPanGestureRecognizer (Private) @property (setter=_setHysteresis:) BOOL _hysteresis; @end
@interface UIPanGestureRecognizer (Private) @property (setter=_setHysteresis:) CGFloat _hysteresis; @property (assign, nonatomic) BOOL failsPastMaxTouches; @end
Fix UIPanGestureRecognizer property type; add property
[UIKit] Fix UIPanGestureRecognizer property type; add property
C
unlicense
hbang/headers,hbang/headers
11ecac55348eb103e2cbcd25cb01178584faa57f
chrome/app/scoped_ole_initializer.h
chrome/app/scoped_ole_initializer.h
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_ #define CHROME_APP_SCOPED_OLE_INITIALIZER_H_ // Wraps OLE initialization in a cross-platform class meant to be used on the // stack so init/uninit is done with scoping. This class is ok for use by // non-windows platforms; it just doesn't do anything. #if defined(OS_WIN) #include <ole2.h> class ScopedOleInitializer { public: ScopedOleInitializer() { int ole_result = OleInitialize(NULL); DCHECK(ole_result == S_OK); } ~ScopedOleInitializer() { OleUninitialize(); } }; #else class ScopedOleInitializer { public: // Empty, this class does nothing on non-win32 systems. Empty ctor is // necessary to avoid "unused variable" warning on gcc. ScopedOleInitializer() { } }; #endif #endif // CHROME_APP_SCOPED_OLE_INITIALIZER_H_
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_ #define CHROME_APP_SCOPED_OLE_INITIALIZER_H_ #include "base/logging.h" #include "build/build_config.h" // Wraps OLE initialization in a cross-platform class meant to be used on the // stack so init/uninit is done with scoping. This class is ok for use by // non-windows platforms; it just doesn't do anything. #if defined(OS_WIN) #include <ole2.h> class ScopedOleInitializer { public: ScopedOleInitializer() { int ole_result = OleInitialize(NULL); DCHECK(ole_result == S_OK); } ~ScopedOleInitializer() { OleUninitialize(); } }; #else class ScopedOleInitializer { public: // Empty, this class does nothing on non-win32 systems. Empty ctor is // necessary to avoid "unused variable" warning on gcc. ScopedOleInitializer() { } }; #endif #endif // CHROME_APP_SCOPED_OLE_INITIALIZER_H_
Make ScopedOleInitializer work on windows if you aren't including build_config already.
Make ScopedOleInitializer work on windows if you aren't including build_config already. BUG=none TEST=none Review URL: http://codereview.chromium.org/19640 git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@8835 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
C
bsd-3-clause
wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser
9cdd7db18bcf038c1b92e45ae0ba9c846e8d3977
test2/float/call/many_floats.c
test2/float/call/many_floats.c
// RUN: %ucc -o %t %s // RUN: %ocheck 0 %t // RUN: %t | %output_check 'Hello 5 2.3' 'Hello 5 2.3' // should run without segfaulting main() { printf("Hello %d %.1f\n", 5, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3); // this causes an infinite loop in glibc's printf() printf("Hello %d %.1f\n", 5, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, // this causes an infinite loop in glibc's printf() 2.3); // and this causes a crash // suspect the bug is to do with double alignment when passed as stack arguments return 0; }
// RUN: %ucc -o %t %s // RUN: %ocheck 0 %t // RUN: %t | %output_check 'Hello 5 5.9' '7.3 8.7 10.1 11.5 12.9 14.3 15.7 17.1 18.5 19.9' 'Hello 5 15.7' '14.3 12.9 11.5 10.1 8.7 7.3 5.9 4.5 3.1 1.7 0.3' // should run without segfaulting main() { printf("Hello %d %.1f\n" "%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n", 5, 5.9, 7.3, 8.7, 10.1, 11.5, 12.9, 14.3, 15.7, 17.1, 18.5, 19.9); // this causes an infinite loop in glibc's printf() printf("Hello %d %.1f\n" "%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f\n", 5, 15.7, 14.3, 12.9, 11.5, 10.1, 8.7, 7.3, 5.9, 4.5, 3.1, 1.7, // this causes an infinite loop in glibc's printf() 0.3); // and this causes a crash // suspect the bug is to do with double alignment when passed as stack arguments return 0; }
Format strings and more through test for stack floats
Format strings and more through test for stack floats
C
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
b004fd538d4d56202a8f226f0145ba03aeb27a69
tensorflow_lite_support/cc/text/tokenizers/tokenizer_jni_lib.h
tensorflow_lite_support/cc/text/tokenizers/tokenizer_jni_lib.h
/* Copyright 2019 The TensorFlow 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. ==============================================================================*/ #ifndef TENSORFLOW_LITE_SUPPORT_CC_TEXT_TOKENIZERS_TOKENIZER_JNI_LIB_H_ #define TENSORFLOW_LITE_SUPPORT_CC_TEXT_TOKENIZERS_TOKENIZER_JNI_LIB_H_ #include <jni.h> #include <string> #include "tensorflow_lite_support/cc/text/tokenizers/tokenizer.h" #include "tensorflow_lite_support/cc/utils/jni_utils.h" namespace tflite { namespace support { jobjectArray nativeTokenize(JNIEnv* env, jlong handle, jstring jtext); jintArray nativeConvertTokensToIds(JNIEnv* env, jlong handle, jobjectArray jtokens); } // namespace support } // namespace tflite #endif // TENSORFLOW_LITE_SUPPORT_CC_TEXT_TOKENIZERS_TOKENIZER_JNI_LIB_H_
/* Copyright 2019 The TensorFlow 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. ==============================================================================*/ #ifndef TENSORFLOW_LITE_SUPPORT_CC_TEXT_TOKENIZERS_TOKENIZER_JNI_LIB_H_ #define TENSORFLOW_LITE_SUPPORT_CC_TEXT_TOKENIZERS_TOKENIZER_JNI_LIB_H_ #include <jni.h> #include "tensorflow_lite_support/cc/text/tokenizers/tokenizer.h" #include "tensorflow_lite_support/cc/utils/jni_utils.h" namespace tflite { namespace support { jobjectArray nativeTokenize(JNIEnv* env, jlong handle, jstring jtext); jintArray nativeConvertTokensToIds(JNIEnv* env, jlong handle, jobjectArray jtokens); } // namespace support } // namespace tflite #endif // TENSORFLOW_LITE_SUPPORT_CC_TEXT_TOKENIZERS_TOKENIZER_JNI_LIB_H_
Remove unused STL string include
Remove unused STL string include PiperOrigin-RevId: 433365283
C
apache-2.0
tensorflow/tflite-support,tensorflow/tflite-support,tensorflow/tflite-support,tensorflow/tflite-support,tensorflow/tflite-support,tensorflow/tflite-support
ae78b7da75216dc8b6ed457a7f6ca878faaeec06
rbcoremidi.c
rbcoremidi.c
/* * Copyright 2008 Markus Prinz * Released unter an MIT licence * */ #include <ruby.h> VALUE crbCoreMidi; void Init_rbcoremidi (void) { // Add the initialization code of your module here. }
/* * Copyright 2008 Markus Prinz * Released unter an MIT licence * */ #include <ruby.h> #include <CoreMIDI/CoreMIDI.h> VALUE callback_proc = Qnil; MIDIPortRef inPort = NULL; MIDIClientRef client = NULL; static void RbMIDIReadProc(const MIDIPacketList* packetList, void* readProcRefCon, void* srcConnRefCon) { } void Init_rbcoremidi (void) { // Add the initialization code of your module here. }
Add skeleton for callback and a few global vars
Add skeleton for callback and a few global vars
C
mit
cypher/rbcoremidi,cypher/rbcoremidi
aca77f3e86ce9c380f19a4d02875023100af8c82
StravaKit/StravaKit/StravaKit.h
StravaKit/StravaKit/StravaKit.h
// // StravaKitOSX.h // StravaKitOSX // // Created by Elmar Tampe on 04/12/14. // // #import <UIKit/UIKit.h> //! Project version number for StravaKitOSX. FOUNDATION_EXPORT double StravaKitOSXVersionNumber; //! Project version string for StravaKitOSX. FOUNDATION_EXPORT const unsigned char StravaKitOSXVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <StravaKitOSX/PublicHeader.h>
// // StravaKit.h // StravaKit // // Created by Elmar Tampe on 04/12/14. // // #import <UIKit/UIKit.h> //! Project version number for StravaKit. FOUNDATION_EXPORT double StravaKitVersionNumber; //! Project version string for StravaKit. FOUNDATION_EXPORT const unsigned char StravaKitVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <StravaKitOSX/PublicHeader.h>
Fix the naming of the var's to match the actual naming.
Fix the naming of the var's to match the actual naming.
C
mit
elmoswelt/StravaKit,elmoswelt/StravaKit
7c0c1625ca01a505f047c7332073014a96021696
src/Pomade.c
src/Pomade.c
#include "pebble_os.h" #include "pebble_app.h" #include "pebble_fonts.h" #define MY_UUID { 0x78, 0x1D, 0x21, 0x66, 0x09, 0x09, 0x4F, 0x9C, 0x88, 0xFD, 0x89, 0x9B, 0x04, 0xBF, 0x5E, 0x32 } PBL_APP_INFO(MY_UUID, "Template App", "Your Company", 1, 0, /* App version */ DEFAULT_MENU_ICON, APP_INFO_STANDARD_APP); Window window; void handle_init(AppContextRef ctx) { window_init(&window, "Window Name"); window_stack_push(&window, true /* Animated */); } void pbl_main(void *params) { PebbleAppHandlers handlers = { .init_handler = &handle_init }; app_event_loop(params, &handlers); }
#include "pebble_os.h" #include "pebble_app.h" #include "pebble_fonts.h" #define MY_UUID { 0x78, 0x1D, 0x21, 0x66, 0x09, 0x09, 0x4F, 0x9C, 0x88, 0xFD, 0x89, 0x9B, 0x04, 0xBF, 0x5E, 0x32 } PBL_APP_INFO(MY_UUID, "Pomade", "Jon Speicher", 0, 1, /* App version */ DEFAULT_MENU_ICON, APP_INFO_STANDARD_APP); Window window; void handle_init(AppContextRef ctx) { window_init(&window, "Pomade"); window_stack_push(&window, true /* Animated */); } void pbl_main(void *params) { PebbleAppHandlers handlers = { .init_handler = &handle_init }; app_event_loop(params, &handlers); }
Change version, app and window name
Change version, app and window name
C
mit
elliots/simple-demo-pebble,jonspeicher/Pomade,jonspeicher/Pomade
747852023687e4fe4502cc616412a5e3568f56fd
gnu/lib/libregex/gnuregex.h
gnu/lib/libregex/gnuregex.h
/*- * Copyright (c) 2004 David E. O'Brien * Copyright (c) 2004 Andrey A. Chernov * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifdef __GNUC__ #warning "<gnuregex.h> has been replaced by <gnu/regex.h>" #endif #include <gnu/regex.h>
/*- * Copyright (c) 2004 David E. O'Brien * Copyright (c) 2004 Andrey A. Chernov * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifdef __GNUC__ #warning "Use -I/usr/include/gnu and <regex.h> instead of <gnuregex.h>" #endif #include <gnu/regex.h>
Change warning hint to be more useful
Change warning hint to be more useful
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
40a1a436137bab2bb7fc0ed7cc83d4d52be36ce4
tools/emulator/non_interactive.c
tools/emulator/non_interactive.c
// // Non-interactive test runner just produces register traces and memory dumps // #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdlib.h> #include <sys/poll.h> #include <stdarg.h> #include "core.h" #include "debug_info.h" void runNonInteractive(Core *core) { int i; enableTracing(core); runQuantum(core); }
// // Non-interactive test runner just produces register traces and memory dumps // #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdlib.h> #include <sys/poll.h> #include <stdarg.h> #include "core.h" #include "debug_info.h" void runNonInteractive(Core *core) { int i; enableTracing(core); for (i = 0; i < 20; i++) { if (!runQuantum(core)) break; } }
Make emulator run for a little longer in non-interactive mode
Make emulator run for a little longer in non-interactive mode
C
apache-2.0
jbush001/NyuziProcessor,jbush001/NyuziProcessor,hoangt/NyuziProcessor,FulcronZ/NyuziProcessor,jbush001/NyuziProcessor,hoangt/NyuziProcessor,hoangt/NyuziProcessor,jbush001/NyuziProcessor,FulcronZ/NyuziProcessor,FulcronZ/NyuziProcessor,hoangt/NyuziProcessor,FulcronZ/NyuziProcessor,jbush001/NyuziProcessor,jbush001/NyuziProcessor
9cc47bd19ebc3f697753d1a3ab62777c9e68d1c2
src/ignore.h
src/ignore.h
#include <sys/dir.h> #include <sys/types.h> #ifndef IGNORE_H #define IGNORE_H #define SVN_DIR_PROP_BASE "/dir-prop-base" #define SVN_DIR ".svn" #define SVN_PROP_IGNORE "svn:ignore" struct ignores { char **names; /* Non-regex ignore lines. Sorted so we can binary search them. */ size_t names_len; char **regexes; /* For patterns that need fnmatch */ size_t regexes_len; struct ignores *parent; }; typedef struct ignores ignores; ignores *root_ignores; extern const char *evil_hardcoded_ignore_files[]; extern const char *ignore_pattern_files[]; ignores *init_ignore(ignores *parent); void cleanup_ignore(ignores *ig); void add_ignore_pattern(ignores *ig, const char* pattern); void load_ignore_patterns(ignores *ig, const char *ignore_filename); void load_svn_ignore_patterns(ignores *ig, const char *path); int ackmate_dir_match(const char* dir_name); int filename_filter(struct dirent *dir); #endif
#ifndef IGNORE_H #define IGNORE_H #include <sys/dir.h> #include <sys/types.h> #define SVN_DIR_PROP_BASE "/dir-prop-base" #define SVN_DIR ".svn" #define SVN_PROP_IGNORE "svn:ignore" struct ignores { char **names; /* Non-regex ignore lines. Sorted so we can binary search them. */ size_t names_len; char **regexes; /* For patterns that need fnmatch */ size_t regexes_len; struct ignores *parent; }; typedef struct ignores ignores; ignores *root_ignores; extern const char *evil_hardcoded_ignore_files[]; extern const char *ignore_pattern_files[]; ignores *init_ignore(ignores *parent); void cleanup_ignore(ignores *ig); void add_ignore_pattern(ignores *ig, const char* pattern); void load_ignore_patterns(ignores *ig, const char *ignore_filename); void load_svn_ignore_patterns(ignores *ig, const char *path); int ackmate_dir_match(const char* dir_name); int filename_filter(struct dirent *dir); #endif
Put ifndef at the top.
Put ifndef at the top.
C
apache-2.0
accessv/the_silver_searcher,subev/the_silver_searcher,decaff/the_silver_searcher,siadat/the_silver_searcher,lunixbochs/the_silver_searcher,accessv/the_silver_searcher,nodakai/the_silver_searcher,cchamberlain/the_silver_searcher,brianstorti/the_silver_searcher,smaudet/the_silver_searcher,siadat/the_silver_searcher,godbyk/the_silver_searcher,vehar/the_silver_searcher,cchamberlain/the_silver_searcher,Arkanosis/the_silver_searcher,SnoringFrog/the_silver_searcher,subev/the_silver_searcher,ur4ltz/the_silver_searcher,rowanbeentje/the_silver_searcher,monochromegane/the_silver_searcher,siadat/the_silver_searcher,abhiii5459/the_silver_searcher,christer155/the_silver_searcher,abhiii5459/the_silver_searcher,lizh06/the_silver_searcher,lunixbochs/the_silver_searcher,abhiii5459/the_silver_searcher,bhaak/the_silver_searcher,jemiahlee/the_silver_searcher,bestwpw/the_silver_searcher,msys2/the_silver_searcher,godbyk/the_silver_searcher,ggreer/the_silver_searcher,SnoringFrog/the_silver_searcher,cchamberlain/the_silver_searcher,k-takata/the_silver_searcher,sebgod/the_silver_searcher,starcraftman/the_silver_searcher,nishant8BITS/the_silver_searcher,laserswald/the_silver_searcher,nishant8BITS/the_silver_searcher,avih/the_silver_searcher,snahor/the_silver_searcher,smaudet/the_silver_searcher,subev/the_silver_searcher,leeonix/the_silver_searcher,bhaak/the_silver_searcher,accessv/the_silver_searcher,bhaak/the_silver_searcher,brianstorti/the_silver_searcher,leeonix/the_silver_searcher,christer155/the_silver_searcher,ur4ltz/the_silver_searcher,bc-jaymendoza/the_silver_searcher,sebgod/the_silver_searcher,godbyk/the_silver_searcher,k-takata/the_silver_searcher,snahor/the_silver_searcher,snahor/the_silver_searcher,bestwpw/the_silver_searcher,ggreer/the_silver_searcher,jemiahlee/the_silver_searcher,decaff/the_silver_searcher,starcraftman/the_silver_searcher,laserswald/the_silver_searcher,laserswald/the_silver_searcher,bhaak/the_silver_searcher,nodakai/the_silver_searcher,christer155/the_silver_searcher,ArneBab/the_silver_searcher,k-takata/the_silver_searcher,starcraftman/the_silver_searcher,k-takata/the_silver_searcher,cchamberlain/the_silver_searcher,RedX2501/the_silver_searcher,vehar/the_silver_searcher,vehar/the_silver_searcher,laserswald/the_silver_searcher,JFLarvoire/the_silver_searcher,rowanbeentje/the_silver_searcher,sebgod/the_silver_searcher,accessv/the_silver_searcher,vehar/the_silver_searcher,Arkanosis/the_silver_searcher,danielshahaf/the_silver_searcher,lunixbochs/the_silver_searcher,nodakai/the_silver_searcher,cchamberlain/the_silver_searcher,pbhandari/the_silver_searcher,k-takata/the_silver_searcher,danielshahaf/the_silver_searcher,JFLarvoire/the_silver_searcher,lunixbochs/the_silver_searcher,danielshahaf/the_silver_searcher,lecheel/the_silver_searcher,JFLarvoire/the_silver_searcher,subev/the_silver_searcher,danielshahaf/the_silver_searcher,kjk/the_silver_searcher,snahor/the_silver_searcher,bestwpw/the_silver_searcher,ggreer/the_silver_searcher,Arkanosis/the_silver_searcher,decaff/the_silver_searcher,JFLarvoire/the_silver_searcher,ur4ltz/the_silver_searcher,snahor/the_silver_searcher,jemiahlee/the_silver_searcher,vehar/the_silver_searcher,Arkanosis/the_silver_searcher,siadat/the_silver_searcher,kjk/the_silver_searcher,avih/the_silver_searcher,avih/the_silver_searcher,Arkanosis/the_silver_searcher,ArneBab/the_silver_searcher,leeonix/the_silver_searcher,mcanthony/the_silver_searcher,smaudet/the_silver_searcher,mcanthony/the_silver_searcher,smaudet/the_silver_searcher,msys2/the_silver_searcher,decaff/the_silver_searcher,kjk/the_silver_searcher,pbhandari/the_silver_searcher,bc-jaymendoza/the_silver_searcher,mcanthony/the_silver_searcher,pbhandari/the_silver_searcher,lecheel/the_silver_searcher,lecheel/the_silver_searcher,leeonix/the_silver_searcher,smaudet/the_silver_searcher,starcraftman/the_silver_searcher,RedX2501/the_silver_searcher,jemiahlee/the_silver_searcher,bc-jaymendoza/the_silver_searcher,bc-jaymendoza/the_silver_searcher,JFLarvoire/the_silver_searcher,SnoringFrog/the_silver_searcher,ArneBab/the_silver_searcher,jemiahlee/the_silver_searcher,monochromegane/the_silver_searcher,ArneBab/the_silver_searcher,ArneBab/the_silver_searcher,SnoringFrog/the_silver_searcher,rowanbeentje/the_silver_searcher,RedX2501/the_silver_searcher,lizh06/the_silver_searcher,brianstorti/the_silver_searcher,SnoringFrog/the_silver_searcher,avih/the_silver_searcher,msys2/the_silver_searcher,accessv/the_silver_searcher,JFLarvoire/the_silver_searcher,ur4ltz/the_silver_searcher,godbyk/the_silver_searcher,nishant8BITS/the_silver_searcher,danielshahaf/the_silver_searcher,nodakai/the_silver_searcher,abhiii5459/the_silver_searcher,subev/the_silver_searcher,bestwpw/the_silver_searcher,kjk/the_silver_searcher,bestwpw/the_silver_searcher,kjk/the_silver_searcher,schlosna/the_silver_searcher,siadat/the_silver_searcher,christer155/the_silver_searcher,sebgod/the_silver_searcher,starcraftman/the_silver_searcher,nishant8BITS/the_silver_searcher,JFLarvoire/the_silver_searcher,christer155/the_silver_searcher,lecheel/the_silver_searcher,lizh06/the_silver_searcher,msys2/the_silver_searcher,nodakai/the_silver_searcher,RedX2501/the_silver_searcher,laserswald/the_silver_searcher,decaff/the_silver_searcher,pbhandari/the_silver_searcher,bhaak/the_silver_searcher,leeonix/the_silver_searcher,nishant8BITS/the_silver_searcher,vehar/the_silver_searcher,pbhandari/the_silver_searcher,mcanthony/the_silver_searcher,lunixbochs/the_silver_searcher,ggreer/the_silver_searcher,abhiii5459/the_silver_searcher,brianstorti/the_silver_searcher,kjk/the_silver_searcher,leeonix/the_silver_searcher,schlosna/the_silver_searcher,lizh06/the_silver_searcher,RedX2501/the_silver_searcher,msys2/the_silver_searcher,godbyk/the_silver_searcher,mcanthony/the_silver_searcher,bc-jaymendoza/the_silver_searcher,brianstorti/the_silver_searcher,decaff/the_silver_searcher,ur4ltz/the_silver_searcher,avih/the_silver_searcher
f051e451c92d176532fde7e6da09dff3262aa9ae
src/gui/src/docks/settings-dock.h
src/gui/src/docks/settings-dock.h
#ifndef SETTINGS_DOCK_H #define SETTINGS_DOCK_H #include <QStringList> #include <QWidget> #include "dock.h" namespace Ui { class SettingsDock; } class Profile; class QEvent; class QSettings; class SettingsDock : public Dock { Q_OBJECT public: explicit SettingsDock(Profile *profile, QWidget *parent); ~SettingsDock() override; protected: void changeEvent(QEvent *event) override; void saveSettings(); public slots: void reset(); protected slots: void chooseFolder(); void save(); void updateCompleters(); private: Ui::SettingsDock *ui; Profile *m_profile; QSettings *m_settings; QStringList m_lineFilename_completer; QStringList m_lineFolder_completer; }; #endif // SETTINGS_DOCK_H
#ifndef SETTINGS_DOCK_H #define SETTINGS_DOCK_H #include <QStringList> #include <QWidget> #include "dock.h" namespace Ui { class SettingsDock; } class Profile; class QEvent; class QSettings; class SettingsDock : public Dock { Q_OBJECT public: explicit SettingsDock(Profile *profile, QWidget *parent); ~SettingsDock() override; protected: void changeEvent(QEvent *event) override; public slots: void reset(); protected slots: void chooseFolder(); void save(); void saveSettings(); void updateCompleters(); private: Ui::SettingsDock *ui; Profile *m_profile; QSettings *m_settings; QStringList m_lineFilename_completer; QStringList m_lineFolder_completer; }; #endif // SETTINGS_DOCK_H
Fix broken connection in quick settings dock
Fix broken connection in quick settings dock
C
apache-2.0
Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber
0164cb003172e6e3224498eb77bbf14ca5ece039
mfmod.c
mfmod.c
#include <linux/module.h> #include <linux/kernel.h> #include <linux/netfilter.h> #include <linux/netfilter_ipv4.h> static struct nf_hook_ops nfho; unsigned int hook_func(unsigned int hooknum, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { return NF_DROP; } int init_module() { nfho.hook = hook_func; nfho.hooknum = NF_INET_PRE_ROUTING; nfho.pf = PF_INET; nfho.priority = NF_IP_PRI_FIRST; nf_register_hook(&nfho); return 0; } void cleanup_module() { nf_unregister_hook(&nfho); }
#include <linux/module.h> #include <linux/kernel.h> #include <linux/netfilter.h> #include <linux/netfilter_ipv4.h> static struct nf_hook_ops nfho; unsigned int hook_func(unsigned int hooknum, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { socket_buff = skb; if (!socket_buff) { return NF_ACCEPT; } else { ip_header = (stuct iphdr *)skb_network_header(socket_buff); // Network header // Drop all ICMP packets if (ip_header->protocol == IPPROTO_ICMP) { return NF_DROP; } } } int init_module() { nfho.hook = hook_func; nfho.hooknum = NF_INET_PRE_ROUTING; nfho.pf = PF_INET; nfho.priority = NF_IP_PRI_FIRST; nf_register_hook(&nfho); return 0; } void cleanup_module() { nf_unregister_hook(&nfho); }
Set hook to block all ICMP packets
Set hook to block all ICMP packets
C
mit
Muhlenberg/mfw