commit
stringlengths
40
40
old_file
stringlengths
4
112
new_file
stringlengths
4
112
old_contents
stringlengths
0
2.05k
new_contents
stringlengths
28
3.9k
subject
stringlengths
17
736
message
stringlengths
18
4.78k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
111k
8e642c9d00180261ee277a307618770b75b31d46
server/proxy/filters/filter_demo.c
server/proxy/filters/filter_demo.c
#include "filters_api.h" static PF_FILTER_RESULT demo_filter_keyboard_event(connectionInfo* info, void* param) { proxyKeyboardEventInfo* event_data = (proxyKeyboardEventInfo*) param; return FILTER_PASS; } static PF_FILTER_RESULT demo_filter_mouse_event(connectionInfo* info, void* param) { proxyMouseEventInfo* event_data = (proxyMouseEventInfo*) param; if (event_data->x % 100 == 0) { return FILTER_DROP; } return FILTER_PASS; } bool filter_init(proxyEvents* events) { events->KeyboardEvent = demo_filter_keyboard_event; events->MouseEvent = demo_filter_mouse_event; }
#include "filters_api.h" static PF_FILTER_RESULT demo_filter_keyboard_event(connectionInfo* info, void* param) { proxyKeyboardEventInfo* event_data = (proxyKeyboardEventInfo*) param; return FILTER_PASS; } static PF_FILTER_RESULT demo_filter_mouse_event(connectionInfo* info, void* param) { proxyMouseEventInfo* event_data = (proxyMouseEventInfo*) param; if (event_data->x % 100 == 0) { return FILTER_DROP; } return FILTER_PASS; } bool filter_init(proxyEvents* events) { events->KeyboardEvent = demo_filter_keyboard_event; events->MouseEvent = demo_filter_mouse_event; return true; }
Add return statement in demo_filter.c
server/proxy: Add return statement in demo_filter.c
C
apache-2.0
RangeeGmbH/FreeRDP,mfleisz/FreeRDP,erbth/FreeRDP,ivan-83/FreeRDP,akallabeth/FreeRDP,mfleisz/FreeRDP,FreeRDP/FreeRDP,awakecoding/FreeRDP,cedrozor/FreeRDP,chipitsine/FreeRDP,DavBfr/FreeRDP,Devolutions/FreeRDP,chipitsine/FreeRDP,FreeRDP/FreeRDP,Devolutions/FreeRDP,ivan-83/FreeRDP,ivan-83/FreeRDP,FreeRDP/FreeRDP,ivan-83/FreeRDP,awakecoding/FreeRDP,FreeRDP/FreeRDP,Devolutions/FreeRDP,DavBfr/FreeRDP,erbth/FreeRDP,chipitsine/FreeRDP,erbth/FreeRDP,akallabeth/FreeRDP,cedrozor/FreeRDP,chipitsine/FreeRDP,FreeRDP/FreeRDP,DavBfr/FreeRDP,awakecoding/FreeRDP,RangeeGmbH/FreeRDP,DavBfr/FreeRDP,RangeeGmbH/FreeRDP,awakecoding/FreeRDP,chipitsine/FreeRDP,Devolutions/FreeRDP,Devolutions/FreeRDP,DavBfr/FreeRDP,mfleisz/FreeRDP,cedrozor/FreeRDP,cedrozor/FreeRDP,akallabeth/FreeRDP,ivan-83/FreeRDP,mfleisz/FreeRDP,akallabeth/FreeRDP,Devolutions/FreeRDP,RangeeGmbH/FreeRDP,chipitsine/FreeRDP,cloudbase/FreeRDP-dev,ivan-83/FreeRDP,cedrozor/FreeRDP,awakecoding/FreeRDP,RangeeGmbH/FreeRDP,DavBfr/FreeRDP,cedrozor/FreeRDP,akallabeth/FreeRDP,mfleisz/FreeRDP,ivan-83/FreeRDP,RangeeGmbH/FreeRDP,erbth/FreeRDP,erbth/FreeRDP,awakecoding/FreeRDP,chipitsine/FreeRDP,mfleisz/FreeRDP,FreeRDP/FreeRDP,FreeRDP/FreeRDP,FreeRDP/FreeRDP,cloudbase/FreeRDP-dev,awakecoding/FreeRDP,DavBfr/FreeRDP,DavBfr/FreeRDP,mfleisz/FreeRDP,chipitsine/FreeRDP,mfleisz/FreeRDP,akallabeth/FreeRDP,erbth/FreeRDP,awakecoding/FreeRDP,akallabeth/FreeRDP,cloudbase/FreeRDP-dev,RangeeGmbH/FreeRDP,ivan-83/FreeRDP,cedrozor/FreeRDP,cloudbase/FreeRDP-dev,Devolutions/FreeRDP,cloudbase/FreeRDP-dev,Devolutions/FreeRDP,cloudbase/FreeRDP-dev,akallabeth/FreeRDP,erbth/FreeRDP,cloudbase/FreeRDP-dev,cedrozor/FreeRDP,RangeeGmbH/FreeRDP,erbth/FreeRDP
63a9cf2dc50b7c83f99b95c1e7e63985c6e52343
WatchKit/SpecHelper/WatchKit/TestableWKInterfaceController.h
WatchKit/SpecHelper/WatchKit/TestableWKInterfaceController.h
#import <Foundation/Foundation.h> @class WKInterfaceController; @class FakeInterfaceController; @protocol TestableWKInterfaceController <NSObject> - (void)awakeWithContext:(id)context; - (void)willActivate; - (void)didDeactivate; @optional - (void)pushControllerWithName:(NSString *)name context:(id)context; - (void)presentControllerWithName:(NSString *)name context:(id)context; @end
#import <Foundation/Foundation.h> @class WKInterfaceController; @class FakeInterfaceController; @protocol TestableWKInterfaceController <NSObject> - (void)awakeWithContext:(id)context; - (void)willActivate; - (void)didDeactivate; @optional - (NSArray *)sent_messages; - (void)pushControllerWithName:(NSString *)name context:(id)context; - (void)presentControllerWithName:(NSString *)name context:(id)context; @end
Add sent_messages array to testable controller interface
Add sent_messages array to testable controller interface
C
mit
pivotaltracker/PivotalCoreKit,gudatcomputers/PivotalCoreKit,gudatcomputers/PivotalCoreKit,briancroom/PivotalCoreKit,mjstallard/PivotalCoreKit,pivotal/PivotalCoreKit,idoru/PivotalCoreKit,idoru/PivotalCoreKit,joemasilotti/PivotalCoreKit,jfuchs/PivotalCoreKit,joemasilotti/PivotalCoreKit,jfuchs/PivotalCoreKit
939eaa5c04c3953bf85a361d14f14a9f8cbb5fe0
chapter1/temp-rev.c
chapter1/temp-rev.c
#include <stdio.h> main() { float fahr, celsius; float lower, upper, step; lower = 0; upper = 300; step = 20; celsius = lower; printf("%6s\t%3s\n", "celsius", "fahr"); while (celsius <= upper) { fahr = celsius * (9.0/5.0) + 32.0; printf("%6.1f\t%3.0f\n", celsius, fahr); celsius = celsius + step; } }
Add chapter 1 extra exercises
Add chapter 1 extra exercises
C
mit
melonmanchan/k-and-r
ba621e3b245e0ca2dcd80aeb1d51f617feceac51
searchcore/src/vespa/searchcore/proton/server/executor_threading_service_stats.h
searchcore/src/vespa/searchcore/proton/server/executor_threading_service_stats.h
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/vespalib/util/threadstackexecutorbase.h> namespace proton { class ExecutorThreadingServiceStats { public: using Stats = vespalib::ThreadStackExecutorBase::Stats; private: Stats _masterExecutorStats; Stats _indexExecutorStats; Stats _summaryExecutorStats; Stats _indexFieldInverterExecutorStats; Stats _indexFieldWriterExecutorStats; Stats _attributeFieldWriterExecutorStats; public: ExecutorThreadingServiceStats(Stats masterExecutorStats, Stats indexExecutorStats, Stats summaryExecutorStats, Stats indexFieldInverterExecutorStats, Stats indexFieldWriterExecutorStats, Stats attributeFieldWriterExecutorStats); ~ExecutorThreadingServiceStats(); const Stats &getMasterExecutorStats() const { return _masterExecutorStats; } const Stats &getIndexExecutorStats() const { return _indexExecutorStats; } const Stats &getSummaryExecutorStats() const { return _summaryExecutorStats; } const Stats &getIndexFieldInverterExecutorStats() const { return _indexFieldInverterExecutorStats; } const Stats &getIndexFieldWriterExecutorStats() const { return _indexFieldWriterExecutorStats; } const Stats &getAttributeFieldWriterExecutorStats() const { return _attributeFieldWriterExecutorStats; } }; }
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <cstddef> #include <vespa/vespalib/util/executor_stats.h> namespace proton { /* * This class contains executor stats for the executors used by a * document db. */ class ExecutorThreadingServiceStats { public: using Stats = vespalib::ExecutorStats; private: Stats _masterExecutorStats; Stats _indexExecutorStats; Stats _summaryExecutorStats; Stats _indexFieldInverterExecutorStats; Stats _indexFieldWriterExecutorStats; Stats _attributeFieldWriterExecutorStats; public: ExecutorThreadingServiceStats(Stats masterExecutorStats, Stats indexExecutorStats, Stats summaryExecutorStats, Stats indexFieldInverterExecutorStats, Stats indexFieldWriterExecutorStats, Stats attributeFieldWriterExecutorStats); ~ExecutorThreadingServiceStats(); const Stats &getMasterExecutorStats() const { return _masterExecutorStats; } const Stats &getIndexExecutorStats() const { return _indexExecutorStats; } const Stats &getSummaryExecutorStats() const { return _summaryExecutorStats; } const Stats &getIndexFieldInverterExecutorStats() const { return _indexFieldInverterExecutorStats; } const Stats &getIndexFieldWriterExecutorStats() const { return _indexFieldWriterExecutorStats; } const Stats &getAttributeFieldWriterExecutorStats() const { return _attributeFieldWriterExecutorStats; } }; }
Add class comment. Reduce indirections in using statement.
Add class comment. Reduce indirections in using statement.
C
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
cdd4ecd92bd54375dccc90633994626932a8c2c5
test/test_parser_one.c
test/test_parser_one.c
#include "test_parser.h" void one_or_more_one(void **state) { grammar_t *grammar = grammar_init( non_terminal("One"), rule_init( "One", one_or_more( terminal("11") ) ), 1 ); parse_t *result = parse("11", grammar); assert_non_null(result); assert_int_equal(result->length, 2); assert_int_equal(result->n_children, 1); } void one_or_more_many(void **state) { grammar_t *grammar = grammar_init( non_terminal("One"), rule_init( "One", one_or_more( terminal("11") ) ), 1 ); parse_t *result = parse("1111111", grammar); assert_non_null(result); assert_int_equal(result->length, 6); assert_int_equal(result->n_children, 3); } void one_or_more_failure(void **state) { grammar_t *grammar = grammar_init( non_terminal("One"), rule_init( "One", one_or_more( terminal("11") ) ), 1 ); parse_t *result = parse("1", grammar); assert_null(result); }
#include "test_parser.h" void one_or_more_one(void **state) { grammar_t *grammar = grammar_init( non_terminal("One"), rule_init( "One", one_or_more( terminal("11") ) ), 1 ); parse_result_t *result = parse("11", grammar); assert_non_null(result); assert_true(is_success(result)); parse_t *suc = result->data.result; assert_int_equal(suc->length, 2); assert_int_equal(suc->n_children, 1); } void one_or_more_many(void **state) { grammar_t *grammar = grammar_init( non_terminal("One"), rule_init( "One", one_or_more( terminal("11") ) ), 1 ); parse_result_t *result = parse("1111111", grammar); assert_non_null(result); assert_true(is_success(result)); parse_t *suc = result->data.result; assert_int_equal(suc->length, 6); assert_int_equal(suc->n_children, 3); } void one_or_more_failure(void **state) { grammar_t *grammar = grammar_init( non_terminal("One"), rule_init( "One", one_or_more( terminal("11") ) ), 1 ); parse_result_t *result = parse("1", grammar); assert_non_null(result); assert_true(is_error(result)); }
Use new API on one or more tests
Use new API on one or more tests
C
mit
Baltoli/peggo,Baltoli/peggo
23f49ce7ef21eae1fc27b42f772e274f4f5ad81f
JPEGReadWriter2Plugin/Error.c
JPEGReadWriter2Plugin/Error.c
#include <stdio.h> #include "jpeglib.h" #include <setjmp.h> struct error_mgr2 { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; typedef struct error_mgr2 * error_ptr2; /* * Here's the routine that will replace the standard error_exit method: */ void error_exit (j_common_ptr cinfo) { /* cinfo->err really points to a error_mgr2 struct, so coerce pointer */ error_ptr2 myerr = (error_ptr2) cinfo->err; /* Return control to the setjmp point */ longjmp(myerr->setjmp_buffer, 1); } 
#include <stdio.h> #include "jpeglib.h" #include <setjmp.h> struct error_mgr2 { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; typedef struct error_mgr2 * error_ptr2; /* * Here's the routine that will replace the standard error_exit method: */ void error_exit (j_common_ptr cinfo) { /* cinfo->err really points to a error_mgr2 struct, so coerce pointer */ error_ptr2 myerr = (error_ptr2) cinfo->err; /* Return control to the setjmp point */ longjmp(myerr->setjmp_buffer, 1); }
Remove nasty character at end of file that prevents compiles
Remove nasty character at end of file that prevents compiles git-svn-id: f18ccec24f938f15aa42574278fe0cc52f637e81@72 fa1542d4-bde8-0310-ad64-8ed1123d492a
C
mit
peteruhnak/pharo-vm,bencoman/pharo-vm,peteruhnak/pharo-vm,OpenSmalltalk/vm,bencoman/pharo-vm,OpenSmalltalk/vm,bencoman/pharo-vm,timfel/squeakvm,OpenSmalltalk/vm,peteruhnak/pharo-vm,OpenSmalltalk/vm,bencoman/pharo-vm,bencoman/pharo-vm,bencoman/pharo-vm,OpenSmalltalk/vm,timfel/squeakvm,timfel/squeakvm,bencoman/pharo-vm,bencoman/pharo-vm,peteruhnak/pharo-vm,bencoman/pharo-vm,timfel/squeakvm,timfel/squeakvm,timfel/squeakvm,timfel/squeakvm,peteruhnak/pharo-vm,OpenSmalltalk/vm,timfel/squeakvm,peteruhnak/pharo-vm,peteruhnak/pharo-vm,OpenSmalltalk/vm,OpenSmalltalk/vm,peteruhnak/pharo-vm
bdb9422317e0066978477b7e9c7b3063699aeb90
shared/types.h
shared/types.h
#pragma once #ifdef bool #undef bool #endif typedef char bool; #define true 1 #define false 0 typedef struct carp_thread* carp_thread_t; typedef void(*carp_thread_routine)(void* arg); typedef struct carp_library* carp_library_t; /* Init/shutdown */ void carp_platform_init(); void carp_platform_shutdown(); /* --- Threads --- */ carp_thread_t carp_thread_create(carp_thread_routine thread_routine, void* arg); void carp_thread_destroy(carp_thread_t thread); /* --- Timing --- */ int carp_millitime(); /* --- Libraries --- */ carp_library_t carp_load_library(const char* name); int carp_unload_library(carp_library_t lib); void* carp_find_symbol(carp_library_t lib, const char * name); char* carp_get_load_library_error(); /* -- misc -- */ void carp_sleep(int millis); typedef enum CARP_PLATFORM { CARP_PLATFORM_OSX = 0, CARP_PLATFORM_WINDOWS = 1, CARP_PLATFORM_LINUX = 2, CARP_PLATFORM_UNKNOWN = 100 } CARP_PLATFORM; CARP_PLATFORM carp_get_platform(); typedef struct { int count; void *data; } Array;
#pragma once #ifdef bool #undef bool #endif typedef int bool; #define true 1 #define false 0 typedef struct carp_thread* carp_thread_t; typedef void(*carp_thread_routine)(void* arg); typedef struct carp_library* carp_library_t; /* Init/shutdown */ void carp_platform_init(); void carp_platform_shutdown(); /* --- Threads --- */ carp_thread_t carp_thread_create(carp_thread_routine thread_routine, void* arg); void carp_thread_destroy(carp_thread_t thread); /* --- Timing --- */ int carp_millitime(); /* --- Libraries --- */ carp_library_t carp_load_library(const char* name); int carp_unload_library(carp_library_t lib); void* carp_find_symbol(carp_library_t lib, const char * name); char* carp_get_load_library_error(); /* -- misc -- */ void carp_sleep(int millis); typedef enum CARP_PLATFORM { CARP_PLATFORM_OSX = 0, CARP_PLATFORM_WINDOWS = 1, CARP_PLATFORM_LINUX = 2, CARP_PLATFORM_UNKNOWN = 100 } CARP_PLATFORM; CARP_PLATFORM carp_get_platform(); typedef struct { int count; void *data; } Array;
Change size of bool to 4
Change size of bool to 4
C
apache-2.0
carp-lang/Carp,eriksvedang/Carp,eriksvedang/Carp,carp-lang/Carp,carp-lang/Carp
5f177712db6e42a07bb02fb4bbb75d7584559b1f
src/utils/FMatrix3x3.h
src/utils/FMatrix3x3.h
//Copyright (c) 2020 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef FMATRIX3X3_H #define FMATRIX3X3_H namespace cura { class Point3; class FPoint3; class FMatrix3x3 { public: double m[3][3]; FMatrix3x3(); Point3 apply(const FPoint3& p) const; }; } //namespace cura #endif //FMATRIX3X3_H
//Copyright (c) 2020 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef FMATRIX3X3_H #define FMATRIX3X3_H namespace cura { class Point3; class FPoint3; /*! * A 3x3 linear transformation matrix. */ class FMatrix3x3 { public: /*! * The matrix data, row-endian. * * The first index is the column. The second index is the row. */ double m[3][3]; /*! * Construct an identity matrix. */ FMatrix3x3(); /*! * Apply this transformation to a coordinate. * * The result will also be converted to an integer-based coordinate * (``Point3``). * \param p The coordinate to transform. * \return A transformed coordinate. */ Point3 apply(const FPoint3& p) const; }; } //namespace cura #endif //FMATRIX3X3_H
Document the transformation matrix class
Document the transformation matrix class Brief, but just the gist of what people need to know to use this class. Contributes to issue CURA-7118.
C
agpl-3.0
Ultimaker/CuraEngine,Ultimaker/CuraEngine
bc07a64f87d24b573e1661b84ffb8d35288469ab
src/tests/unit/dictionary/linear_hash/test_linear_hash.h
src/tests/unit/dictionary/linear_hash/test_linear_hash.h
#ifndef TEST_LINEAR_HASH_H_ #define TEST_LINEAR_HASH_H_ #include <stdio.h> #include <string.h> #include <limits.h> #include "../../../planckunit/src/planck_unit.h" #include "../../../../dictionary/linear_hash/linear_hash.h" #ifdef __cplusplus extern "C" { #endif void runalltests_linear_hash(); #ifdef __cplusplus } #endif #endif
#ifndef TEST_LINEAR_HASH_H_ #define TEST_LINEAR_HASH_H_ #include <stdio.h> #include <string.h> #include <limits.h> #include <math.h> #include "../../../planckunit/src/planck_unit.h" #include "../../../../dictionary/linear_hash/linear_hash.h" #ifdef __cplusplus extern "C" { #endif void runalltests_linear_hash(); #ifdef __cplusplus } #endif #endif
Add include for math.h to lin hash
Add include for math.h to lin hash
C
bsd-3-clause
iondbproject/iondb,iondbproject/iondb
3ded2006e60424de131b6ef246268ebe86b4299d
test/CodeGen/vector.c
test/CodeGen/vector.c
// RUN: clang-cc -emit-llvm %s -o - typedef short __v4hi __attribute__ ((__vector_size__ (8))); void f() { __v4hi A = (__v4hi)0LL; } __v4hi x = {1,2,3}; __v4hi y = {1,2,3,4}; typedef int x __attribute((vector_size(16))); int a() { x b; return b[2LL]; }
// RUN: clang-cc -emit-llvm %s -o - typedef short __v4hi __attribute__ ((__vector_size__ (8))); void f() { __v4hi A = (__v4hi)0LL; } __v4hi x = {1,2,3}; __v4hi y = {1,2,3,4}; typedef int vty __attribute((vector_size(16))); int a() { vty b; return b[2LL]; }
Fix silly mistake in test.
Fix silly mistake in test. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@67897 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,apple/swift-clang,apple/swift-clang,llvm-mirror/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
33d12078e7e5a82f790781845d043d70511642dd
test/cunit/test_log.c
test/cunit/test_log.c
/********************************************************************* * * test_log.c: Riak C Unit Testing logger * * Copyright (c) 2007-2014 Basho Technologies, Inc. All Rights Reserved. * * This file is provided to you under the Apache License, * Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *********************************************************************/ #include <stdlib.h> #include <stdio.h> #include <stddef.h> #include <string.h> #include <time.h> #include "riak.h" void test_log(void *ptr, riak_log_level_t level, const char *file, riak_size_t filelen, const char *func, riak_size_t funclen, riak_uint32_t line, const char *format, va_list args) { time_t ltime; struct tm result; char stime[32]; char output[2048]; ltime = time(NULL); localtime_r(&ltime, &result); strftime(stime, sizeof(stime), "%F %X %Z", &result); riak_size_t wrote = snprintf(output, sizeof(output), "%s %s ", stime, riak_log_level_description(level)); char *pos = output + wrote; wrote += vsnprintf(pos, sizeof(output)-wrote, format, args); if (wrote < sizeof(output)-1) { strcat(output, "\n"); } // Just spew any output to stderr fprintf(stderr, "%s", output); }
Add GET message integration test - Make unit testing write fuller test objects - Make the number of buckets/keys in dummy object configurable - Add several helper functions like comparing binaries and objects - Improve error reporting in testing async callbacks
Add GET message integration test - Make unit testing write fuller test objects - Make the number of buckets/keys in dummy object configurable - Add several helper functions like comparing binaries and objects - Improve error reporting in testing async callbacks
C
apache-2.0
basho-labs/riak-c-client,basho-labs/riak-c-client,basho-labs/riak-c-client,basho-labs/riak-c-client
ddbf27ab3cd541c7bff8781cca68e44acabf1285
UnitTests/Source/GITTestHelper.h
UnitTests/Source/GITTestHelper.h
#import <Foundation/Foundation.h> #import <GHUnit/GHUnit.h> //#import <SenTestingKit/SenTestingKit.h> #define COCOAGIT_REPO @"." #define TEST_RESOURCES_PATH @"../../UnitTests/Resources/" #define DOT_GIT TEST_RESOURCES_PATH @"dot_git/" #define DELTA_REF_PACK TEST_RESOURCES_PATH @"packs/cg-0.2.5-deltaref-be5a15ac583f7ed1e431f03bd444bbde6511e57c.pack" #define DELTA_OFS_PACK TEST_RESOURCES_PATH @"packs/cg-0.2.5-deltaofs-be5a15ac583f7ed1e431f03bd444bbde6511e57c.pack" @interface GITTestHelper : NSObject {} + (NSString *) createTempRepoWithDotGitDir:(NSString *)clonePath; + (BOOL) removeTempRepoAtPath:(NSString *)aPath; + (NSDictionary *)packedObjectInfo; @end
#import <Foundation/Foundation.h> #import <GHUnit/GHUnit.h> //#import <SenTestingKit/SenTestingKit.h> #define COCOAGIT_REPO @"." #define TEST_RESOURCES_PATH @"../../UnitTests/Resources/" #define TEST_FIXTURES_PATH TEST_RESOURCES_PATH @"fixtures/" #define DOT_GIT TEST_RESOURCES_PATH @"dot_git/" #define DELTA_REF_PACK TEST_RESOURCES_PATH @"packs/cg-0.2.5-deltaref-be5a15ac583f7ed1e431f03bd444bbde6511e57c.pack" #define DELTA_OFS_PACK TEST_RESOURCES_PATH @"packs/cg-0.2.5-deltaofs-be5a15ac583f7ed1e431f03bd444bbde6511e57c.pack" @interface GITTestHelper : NSObject {} + (NSString *) createTempRepoWithDotGitDir:(NSString *)clonePath; + (BOOL) removeTempRepoAtPath:(NSString *)aPath; + (NSDictionary *)packedObjectInfo; @end
Add 'fixtures' path definition to test helper.
Add 'fixtures' path definition to test helper.
C
mit
geoffgarside/cocoagit,geoffgarside/cocoagit
0592fa31377e77d62caa48ef1fb41896d6eea791
sketches/utils/blinkm_write_script/light_script_aim.h
sketches/utils/blinkm_write_script/light_script_aim.h
/** * "Aim lights" light script * * Turn on all the lights for 30 seconds so they can be aimed */ // Copied from todbot // format of light script lines: duration, command, arg1,arg2,arg3 typedef struct _blinkm_script_line { uint8_t dur; uint8_t cmd[4]; // cmd,arg1,arg2,arg3 } blinkm_script_line; // start dark, lighten to mid-day, then slowly fade away blinkm_script_line script_lines[] = { { 1, {'f', 1,00,00}}, // fade speed (slow) { 1, {'t', 1,0,0}}, // time adjust (slower) { 300, {'c', 0xff,0xff,0xff}}, // stay bright for mid-day { 100, {'c', 0x00,0x00,0x00}}, // fade to black };
Set one LED group on for light aiming
Set one LED group on for light aiming
C
mit
wmadill/grant-lighting,wmadill/grant-lighting
d1947ce509d745f32db6b7fecc03dc9c778b9350
SecurityPkg/Include/Guid/TcgPhysicalPresenceStorageData.h
SecurityPkg/Include/Guid/TcgPhysicalPresenceStorageData.h
/** @file Define the variable data structures used for physical presence storage data. Copyright (c) 2016, Intel Corporation. All rights reserved. <BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef __TCG_PHYSICAL_PRESENCE_STORAGE_DATA_GUID_H__ #define __TCG_PHYSICAL_PRESENCE_STORAGE_DATA_GUID_H__ #define EFI_TCG_PHYSICAL_PRESENCE_STORAGE_DATA_GUID \ { \ 0x2EBE3E34, 0xB3CD, 0x471A, { 0xBF, 0x87, 0xB3, 0xC6, 0x6E, 0xE0, 0x74, 0x9A} \ } // // This variable is used to save TCG2 Management Flags and corresponding operations. // It should be protected from malicious software (e.g. Set it as read-only variable). // #define TCG_PHYSICAL_PRESENCE_STORAGE_FLAGS_VARIABLE L"TcgPhysicalPresenceStorageFlags" typedef struct { UINT32 PPFlags; } EFI_TCG_PHYSICAL_PRESENCE_STORAGE_FLAGS; extern EFI_GUID gEfiTcgPhysicalPresenceStorageGuid; #endif
Add definition for Physical Presence storage flag.
SecurityPkg: Add definition for Physical Presence storage flag. Reviewed-by: Jiewen Yao <364a90bfebd1f362ebb7b48e4bf8ec010adef203@intel.com> Reviewed-by: Chao Zhang <fed49a7a524fbe970930fd44cd2de5a9d4952d81@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <fa9eeec52367040ac98013bc4b2913db170588f8@intel.com>
C
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
285a6f65380d98a239a952dece7d2cc60d694dcb
A/02/15/task2.c
A/02/15/task2.c
#include <stdio.h> #include <string.h> char* find(char *haystack, char needle); int main(){ char input[401]={'\0'}, symbol, *result; fgets(input, 401, stdin); symbol=getchar(); result=find(input, symbol); if(result!=NULL){ printf("%ld", result - input); } else{ printf("-1"); } return 0; } char* find(char *haystack, char needle){ int i; char *result=NULL; for(i=0; i<400 && haystack[i]!='\0'; i++){ if(haystack[i]==needle){ result=&haystack[i]; break; } } return result;
#include <stdio.h> #include <string.h> char* find(char *haystack, char needle); int main(){ char input[401]={'\0'}, symbol, *result; fgets(input, 401, stdin); symbol=getchar(); result=find(input, symbol); if(result!=NULL){ printf("%d", (int)(result - input)); } else{ printf("-1"); } return 0; } char* find(char *haystack, char needle){ int i; char *result=NULL; for(i=0; i<400 && haystack[i]!='\0'; i++){ if(haystack[i]==needle){ result=&haystack[i]; break; } } return result; }
Add closing bracket to open function in task 02 homework 02
Add closing bracket to open function in task 02 homework 02
C
mit
elsys/po-homework
884ccfb98a4cf5c1f12fb5b71271a238379e1d96
examples/src/example_reduce.c
examples/src/example_reduce.c
/* * example2.c * * Created on: 3 May 2016 * Author: nick */ #include "ndm.h" #include <mpi.h> #include <stdio.h> void recvFunction(void*, NDM_Metadata); int main(int argc, char* argv[]) { int provided; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided); ndmInit(); char uuid[10]; int data = 10; ndmReduce(&data, 1, NDM_INT, NDM_SUM, recvFunction, 0, NDM_GLOBAL_GROUP, "a"); ndmGroupRank(NDM_GLOBAL_GROUP, &data); ndmAllReduce(&data, 1, NDM_INT, NDM_MAX, recvFunction, NDM_GLOBAL_GROUP, "maxrank"); ndmFinalise(); MPI_Finalize(); return 0; } void recvFunction(void* buffer, NDM_Metadata metaData) { printf("Got reduction data '%d' with uuid %s on pid %d\n", *((int*)buffer), metaData.unique_id, metaData.my_rank); }
/* * example2.c * * Created on: 3 May 2016 * Author: nick */ #include "ndm.h" #include <mpi.h> #include <stdio.h> void recvFunction(void*, NDM_Metadata); void additiveRecvFunction(void*, NDM_Metadata); int main(int argc, char* argv[]) { int provided; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided); ndmInit(); char uuid[10]; int data = 10; ndmReduce(&data, 1, NDM_INT, NDM_SUM, recvFunction, 0, NDM_GLOBAL_GROUP, "a"); ndmGroupRank(NDM_GLOBAL_GROUP, &data); ndmAllReduce(&data, 1, NDM_INT, NDM_MAX, recvFunction, NDM_GLOBAL_GROUP, "maxrank"); data = 5; ndmReduceAdditive(&data, 1, NDM_INT, 12, 1, 0, NDM_SUM, additiveRecvFunction, 0, NDM_GLOBAL_GROUP, "additive"); ndmReduceAdditive(&data, 1, NDM_INT, 12, 1, 0, NDM_SUM, additiveRecvFunction, 0, NDM_GLOBAL_GROUP, "additive"); ndmFinalise(); MPI_Finalize(); return 0; } void recvFunction(void* buffer, NDM_Metadata metaData) { printf("Got reduction data '%d' with uuid %s on pid %d\n", *((int*)buffer), metaData.unique_id, metaData.my_rank); } void additiveRecvFunction(void* buffer, NDM_Metadata metaData) { printf("Got additive data '%d'\n", *((int*)buffer)); }
Reduce example uses additive calls
Reduce example uses additive calls
C
mit
mesham/ndm,mesham/ndm
10491403f35d32d63537fb6409fb6282d9e480d3
src/main/cpp/JniHelpersCommon.h
src/main/cpp/JniHelpersCommon.h
#ifndef __JniHelpersCommon_h__ #define __JniHelpersCommon_h__ // Disable some annoying compiler warnings #if WIN32 #pragma warning(disable: 4996) // "Security" warnings for vsnprintf #endif #if WIN32 #define EXPORT __declspec(dllexport) #else #define EXPORT #endif #include <jni.h> #define kTypeInt "I" #define kTypeLong "J" #define kTypeFloat "F" #define kTypeDouble "D" #define kTypeBool "Z" #define kTypeByte "B" #define kTypeVoid "V" // Common Java classes #define kTypeJavaClass(x) "Ljava/lang/" #x ";" #define kTypeJavaException "L/java/lang/Exception" #define kTypeJavaString "Ljava/lang/String" // Array builder macro #define kTypeArray(x) "[" x #endif // __JniHelpersCommon_h__
#ifndef __JniHelpersCommon_h__ #define __JniHelpersCommon_h__ // Disable some annoying compiler warnings #if WIN32 #pragma warning(disable: 4996) // "Security" warnings for vsnprintf #endif #if WIN32 #define EXPORT __declspec(dllexport) #else #define EXPORT #endif #include <jni.h> #define kTypeInt "I" #define kTypeLong "J" #define kTypeFloat "F" #define kTypeDouble "D" #define kTypeBool "Z" #define kTypeByte "B" #define kTypeVoid "V" // Common Java classes #define kTypeJavaClass(x) "Ljava/lang/" #x ";" #define kTypeJavaException "Ljava/lang/Exception;" #define kTypeJavaString "Ljava/lang/String;" // Array builder macro #define kTypeArray(x) "[" x #endif // __JniHelpersCommon_h__
Fix type signatures for some java bulit-ins
Fix type signatures for some java bulit-ins
C
apache-2.0
spotify/JniHelpers,spotify/JniHelpers,spotify/JniHelpers,spotify/JniHelpers
842d01a134bbd2f62308d0cfe8c1587575fbbef5
Code/Maveric_myCopter/src/config/MAVsettings/MAV102_conf_imu_rev4.h
Code/Maveric_myCopter/src/config/MAVsettings/MAV102_conf_imu_rev4.h
/* * conf_imu_rev4.h * * Created: 20/11/2013 22:21:49 * Author: sfx */ #ifndef CONF_IMU_REV4_H_ #define CONF_IMU_REV4_H_ #define RAW_GYRO_X 0 #define RAW_GYRO_Y 1 #define RAW_GYRO_Z 2 #define RAW_ACC_X 0 #define RAW_ACC_Y 1 #define RAW_ACC_Z 2 #define RAW_COMPASS_X 2 #define RAW_COMPASS_Y 0 #define RAW_COMPASS_Z 1 // from datasheet: FS 2000dps --> 70 mdps/digit // scale = 1/(0.07 * PI / 180.0) = 818.5111 #define RAW_GYRO_X_SCALE 818.5111 #define RAW_GYRO_Y_SCALE 818.5111 #define RAW_GYRO_Z_SCALE 818.5111 #define GYRO_AXIS_X 1.0 #define GYRO_AXIS_Y -1.0 #define GYRO_AXIS_Z -1.0 #define RAW_ACC_X_SCALE 4033.35 #define RAW_ACC_Y_SCALE 3997.92 #define RAW_ACC_Z_SCALE 4081.49 #define ACC_BIAIS_X -123.22 #define ACC_BIAIS_Y 143.87 #define ACC_BIAIS_Z 207.7505405 #define ACC_AXIS_X 1.0 #define ACC_AXIS_Y -1.0 #define ACC_AXIS_Z -1.0 #define RAW_MAG_X_SCALE 619.57 #define RAW_MAG_Y_SCALE 638.39 #define RAW_MAG_Z_SCALE 563.41 #define MAG_BIAIS_X -121.169232 #define MAG_BIAIS_Y -189.6727777 #define MAG_BIAIS_Z -162.58148486 #define MAG_AXIS_X -1.0 #define MAG_AXIS_Y -1.0 #define MAG_AXIS_Z -1.0 #endif /* CONF_IMU_REV4_H_ */
Add calibration file for board J2 (MAV102)
Add calibration file for board J2 (MAV102)
C
bsd-3-clause
lis-epfl/MAVRIC_Library,lis-epfl/MAVRIC_Library,lis-epfl/MAVRIC_Library,gburri/MAVRIC_Library,gburri/MAVRIC_Library,gburri/MAVRIC_Library
27c11cd3fd8666e659e1eaad071e6a825216b0f1
include/synaptics.h
include/synaptics.h
/* * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without * fee, provided that the above copyright notice appear in all copies * and that both that copyright notice and this permission notice * appear in supporting documentation, and that the name of Red Hat * not be used in advertising or publicity pertaining to distribution * of the software without specific, written prior permission. Red * Hat makes no representations about the suitability of this software * for any purpose. It is provided "as is" without express or implied * warranty. * * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _SYNAPTICS_H_ #define _SYNAPTICS_H_ #include <X11/Xdefs.h> /****************************************************************************** * Public definitions. * Used by driver and the shared memory configurator *****************************************************************************/ #define SHM_SYNAPTICS 23947 typedef struct _SynapticsSHM { int version; /* Driver version */ /* Current device state */ int x, y; /* actual x, y coordinates */ int z; /* pressure value */ int numFingers; /* number of fingers */ int fingerWidth; /* finger width value */ int left, right, up, down; /* left/right/up/down buttons */ Bool multi[8]; Bool middle; } SynapticsSHM; /* * Minimum and maximum values for scroll_button_repeat */ #define SBR_MIN 10 #define SBR_MAX 1000 #endif /* _SYNAPTICS_H_ */
Put SynapticsSHM back into the driver to be able to use synclient -m once again
Put SynapticsSHM back into the driver to be able to use synclient -m once again
C
mit
felipejfc/xserver-xorg-input-synaptics,sencer/synaptics,felipejfc/xserver-xorg-input-synaptics,felipejfc/xserver-xorg-input-synaptics,sencer/synaptics
9e317ee873422d95bee44059585ea107f12d76ab
alura/c/forca.c
alura/c/forca.c
#include <stdio.h> #include <string.h> void abertura() { printf("*******************\n"); printf("* Jogo de Forca *\n"); printf("*******************\n\n"); } int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; char chutes[26]; int tentativas = 0; abertura(); do { for(int i = 0; i < strlen(palavrasecreta); i++) { int achou = 0; for(int j = 0; j < tentativas; j++) { if(chutes[j] == palavrasecreta[i]) { achou = 1; break; } } if(achou) { printf("%c ", palavrasecreta[i]); } else { printf("_ "); } } printf("\n"); char chute; printf("Qual letra? "); scanf(" %c", &chute); chutes[tentativas] = chute; tentativas++; } while(!acertou && !enforcou); }
#include <stdio.h> #include <string.h> void abertura() { printf("*******************\n"); printf("* Jogo de Forca *\n"); printf("*******************\n\n"); } void chuta() { char chute; printf("Qual letra? "); scanf(" %c", &chute); chutes[tentativas] = chute; tentativas++; } int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; char chutes[26]; int tentativas = 0; abertura(); do { // imprime a palavra secreta for(int i = 0; i < strlen(palavrasecreta); i++) { int achou = 0; // a letra ja foi chutada? for(int j = 0; j < tentativas; j++) { if(chutes[j] == palavrasecreta[i]) { achou = 1; break; } } if(achou) { printf("%c ", palavrasecreta[i]); } else { printf("_ "); } } printf("\n"); chuta(); } while(!acertou && !enforcou); }
Update files, Alura, Introdução a C - Parte 2, Aula 4.2
Update files, Alura, Introdução a C - Parte 2, Aula 4.2
C
mit
fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs
bf666ed43d3e13c4234487585589f82370608d8e
compat.h
compat.h
#ifndef COMPAT_H #define COMPAT_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef __dead #define __dead #endif #ifndef HAVE_REALLOCARRAY void *reallocarray(void *, size_t, size_t); #endif /* !HAVE_REALLOCARRAY */ #endif /* COMPAT_H */
#ifndef COMPAT_H #define COMPAT_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef __FreeBSD__ #define __dead __dead2 #endif /* __FreeBSD__ */ #if defined(__linux__) || defined(__CYGWIN__) #ifndef __dead #ifdef __GNUC__ #define __dead __attribute__((__noreturn__)) #else #define __dead #endif #endif #endif /* __linux__ || __CYGWIN__ */ #ifndef HAVE_REALLOCARRAY void *reallocarray(void *, size_t, size_t); #endif /* !HAVE_REALLOCARRAY */ #endif /* COMPAT_H */
Revert "Only define __dead if it's missing"
Revert "Only define __dead if it's missing" This reverts commit 7f5694ac1cf3a68b462a9f22e03a12a719249ee5. Partial fix to #202.
C
mit
DBOTW/pick,thoughtbot/pick,thoughtbot/pick,DBOTW/pick,DBOTW/pick,calleerlandsson/pick,calleerlandsson/pick,thoughtbot/pick,thoughtbot/pick,calleerlandsson/pick
3c593c947c55984815838c6ad7dce3b66cced4a3
test/CFrontend/2008-02-11-AnnotateBuiltin.c
test/CFrontend/2008-02-11-AnnotateBuiltin.c
// RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | grep llvm.annotation int main() { int x = 0; return __builtin_annotation(x, "annotate"); }
Test case for annotate builtin.
Test case for annotate builtin. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@46999 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap
58a63187d7c783687c04349e59c72d2f3a04af42
Smartling.i18n/SmartlingLib.h
Smartling.i18n/SmartlingLib.h
// Copyright 2015 Smartling, Inc. // 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 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. // // SmartlingLib.h // SmartlingLib // // Created by Pavel Ivashkov on 2015-05-15. // #import <UIKit/UIKit.h> //! Project version number for SmartlingLib. FOUNDATION_EXPORT double SmartlingLibVersionNumber; //! Project version string for SmartlingLib. FOUNDATION_EXPORT const unsigned char SmartlingLibVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <SmartlingLib/PublicHeader.h> #import <SmartlingLib/SLLocalization.h>
// Copyright 2015 Smartling, Inc. // 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 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. // // SmartlingLib.h // SmartlingLib // // Created by Pavel Ivashkov on 2015-05-15. // #import <UIKit/UIKit.h> //! Project version number for SmartlingLib. FOUNDATION_EXPORT double SmartlingLibVersionNumber; //! Project version string for SmartlingLib. FOUNDATION_EXPORT const unsigned char SmartlingLibVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <SmartlingLib/PublicHeader.h> #import "SLLocalization.h"
Fix import to be able to use Smartling.i18n as dynamic framework via cocoapods
Fix import to be able to use Smartling.i18n as dynamic framework via cocoapods
C
apache-2.0
Smartling/ios-i18n,belkevich/ios-i18n,Smartling/ios-i18n,belkevich/ios-i18n
22feab4c47ae7b5a6f41cbcdf83a6649ae62b0a1
cpp/Spellable.h
cpp/Spellable.h
// Spellable.h #ifndef SPELLABLE_H #define SPELLABLE_H #include <string> template <class T> class Spellable { T* value; public: Spellable() {}; Spellable(T* value): value(value) {} Spellable(T v) { value = new T(v); } void SetValue(T* v) { value = v; } void SetValue(T v) { value = new T(v); } T GetValue() const { return *value; } std::string spell(); // Let's do arithmetic! Spellable & operator=(const T &rhs) { SetValue(rhs); } Spellable & operator+=(const T &rhs) { *value += rhs; return *this; } bool operator==(const T &other) const { return *value == other; } bool operator==(const std::string &other) const { return spell() == other; } }; // http://www.codeproject.com/Articles/48575/How-to-define-a-template-class-in-a-h-file-and-imp // The linker gets confused if we don't include the implementation here. #include "Spellable.cpp" #endif // Spellable.h
// Spellable.h #ifndef SPELLABLE_H #define SPELLABLE_H #include <string> template <class T> class Spellable { T* value; public: // TODO: new values are never deleted! Spellable() { value = NULL; }; Spellable(T* value): value(value) {} Spellable(T v) { value = new T(v); } void SetValue(T* v) { value = v; } void SetValue(T v) { value = new T(v); } T GetValue() const { return *value; } std::string spell(); // Let's do arithmetic! Spellable & operator=(const T &rhs) { SetValue(rhs); } Spellable & operator+=(const T &rhs) { *value += rhs; return *this; } bool operator==(const T &other) const { return *value == other; } bool operator==(const std::string &other) const { return spell() == other; } protected: std::string spellFraction(); }; // http://www.codeproject.com/Articles/48575/How-to-define-a-template-class-in-a-h-file-and-imp // The linker gets confused if we don't include the implementation here. #include "Spellable.cpp" #endif // Spellable.h
Handle precision of fractions better
Handle precision of fractions better
C
cc0-1.0
dancxjo/spell-dollars,dancxjo/spell-dollars,dancxjo/spell-dollars
cf1dc543f142263917468c19249d6a3e920b17b2
src/entropy/win32_stats/es_win32.h
src/entropy/win32_stats/es_win32.h
/** * Win32 EntropySource Header File * (C) 1999-2008 Jack Lloyd */ #ifndef BOTAN_ENTROPY_SRC_WIN32_H__ #define BOTAN_ENTROPY_SRC_WIN32_H__ #include <botan/entropy_src.h> namespace Botan { /** * Win32 Entropy Source */ class BOTAN_DLL Win32_EntropySource : public EntropySource { public: std::string name() const { return "Win32 Statistics"; } void fast_poll(byte buf[], u32bit length); void slow_poll(byte buf[], u32bit length); }; } #endif
/** * Win32 EntropySource Header File * (C) 1999-2008 Jack Lloyd */ #ifndef BOTAN_ENTROPY_SRC_WIN32_H__ #define BOTAN_ENTROPY_SRC_WIN32_H__ #include <botan/entropy_src.h> namespace Botan { /** * Win32 Entropy Source */ class BOTAN_DLL Win32_EntropySource : public EntropySource { public: std::string name() const { return "Win32 Statistics"; } u32bit fast_poll(byte buf[], u32bit length); u32bit slow_poll(byte buf[], u32bit length); }; } #endif
Fix return types in declaration
Fix return types in declaration
C
bsd-2-clause
webmaster128/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan
303c1b421822d50d2f7313ae538e2dc33f096d33
deps/include/cgen_intrinsics.h
deps/include/cgen_intrinsics.h
/* Copyright (c) 2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // count trailing zeros with llvm semantics int cgen_cttz_int(int n) { if(n==0) return sizeof(int); return __builtin_ctz(n); } int cgen_flipsign_int(int64_t x, int64_t y) { return (y >= 0 ? x : -x); }
/* Copyright (c) 2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // count trailing zeros with llvm semantics int64_t cgen_cttz_int(int64_t n) { if(n==0) return sizeof(int64_t); return __builtin_ctz(n); } int64_t cgen_flipsign_int(int64_t x, int64_t y) { return (y >= 0 ? x : -x); }
Use int64_t for cgen intrinsics
Use int64_t for cgen intrinsics
C
bsd-2-clause
JuliaPackageMirrors/ParallelAccelerator.jl,IntelLabs/ParallelAccelerator.jl,malekbr/julia-to-tiramisu
057101774bb1130712d69607015dfc13df81256d
src/template.c
src/template.c
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> #include <errno.h> #include <sys/stat.h> off_t get_file_size(const char *filename) { struct stat buffer; return (stat(filename, &buffer)==0 ? buffer.st_size : -1); } int file_is_readable(char *filename) { if ( access(filename, R_OK) != -1 ) { return 1; } else { return 0; } } int main(int argc, char *argv[]) { clock_t t0, t1; if (argc <= 1) { printf("Usage: %s [arguments]\n", argv[0]); return EXIT_FAILURE; } t0 = clock(); printf("Hello World!\n"); if (file_is_readable(argv[1])) { printf("Input File = '%s'\n", argv[1]); } else { printf("Input File = '%s' (file does not exist or read permissions absent)\n", argv[1]); } t1 = clock(); printf("Time elapsed = %f (ms)\n", (t1-t0)*1000/(double)CLOCKS_PER_SEC ); return EXIT_SUCCESS; }
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> #include <errno.h> #include <sys/stat.h> off_t get_file_size(const char *filename) { struct stat buffer; return (stat(filename, &buffer)==0 ? buffer.st_size : -1); } int file_is_readable(char *filename) { if ( access(filename, R_OK) != -1 ) { return 1; } else { return 0; } } int main(int argc, char *argv[]) { clock_t t0, t1; if (argc <= 1) { printf("Usage: %s [arguments]\n", argv[0]); return EXIT_FAILURE; } t0 = clock(); printf("Hello World!\n"); if (file_is_readable(argv[1])) { printf("Input File = '%s'\n", argv[1]); printf("File size is %lld\n", get_file_size(argv[1])); } else { printf("Input File = '%s' (file does not exist or read permissions absent)\n", argv[1]); } t1 = clock(); printf("Time elapsed = %f (ms)\n", (t1-t0)*1000/(double)CLOCKS_PER_SEC ); return EXIT_SUCCESS; }
Add printing of file size
Add printing of file size
C
apache-2.0
nathanielng/code-templates,nathanielng/code-templates,nathanielng/code-templates
5146b6a58c922e99626f9c8a9f8bd7d042ab7536
hist/inc/TH1I.h
hist/inc/TH1I.h
// @(#)root/hist:$Name: $:$Id: TH1I.h,v 1.1 2002/05/18 11:02:49 brun Exp $ // Author: Rene Brun 08/09/2003 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TH1I #define ROOT_TH1I ////////////////////////////////////////////////////////////////////////// // // // TH1I // // // // 1-Dim histogram with a 4 bits integer per channel // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TH1 #include "TH1.h" #endif #endif
// @(#)root/hist:$Name: $:$Id: TH1I.h,v 1.1 2003/09/08 12:50:23 brun Exp $ // Author: Rene Brun 08/09/2003 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TH1I #define ROOT_TH1I ////////////////////////////////////////////////////////////////////////// // // // TH1I // // // // 1-Dim histogram with a 32 bits integer per channel // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TH1 #include "TH1.h" #endif #endif
Fix a typo (thanks to Robert Hatcher)
Fix a typo (thanks to Robert Hatcher) git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@10919 27541ba8-7e3a-0410-8455-c3a389f83636
C
lgpl-2.1
bbannier/ROOT,dawehner/root,dawehner/root,dawehner/root,bbannier/ROOT,dawehner/root,dawehner/root,dawehner/root,bbannier/ROOT,dawehner/root,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,dawehner/root,bbannier/ROOT
ba9bc2d01d0b260f73b1eb087afc057bb3538eb5
MBTA-APIs/Services/MBTA-v2/ServiceMBTA_sensitive.h
MBTA-APIs/Services/MBTA-v2/ServiceMBTA_sensitive.h
// // ServiceMBTA_sensitive.h // MBTA-APIs // // Created by Steve Caine on 01/05/115. // Copyright (c) 2015 Steve Caine. All rights reserved. // // your private key to the MBTA-v2 API goes here #define key_MBTA_v2_API @"" // you should not commit any version of this file that contains the key // to any source-control repository that will be made public or otherwise shared
// // ServiceMBTA_sensitive.h // MBTA-APIs // // Created by Steve Caine on 01/05/15. // Copyright (c) 2015 Steve Caine. All rights reserved. // // your private key to the MBTA-v2 API goes here #define key_MBTA_v2_API @"" // you should not commit any version of this file that contains the key // to any source-control repository that will be made public or otherwise shared
Fix typo in created date.
Fix typo in created date.
C
mit
SteveCaine/MBTA-RestKit,SteveCaine/MBTA-RestKit
3249f48c79fefb59f834a02fb8c0acb816064610
include/shell.h
include/shell.h
#ifndef SHELL_H #define SHELL_H #include <stdbool.h> #define report_error() fprintf(stderr, "[%s: %s():%d] %s\n", __FILE__, \ __FUNCTION__, \ __LINE__, \ strerror(errno)); #define sizeof_array(x) (sizeof(x) / sizeof(*x)) #define DEFAULT_PROMPT "$ " #define DEFAULT_PATH "/bin:/usr/bin/:/sbin/:/usr/local/bin" #define DEFAULT_HOME "/" typedef struct command_t{ char **array; unsigned int elements; }command_t; typedef struct shell_t{ bool running; struct environ_t *env; pid_t shell_pid; char *pwd; }shell_t; char *copy_string(const char *str); unsigned int count_token(char *string, const char *token_string); void free_command(command_t *command); command_t *parse(char *line); int change_shell_dir(char *path); int execute_builtins(char **input); int execute_command(command_t *c); #endif
#ifndef SHELL_H #define SHELL_H #include <stdbool.h> #define report_error() fprintf(stderr, "[%s: %s():%d] %s\n", __FILE__, \ __FUNCTION__, \ __LINE__, \ strerror(errno)); #define sizeof_array(x) (sizeof(x) / sizeof(*x)) typedef struct command_t{ char **array; unsigned int elements; }command_t; typedef struct shell_t{ bool running; struct environ_t *env; pid_t shell_pid; char *pwd; }shell_t; char *copy_string(const char *str); unsigned int count_token(char *string, const char *token_string); void free_command(command_t *command); command_t *parse(char *line); int change_shell_dir(char *path); int execute_builtins(char **input); int execute_command(command_t *c); #endif
Remove double definition of default env variables
Remove double definition of default env variables
C
mit
tywkeene/Shell
d95a2b00d4fb8f00865295192b524b3f047a2d96
temperature.c
temperature.c
// Copyright 2016, Jeffrey E. Bedard #include "temperature.h" #include "config.h" #include "font.h" #include "util.h" #include <stdio.h> uint8_t get_temp(void) { return xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE) / 1000; } // Returns x offset for next item uint16_t draw_temp(xcb_connection_t * xc, const uint16_t offset) { uint8_t sz = 4; const struct JBDim f = xstatus_get_font_size(); const int16_t x = offset + XSTATUS_CONST_PAD; { // buf scope char buf[sz]; sz = snprintf(buf, sz, "%dC", get_temp()); xcb_image_text_8(xc, sz, xstatus_get_window(xc), xstatus_get_gc(xc), x, f.h, buf); } return x + f.w * sz + XSTATUS_CONST_PAD; }
// Copyright 2016, Jeffrey E. Bedard #include "temperature.h" #include "config.h" #include "font.h" #include "util.h" #include <stdio.h> static uint8_t get_temp(void) { return xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE) / 1000; } static uint8_t format(char * restrict buf, const uint8_t sz) { return snprintf(buf, sz, "%dC", get_temp()); } // Returns x offset for next item uint16_t draw_temp(xcb_connection_t * xc, const uint16_t offset) { uint8_t sz = 4; const struct JBDim f = xstatus_get_font_size(); const int16_t x = offset + XSTATUS_CONST_PAD; { // buf scope char buf[sz]; sz = format(buf, sz); xcb_image_text_8(xc, sz, xstatus_get_window(xc), xstatus_get_gc(xc), x, f.h, buf); } return x + f.w * sz + XSTATUS_CONST_PAD; }
Make get_temp() static. Split out format().
Make get_temp() static. Split out format().
C
mit
jefbed/xstatus,jefbed/xstatus,jefbed/xstatus,jefbed/xstatus
2d612e6f8088ddb930dc26fc90e1ba2e3dd0284b
test2/vla/standard_nonconst.c
test2/vla/standard_nonconst.c
// RUN: %ocheck 1 '-DNULL=(void *)0' // RUN: %ocheck 0 '-DNULL=0' int null_is_ptr_type() { char s[1][1+(int)NULL]; int i = 0; sizeof s[i++]; return i; } main() { return null_is_ptr_type(); }
// RUN: %ocheck 1 %s '-DNULL=(void *)0' // RUN: %ocheck 0 %s '-DNULL=0' int null_is_ptr_type() { char s[1][1+(int)NULL]; int i = 0; sizeof s[i++]; return i; } main() { return null_is_ptr_type(); }
Fix standard-nonconst vla test commands
Fix standard-nonconst vla test commands
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
0b08a3698e0cc1a26d7a85238c5035ceeb564e3a
src/keyimpl.h
src/keyimpl.h
#pragma once #include "jwtxx/jwt.h" #include <string> namespace JWTXX { struct Key::Impl { virtual ~Impl() {} virtual std::string sign(const void* data, size_t size) const = 0; virtual bool verify(const void* data, size_t size, const std::string& signature) const = 0; }; }
#pragma once #include "jwtxx/jwt.h" #include <string> namespace JWTXX { struct Key::Impl { // Need this for polymorphic behavior. virtual ~Impl() = default; // Need this due to the Rule of Five. Impl() = default; Impl(const Impl&) = delete; Impl& operator=(const Impl&) = delete; Impl(Impl&&) = default; Impl& operator=(Impl&&) = default; virtual std::string sign(const void* data, size_t size) const = 0; virtual bool verify(const void* data, size_t size, const std::string& signature) const = 0; }; }
Enable move and disable copy for key implementations.
Enable move and disable copy for key implementations.
C
mit
madf/jwtxx,madf/jwtxx,RealImage/jwtxx,RealImage/jwtxx
c4eb3b452e12e514b75a77d2fe3caf0f64962353
iOS/PlayPlan/Profile/ProfileViewController.h
iOS/PlayPlan/Profile/ProfileViewController.h
// // ProfileViewController.h // PlayPlan // // Created by Zeacone on 15/11/8. // Copyright © 2015年 Zeacone. All rights reserved. // #import <UIKit/UIKit.h> #import "PlayPlan.h" @interface ProfileViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> @end
// // ProfileViewController.h // PlayPlan // // Created by Zeacone on 15/11/8. // Copyright © 2015年 Zeacone. All rights reserved. // #import <UIKit/UIKit.h> #import "PlayPlan.h" @class ProfileViewController; @protocol MainDelegate <NSObject> - (void)dismissViewController:(MainViewController *)mainViewController; @end @interface ProfileViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> @end
Add delegate for profile view controller.
Add delegate for profile view controller.
C
mit
Zeacone/PlayPlan,Zeacone/PlayPlan
205fdc8110e486b439b5ad280aba63f049a6b7e7
test2/inline/cant.c
test2/inline/cant.c
// RUN: %check -e %s #define always_inline __attribute((always_inline)) always_inline hidden(int); void always_inline __attribute((noinline)) noinline(void) { } always_inline void print(const char *fmt, ...) { } always_inline void old(a, b) int a, b; { } always_inline void addr(int x) { int *p = &x; *p = 3; } always_inline void write(int x) { x++; } always_inline void rec(int depth) { if(depth < 5) rec(depth + 1); // CHECK: can't always_inline function: can't see function } always_inline int should_inline() { return 3; } main() { should_inline(); // CHECK: !/warn|error/ rec(0); // CHECK: !/warn|error/ hidden(3); // CHECK: error: can't always_inline function: can't see function noinline(); // CHECK: error: can't always_inline noinline function print("hi", 3); // CHECK: error: can't always_inline function: variadic function print("hi"); // CHECK: error: can't always_inline function: variadic function old(3, 1); // CHECK: error: can't always_inline function: unspecified argument count function addr(5); // CHECK: error: can't always_inline function: argument written or addressed write(2); // CHECK: error: can't always_inline function: argument written or addressed }
Test inability to inline certain functions
Test inability to inline certain functions
C
mit
8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler
3c48e853eb6e6e85a4429b717620cfa9a5218867
SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c
SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c
/** @file Provides a secure platform-specific method to detect physically present user. Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ /** This function provides a platform-specific method to detect whether the platform is operating by a physically present user. Programmatic changing of platform security policy (such as disable Secure Boot, or switch between Standard/Custom Secure Boot mode) MUST NOT be possible during Boot Services or after exiting EFI Boot Services. Only a physically present user is allowed to perform these operations. NOTE THAT: This function cannot depend on any EFI Variable Service since they are not available when this function is called in AuthenticateVariable driver. @retval TRUE The platform is operated by a physically present user. @retval FALSE The platform is NOT operated by a physically present user. **/ BOOLEAN EFIAPI UserPhysicalPresent ( VOID ) { return FALSE; }
/** @file Provides a secure platform-specific method to detect physically present user. Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ /** This function provides a platform-specific method to detect whether the platform is operating by a physically present user. Programmatic changing of platform security policy (such as disable Secure Boot, or switch between Standard/Custom Secure Boot mode) MUST NOT be possible during Boot Services or after exiting EFI Boot Services. Only a physically present user is allowed to perform these operations. NOTE THAT: This function cannot depend on any EFI Variable Service since they are not available when this function is called in AuthenticateVariable driver. @retval TRUE The platform is operated by a physically present user. @retval FALSE The platform is NOT operated by a physically present user. **/ BOOLEAN EFIAPI UserPhysicalPresent ( VOID ) { return TRUE; }
Update the default return value of UserPhysicalPresent to TRUE.
Update the default return value of UserPhysicalPresent to TRUE. Signed-off-by: Fu, Siyuan <siyuan.fu@intel.com> Reviewed-by: Dong, Guo <guo.dong@intel.com> git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@13191 6f19259b-4bc3-4df7-8a09-765794883524
C
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
022915baa2aa0f7c026d22591ece0c914254b6b4
test/Parser/cxx-in-c.c
test/Parser/cxx-in-c.c
// RUN: %clang_cc1 -fsyntax-only -verify // PR9137 void f0(int x) : {}; void f1(int x) try {};
// RUN: %clang_cc1 -fsyntax-only -verify %s // PR9137 void f0(int x) : {}; // expected-error{{expected function body after function declarator}} void f1(int x) try {}; // expected-error{{expected function body after function declarator}}
Fix test for previous commit
Fix test for previous commit git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@124861 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-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,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
d3b29d4bbec8837a655dde42f2b0cdb852b2626d
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, weak) 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> @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
Change weak reference to assign for backwards compatibility
Change weak reference to assign for backwards compatibility
C
bsd-3-clause
appcom-interactive/MFSideMenu,Magnat12/MFSideMenu,mikefrederick/MFSideMenu,andrespch/MFSideMenu,AxialExchange/MFSideMenu,eleostech/MFSideMenu
cfa529182fda9e64aaf4621800ec7e8724892737
test/CFrontend/2006-07-31-PR854.c
test/CFrontend/2006-07-31-PR854.c
// RUN: llvm-gcc %s -S -o - // PR854 struct kernel_symbol { unsigned long value; }; unsigned long loops_per_jiffy = (1<<12); static const char __kstrtab_loops_per_jiffy[] __attribute__((section("__ksymtab_strings"))) = "loops_per_jiffy"; static const struct kernel_symbol __ksymtab_loops_per_jiffy __attribute__((__used__)) __attribute__((section("__ksymtab"))) = { (unsigned long)&loops_per_jiffy, __kstrtab_loops_per_jiffy };
// RUN: %llvmgcc% %s -S -o - // PR854 struct kernel_symbol { unsigned long value; }; unsigned long loops_per_jiffy = (1<<12); static const char __kstrtab_loops_per_jiffy[] __attribute__((section("__ksymtab_strings"))) = "loops_per_jiffy"; static const struct kernel_symbol __ksymtab_loops_per_jiffy __attribute__((__used__)) __attribute__((section("__ksymtab"))) = { (unsigned long)&loops_per_jiffy, __kstrtab_loops_per_jiffy };
Use the %llvm-gcc% variable to find llvm-gcc for those of us that don't have it in our path and to ensure it uses the configured llvm-gcc not just any one randomly placed in the path.
Use the %llvm-gcc% variable to find llvm-gcc for those of us that don't have it in our path and to ensure it uses the configured llvm-gcc not just any one randomly placed in the path. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@29522 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm
d93fae659ca26558c62dd654e24293be024408af
test/Index/c-index-getCursor-pp.c
test/Index/c-index-getCursor-pp.c
#define OBSCURE(X) X #define DECORATION typedef int T; void OBSCURE(func)(int x) { OBSCURE(T) DECORATION value; } // RUN: c-index-test -cursor-at=%s:1:11 %s | FileCheck -check-prefix=CHECK-1 %s // CHECK-1: macro definition=OBSCURE // RUN: c-index-test -cursor-at=%s:2:14 %s | FileCheck -check-prefix=CHECK-2 %s // CHECK-2: macro definition=DECORATION // RUN: c-index-test -cursor-at=%s:5:7 %s | FileCheck -check-prefix=CHECK-3 %s // CHECK-3: macro instantiation=OBSCURE:1:9 // RUN: c-index-test -cursor-at=%s:6:6 %s | FileCheck -check-prefix=CHECK-4 %s // CHECK-4: macro instantiation=OBSCURE:1:9 // RUN: c-index-test -cursor-at=%s:6:19 %s | FileCheck -check-prefix=CHECK-5 %s // CHECK-5: macro instantiation=DECORATION:2:9
#define OBSCURE(X) X #define DECORATION typedef int T; void OBSCURE(func)(int x) { OBSCURE(T) DECORATION value; } #include "a.h" // RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s // CHECK-1: macro definition=OBSCURE // RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s // CHECK-2: macro definition=DECORATION // RUN: c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s // CHECK-3: macro instantiation=OBSCURE:1:9 // RUN: c-index-test -cursor-at=%s:6:6 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-4 %s // CHECK-4: macro instantiation=OBSCURE:1:9 // RUN: c-index-test -cursor-at=%s:6:19 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-5 %s // CHECK-5: macro instantiation=DECORATION:2:9 // RUN: c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s // CHECK-6: inclusion directive=a.h
Update clang_getCursor() test to check searches on include directives
Update clang_getCursor() test to check searches on include directives git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@117063 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
4e139df2bc57e16133860dac7612265bcef77032
subdoc/path.h
subdoc/path.h
#ifndef SUBDOC_PATH_H #define SUBDOC_PATH_H #include "subdoc-api.h" #include "jsonsl_header.h" #ifdef __cplusplus extern "C" { #endif #define COMPONENTS_ALLOC 32 typedef struct subdoc_PATH_st { struct jsonsl_jpr_st jpr_base; struct jsonsl_jpr_component_st components_s[COMPONENTS_ALLOC]; int has_negix; /* True if there is a negative array index in the path */ } subdoc_PATH; struct subdoc_PATH_st *subdoc_path_alloc(void); void subdoc_path_free(struct subdoc_PATH_st*); void subdoc_path_clear(struct subdoc_PATH_st*); int subdoc_path_parse(struct subdoc_PATH_st *nj, const char *path, size_t len); jsonsl_error_t subdoc_path_add_arrindex(subdoc_PATH *pth, size_t ixnum); #define subdoc_path_pop_component(pth) do { \ (pth)->jpr_base.ncomponents--; \ } while (0); #ifdef __cplusplus } #endif #endif
#ifndef SUBDOC_PATH_H #define SUBDOC_PATH_H #include "subdoc-api.h" #include "jsonsl_header.h" #ifdef __cplusplus extern "C" { #endif // Maximum number of components in a path. Set to 33 to allow 32 'actual' // components plus the implicit root element. #define COMPONENTS_ALLOC 33 typedef struct subdoc_PATH_st { struct jsonsl_jpr_st jpr_base; struct jsonsl_jpr_component_st components_s[COMPONENTS_ALLOC]; int has_negix; /* True if there is a negative array index in the path */ } subdoc_PATH; struct subdoc_PATH_st *subdoc_path_alloc(void); void subdoc_path_free(struct subdoc_PATH_st*); void subdoc_path_clear(struct subdoc_PATH_st*); int subdoc_path_parse(struct subdoc_PATH_st *nj, const char *path, size_t len); jsonsl_error_t subdoc_path_add_arrindex(subdoc_PATH *pth, size_t ixnum); #define subdoc_path_pop_component(pth) do { \ (pth)->jpr_base.ncomponents--; \ } while (0); #ifdef __cplusplus } #endif #endif
Allow access to documents of depth 32
Allow access to documents of depth 32
C
apache-2.0
mnunberg/subjson,mnunberg/subjson
8650caef5b7e0729e2edabe780dfcdea6d6648d7
include/bitops.h
include/bitops.h
#ifndef __BITOPS_H__ #define __BITOPS_H__ #include <asm/bitops.h> #include <types.h> static inline int fls(int x) { return WORD_BITS - __clz(x); } static inline int ffs(int x) { /* mask the least significant bit only */ return fls(x & -x); } static inline int log2(int x) { if (!x) return INF; int sign = 1; if (x < 0) { sign = -sign; x = -x; } return (fls(x) - 1) * sign; } #endif /* __BITOPS_H__ */
#ifndef __BITOPS_H__ #define __BITOPS_H__ #include <asm/bitops.h> #include <types.h> static inline int fls(int x) { return WORD_BITS - __clz(x); } static inline int ffs(int x) { /* mask the least significant bit only */ return fls(x & -x); } static inline int digits(const unsigned int n) { assert(sizeof(n) == 4); const int tbl[] = { 10, 10, 9, 9, 9, 8, 8, 8, 7, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0 }; const unsigned int base[] = { 0, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 }; int digits = tbl[__clz(n)]; if (base[digits] <= n) digits++; return digits; } static inline int log2(int x) { if (!x) return INF; int sign = 1; if (x < 0) { sign = -sign; x = -x; } return (fls(x) - 1) * sign; } #endif /* __BITOPS_H__ */
Add digits() to count digits of `unsigned int` value
Add digits() to count digits of `unsigned int` value
C
apache-2.0
onkwon/yaos,onkwon/yaos,onkwon/yaos
507c61e2567c01f86e8bea87a37b173318779fb4
libexec/lukemftpd/nbsd2fbsd.h
libexec/lukemftpd/nbsd2fbsd.h
/* $FreeBSD$ */ /* XXX: Depend on our system headers protecting against multiple includes. */ #include <paths.h> #undef _PATH_FTPUSERS #include <pwd.h> #define _DIAGASSERT(x) #include <sys/_types.h> #ifndef _SIZE_T_DECLARED typedef __size_t size_t; #define _SIZE_T_DECLARED #endif long long strsuftollx(const char *, const char *, long long, long long, char *, size_t);
/* $FreeBSD$ */ /* XXX: Depend on our system headers protecting against multiple includes. */ #include <paths.h> #undef _PATH_FTPUSERS #include <pwd.h> #define _DIAGASSERT(x) #include <sys/_types.h> #ifndef _SIZE_T_DECLARED typedef __size_t size_t; #define _SIZE_T_DECLARED #endif long long strsuftollx(const char *, const char *, long long, long long, char *, size_t); /* * IEEE Std 1003.1c-95, adopted in X/Open CAE Specification Issue 5 Version 2 */ #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 #define LOGIN_NAME_MAX MAXLOGNAME /* max login name length (incl. NUL) */ #endif
Deal with the LOGIN_NAME_MAX issue in the NetBSD->FreeBSD translation^H^H^Hhack layer.
Deal with the LOGIN_NAME_MAX issue in the NetBSD->FreeBSD translation^H^H^Hhack layer.
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
80e4e2a943d9a156ed2a674a76a1da42b891dd57
Josh_Zane_Sebastian/src/main.h
Josh_Zane_Sebastian/src/main.h
#define T_INT 0 #define T_CHR 1 #define T_RTN 2 struct stack_node { struct stack_node *cdr; union node_data data; char type; } union node_data { struct routine routine; int numval; } struct routine { struct routine *parent; struct iq_node *nodes; int num_nodes; } struct iq_node { struct iq_node *next; union node_data instr; char type; }
#define T_INT 0 #define T_CHR 1 #define T_RTN 2 struct stack_node { struct stack_node *cdr; union node_data data; char type; } union node_data { struct routine routine; int numval; } struct routine { struct routine *parent; struct iq_node *nodes; } struct iq_node { struct iq_node *next; union node_data instr; char type; }
Remove unused node-counter in routines
Remove unused node-counter in routines
C
mit
aacoppa/final,aacoppa/final
36bf68a93c844399befddd3830407561a4d18810
Pod/Classes/SEEngineProtocol.h
Pod/Classes/SEEngineProtocol.h
// // SEEngineProtocol.h // Pods // // Created by Danil Tulin on 3/14/16. // // #import <Foundation/Foundation.h> @protocol EngineProtocol <NSObject> - (void)feedBGRAImageData:(u_int8_t *)data width:(NSUInteger)width heieght:(NSUInteger)height; @property (nonatomic) CGFloat progress; @end
// // SEEngineProtocol.h // Pods // // Created by Danil Tulin on 3/14/16. // // #import <Foundation/Foundation.h> @protocol EngineProtocol <NSObject> @required - (void)feedBGRAImageData:(u_int8_t *)data width:(NSUInteger)width heieght:(NSUInteger)height; @property (nonatomic) float progress; @end
Add required and CGFloat -> float
Add required and CGFloat -> float
C
mit
tulindanil/SEUIKit
4a1681141d6a415ffbcad7dd5b672b01dd75d429
search/config.h
search/config.h
/* for MAX_TXT_SEG_BYTES & MAX_TXT_SEG_LEN */ #include "txt-seg/config.h" #define MAX_TERM_BYTES MAX_TXT_SEG_BYTES /* consider both math & term */ #define MAX_QUERY_BYTES (MAX_TXT_SEG_BYTES * 32) #define MAX_QUERY_WSTR_LEN (MAX_TXT_SEG_LEN * 32) #define MAX_MERGE_POSTINGS 4096 #define SNIPPET_PADDING 80 #define MAX_SNIPPET_SZ 4096 //#define DEBUG_SNIPPET //#define DEBUG_POST_MERGE /* max mark score, type of mnc_score_t */ #define MNC_MARK_SCORE 99 /* #define MNC_DEBUG #define MNC_SMALL_BITMAP */ //#define DEBUG_MATH_EXPR_SEARCH #define RANK_SET_DEFAULT_VOL 45 #define DEFAULT_RES_PER_PAGE 10 //#define DEBUG_PROXIMITY #define ENABLE_PROXIMITY_SCORE #define MAX_HIGHLIGHT_OCCURS 8 //#define DEBUG_HILIGHT_SEG_OFFSET //#define DEBUG_HILIGHT_SEG //#define DEBUG_MATH_SCORE_POSTING //#define VERBOSE_SEARCH //#define DEBUG_MATH_SEARCH //#define DEBUG_PRINT_TARGET_DOC_MATH_SCORE
/* for MAX_TXT_SEG_BYTES & MAX_TXT_SEG_LEN */ #include "txt-seg/config.h" #define MAX_TERM_BYTES MAX_TXT_SEG_BYTES /* consider both math & term */ #define MAX_QUERY_BYTES (MAX_TXT_SEG_BYTES * 32) #define MAX_QUERY_WSTR_LEN (MAX_TXT_SEG_LEN * 32) #define MAX_MERGE_POSTINGS 4096 #define SNIPPET_PADDING 320 #define MAX_SNIPPET_SZ 8192 //#define DEBUG_SNIPPET //#define DEBUG_POST_MERGE /* max mark score, type of mnc_score_t */ #define MNC_MARK_SCORE 99 /* #define MNC_DEBUG #define MNC_SMALL_BITMAP */ //#define DEBUG_MATH_EXPR_SEARCH #define RANK_SET_DEFAULT_VOL 155 #define DEFAULT_RES_PER_PAGE 10 //#define DEBUG_PROXIMITY #define ENABLE_PROXIMITY_SCORE #define MAX_HIGHLIGHT_OCCURS 8 //#define DEBUG_HILIGHT_SEG_OFFSET //#define DEBUG_HILIGHT_SEG //#define DEBUG_MATH_SCORE_POSTING //#define VERBOSE_SEARCH //#define DEBUG_MATH_SEARCH //#define DEBUG_PRINT_TARGET_DOC_MATH_SCORE
Enlarge snippet size and rank volumn.
Enlarge snippet size and rank volumn.
C
mit
approach0/search-engine,approach0/search-engine,yzhan018/the-day-after-tomorrow,yzhan018/the-day-after-tomorrow,t-k-/the-day-after-tomorrow,yzhan018/the-day-after-tomorrow,yzhan018/the-day-after-tomorrow,yzhan018/the-day-after-tomorrow,t-k-/the-day-after-tomorrow,t-k-/the-day-after-tomorrow,yzhan018/the-day-after-tomorrow,yzhan018/the-day-after-tomorrow,approach0/search-engine,t-k-/the-day-after-tomorrow,approach0/search-engine,t-k-/the-day-after-tomorrow,t-k-/the-day-after-tomorrow,t-k-/the-day-after-tomorrow
d03603a903096eebfab0972a78e5038c41c75534
framework/JPetUser/JPetUser.h
framework/JPetUser/JPetUser.h
// JPet User - JPetUser.h #ifndef JPET_USER_H #define JPET_USER_H #include "TNamed.h" class JPetUser: public TNamed { protected: int m_id; std::string m_name; std::string m_lastName; std::string m_login; std::string m_password; bool m_isRoot; std::string m_creationDate; std::string m_lastLoginDate; static bool m_isUserLogged; inline void toggleUserLoggedStatus() { m_isUserLogged = (m_isUserLogged == true) ? false : true; } virtual std::string password(void) const; public: JPetUser(int p_id, std::string p_name, std::string p_lastName, std::string p_login, std::string p_password, bool p_isRoot); virtual ~JPetUser(void); static bool isUserLogged(void); virtual bool logIn(void); virtual bool logOut(void); virtual bool changeLogin(void); virtual bool changePassword(void); virtual int id(void) const; virtual std::string name(void) const; virtual std::string lastName(void) const; virtual std::string login(void) const; virtual bool isRoot(void) const; virtual std::string creationDate(void) const; virtual std::string lastLoginDate(void) const; private: ClassDef(JPetUser, 1); }; #endif // JPET_USER_H
// JPet User - JPetUser.h #ifndef JPET_USER_H #define JPET_USER_H #include "TNamed.h" class JPetUser: public TNamed { protected: int m_id; std::string m_name; std::string m_lastName; std::string m_login; std::string m_password; bool m_isRoot; std::string m_creationDate; std::string m_lastLoginDate; static bool m_isUserLogged; inline void toggleUserLoggedStatus() { m_isUserLogged = !m_isUserLogged; } virtual std::string password(void) const; public: JPetUser(int p_id, std::string p_name, std::string p_lastName, std::string p_login, std::string p_password, bool p_isRoot); virtual ~JPetUser(void); static bool isUserLogged(void); virtual bool logIn(void); virtual bool logOut(void); virtual bool changeLogin(void); virtual bool changePassword(void); virtual int id(void) const; virtual std::string name(void) const; virtual std::string lastName(void) const; virtual std::string login(void) const; virtual bool isRoot(void) const; virtual std::string creationDate(void) const; virtual std::string lastLoginDate(void) const; private: ClassDef(JPetUser, 1); }; #endif // JPET_USER_H
Change body of the toggleUserLoggedStatus method.
Change body of the toggleUserLoggedStatus method.
C
apache-2.0
kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework,kmuzalewska/j-pet-framework
a58465ff0f6acb358e7ce91e076803f53ab340da
chapter2/myspace.c
chapter2/myspace.c
#include <cs50.h> #include <ctype.h> #include <stdio.h> #include <string.h> // declare main so that it takes input from command line int main(int argc, string argv[]) { for (int i = 1; i < argc; i++) { for (int j = 0, k = strlen(argv[i]); j < k; j++) { if (j % 2 == 0) { printf("%c", toupper(argv[i][j])); } else { printf("%c", tolower(argv[i][j])); } printf(" "); } printf(" "); } printf("\n"); }
Add additional string iteration program example
Add additional string iteration program example
C
mit
cs50sacramento/source-code-1617,cs50sacramento/source-code-1617,cs50sacramento/source-code-1617
e141aba93148a0e2b5bbcbde36b37d3cf171d1f2
chapter27/chapter27_drill.c
chapter27/chapter27_drill.c
/* Chapter 27, drill 1. Write a Hello World program 2. Define two variables holding "Hello" and "World!", concatenate them with a space in between and output them as "Hello World!" 3. Define a function taking a char* p and an int x, print their values in the format "p is 'foo' and x is 7". Call it with a few argument pairs. */ #include<stdlib.h> #include<string.h> #include<stdio.h> void my_func(char* p, int x) { printf("p is \"%s\" and x is %i\n",p,x); } int main() { printf("Hello World!\n"); char* hello = "Hello"; char* world = "World!"; char* hello_world = (char*) malloc(strlen(hello)+strlen(world)+2); strcpy(hello_world,hello); hello_world[strlen(hello)] = ' '; strcpy(hello_world+strlen(hello)+1,world); printf("%s\n",hello_world); my_func("foo",7); my_func("Scott Meyers",42); my_func("Bjarne Stroustrup",99); }
/* Chapter 27, drill 1. Write a Hello World program 2. Define two variables holding "Hello" and "World!", concatenate them with a space in between and output them as "Hello World!" 3. Define a function taking a char* p and an int x, print their values in the format "p is 'foo' and x is 7". Call it with a few argument pairs. */ #include<stdlib.h> #include<string.h> #include<stdio.h> void my_func(char* p, int x) { printf("p is \"%s\" and x is %i\n",p,x); } int main() { printf("Hello World!\n"); { char* hello = "Hello"; char* world = "World!"; char* hello_world = (char*) malloc(strlen(hello)+strlen(world)+2); strcpy(hello_world,hello); hello_world[strlen(hello)] = ' '; strcpy(hello_world+strlen(hello)+1,world); printf("%s\n",hello_world); } my_func("foo",7); my_func("Scott Meyers",42); my_func("Bjarne Stroustrup",99); }
Modify Chapter 27, drill to comply with C89 standard
Modify Chapter 27, drill to comply with C89 standard
C
mit
bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp
5d1c50d7b497f623c65e24f2d02c5f867f74afcc
restnotifier/idletime.c
restnotifier/idletime.c
#include <QtGlobal> #if defined Q_WS_X11 #include <X11/extensions/scrnsaver.h> #endif // return idle time in seconds int getIdleSecs() { #if defined Q_WS_X11 int code, idle_sec; XScreenSaverInfo *ssinfo = XScreenSaverAllocInfo(); if (!ssinfo) goto fail; Display *display = XOpenDisplay(0); if (!display) goto fail; code = XScreenSaverQueryInfo(display, DefaultRootWindow(display), ssinfo); if (!code) goto fail; idle_sec = ssinfo->idle / 1000; XFree(ssinfo); XCloseDisplay(display); return idle_sec; fail: if (ssinfo) XFree(ssinfo); if (display) XCloseDisplay(display); return -1; #else return -1; #endif }
#include <QtGlobal> // headers #if defined Q_WS_X11 #include <X11/extensions/scrnsaver.h> #elif defined Q_WS_WIN #include <windows.h> #endif // ^ headers // return idle time in seconds int getIdleSecs() { // linux #if defined Q_WS_X11 int code, idle_sec; XScreenSaverInfo *ssinfo = XScreenSaverAllocInfo(); if (!ssinfo) goto fail; Display *display = XOpenDisplay(0); if (!display) goto fail; code = XScreenSaverQueryInfo(display, DefaultRootWindow(display), ssinfo); if (!code) goto fail; idle_sec = ssinfo->idle / 1000; XFree(ssinfo); XCloseDisplay(display); return idle_sec; fail: if (ssinfo) XFree(ssinfo); if (display) XCloseDisplay(display); return -1; // ^ linux // windows #elif defined Q_WS_WIN BOOL ok; LASTINPUTINFO plii; DWORD msec; plii.cbSize = sizeof(LASTINPUTINFO); plii.dwTime = 0; ok = GetLastInputInfo(&plii); if (!ok) return -1; msec = GetTickCount(); msec -= plii.dwTime; msec /= 1000; return msec; // ^ windows #else return -1; #endif }
Add idle time function for windows
Add idle time function for windows
C
mit
swarmer/restnotifier,swarmer/restnotifier,swarmer/restnotifier
8a601496ec30617c6df42f31f4221b8cb1b2f866
tests/sv-comp/cfg/uncil/and_join_invariant_true-unreach-call.c
tests/sv-comp/cfg/uncil/and_join_invariant_true-unreach-call.c
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: __VERIFIER_error(); } return; } int main() { int x = __VERIFIER_nondet_int(); if (x > 0 && x < 2) __VERIFIER_assert(x == 1); else __VERIFIER_assert(1); // arbitrary node in else branch to see invariant return 0; }
Add test about witness un-CIL invariant being incorrect when branches joined
Add test about witness un-CIL invariant being incorrect when branches joined
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
dc811801dc3917f525058e06e89484704cc4b98c
installer/loader.h
installer/loader.h
#ifndef LOADER_H #define LOADER_H #include "../../../libwiiu/src/coreinit.h" #include "../../../libwiiu/src/socket.h" #include "../../../libwiiu/src/types.h" void _start(); void _entryPoint(); /* Arbitrary kernel write syscall */ void kern_write(void *addr, uint32_t value); #endif /* LOADER_H */
#ifndef LOADER_H #define LOADER_H #include "../../../libwiiu/src/coreinit.h" #include "../../../libwiiu/src/socket.h" #include "../../../libwiiu/src/types.h" /* Kernel address table */ #if VER == 200 #define KERN_ADDRESS_TBL 0x0 #elif VER == 210 #define KERN_ADDRESS_TBL 0x0 #elif VER == 300 #define KERN_ADDRESS_TBL 0xFFEB66E4 #elif VER == 310 #define KERN_ADDRESS_TBL 0x0 #elif VER == 400 #define KERN_ADDRESS_TBL 0x0 #elif VER == 410 #define KERN_ADDRESS_TBL 0xffeb902c #elif VER == 500 #define KERN_ADDRESS_TBL 0xffea9e4c #elif VER == 532 #define KERN_ADDRESS_TBL 0xFFEAAA10 #else #error "Unsupported Wii U software version" #endif void _start(); void _entryPoint(); /* Arbitrary kernel write syscall */ void kern_write(void *addr, uint32_t value); #endif /* LOADER_H */
Add KERN_ADDRESS_TBL for each version
Add KERN_ADDRESS_TBL for each version
C
mit
wiiudev/pyGecko,cfwprpht/pyGecko,FIX94/pyGecko,FIX94/pyGecko,shinyquagsire23/pyGecko,cfwprpht/pyGecko,wiiudev/pyGecko,shinyquagsire23/pyGecko
2b3e2bb2d4c5fb0185a42b50354278fea97aa817
src/include/s6-rc/s6rc-constants.h
src/include/s6-rc/s6rc-constants.h
/* ISC license. */ #ifndef S6RC_CONSTANTS_H #define S6RC_CONSTANTS_H #define S6RC_COMPILED_BASE "/etc/s6-rc/compiled" #define S6RC_LIVE_BASE "/s6/s6-rc" #define S6RC_COMPILED_DIR_LEN 32 #define S6RC_ONESHOT_RUNNER "s6rc-oneshot-runner" #define S6RC_ONESHOT_RUNNER_LEN (sizeof S6RC_ONESHOT_RUNNER - 1) #endif
/* ISC license. */ #ifndef S6RC_CONSTANTS_H #define S6RC_CONSTANTS_H #define S6RC_COMPILED_BASE "/etc/s6-rc/compiled" #define S6RC_LIVE_BASE "/run/s6-rc" #define S6RC_COMPILED_DIR_LEN 32 #define S6RC_ONESHOT_RUNNER "s6rc-oneshot-runner" #define S6RC_ONESHOT_RUNNER_LEN (sizeof S6RC_ONESHOT_RUNNER - 1) #endif
Change default live to /run/s6-rc
Change default live to /run/s6-rc
C
isc
skarnet/s6-rc,skarnet/s6-rc
a689b6dd0ccf5734c9c22058cb20c5a18f8fc795
sapi/sapi-dylink.h
sapi/sapi-dylink.h
/// @file sapi-dylink.h /// @brief Define the record used for runtime linking. /// This structure allows forth to easily look up things on the C /// side of the world. /// /// Special Rules: /// - The very first item is the size of the record. /// // This could be packed more tightly, but its now exactly // 16 bytes per record, which is nice. Make sure that doesn't // change. typedef struct { // This union is a bit crazy, but its the simplest way of // getting the compiler to shut up. union { void (*fp) (void); int* ip; unsigned int ui; unsigned int* uip; unsigned long* ulp; } p; ///< Pointer to the object of interest int16_t size; ///< Size in bytes int16_t count; ///< How many int8_t kind; ///< Is this a variable or a constant? int8_t strlen; ///< Length of the string char *name; ///< Null-Terminated C string. } runtimelink_t; /// Helper Macro. #define FORTHNAME(x) (sizeof(x)-1),x extern const runtimelink_t dynamiclinks[];
/// @file sapi-dylink.h /// @brief Define the record used for runtime linking. /// This structure allows forth to easily look up things on the C /// side of the world. /// /// Special Rules: /// - The very first item is the size of the record. /// // This could be packed more tightly, but its now exactly // 16 bytes per record, which is nice. Make sure that doesn't // change. // Conventions: // Size is the size of the fundamental thing in bytes, // and count is the number of them. // char array[64] = 1,64 // struct { a, b } s; sizeof(s),1 typedef struct { // This union is a bit crazy, but its the simplest way of // getting the compiler to shut up. union { void (*fp) (void); int* ip; unsigned int ui; unsigned int* uip; unsigned long* ulp; } p; ///< Pointer to the object of interest int16_t size; ///< Size in bytes int16_t count; ///< How many int8_t kind; ///< Is this a variable or a constant? int8_t strlen; ///< Length of the string char *name; ///< Null-Terminated C string. } runtimelink_t; /// Helper Macro. #define FORTHNAME(x) (sizeof(x)-1),x extern const runtimelink_t dynamiclinks[];
Clarify the dynamic linking structure.
Clarify the dynamic linking structure.
C
bsd-2-clause
rbsexton/sockpuppet,rbsexton/sockpuppet
74dab7fd5a5e1ddc73ffb56bfaeaeaae43ce609c
Common/Categories/UITableView+DynamicSizing.h
Common/Categories/UITableView+DynamicSizing.h
#import <UIKit/UIKit.h> @protocol UITableViewDataSourceDynamicSizing; @interface UITableView (DynamicSizing) - (void)registerClass:(Class)cellClass forDynamicCellReuseIdentifier:(NSString *)identifier; - (void)registerNib:(UINib *)nib forDynamicCellReuseIdentifier:(NSString *)identifier; - (CGFloat)minimumHeightForCellWithReuseIdentifier:(NSString*)reuseIdentifier atIndexPath:(NSIndexPath*)indexPath; @end @protocol UITableViewDataSourceDynamicSizing <UITableViewDataSource> - (void)tableView:(UITableView*)tableView configureCell:(UITableViewCell*)cell forRowAtIndexPath:(NSIndexPath*)indexPath; @end
#import <UIKit/UIKit.h> @protocol UITableViewDataSourceDynamicSizing; @interface UITableView (DynamicSizing) - (void)registerClass:(Class)cellClass forDynamicCellReuseIdentifier:(NSString *)identifier; - (void)registerNib:(UINib *)nib forDynamicCellReuseIdentifier:(NSString *)identifier; - (CGFloat)minimumHeightForCellWithReuseIdentifier:(NSString*)reuseIdentifier atIndexPath:(NSIndexPath*)indexPath; @end @protocol UITableViewDataSourceDynamicSizing <UITableViewDataSource> @required - (void)tableView:(UITableView*)tableView configureCell:(UITableViewCell*)cell forRowAtIndexPath:(NSIndexPath*)indexPath; @end
Make sure to mark all the methods in the dynamic sizing data source as required
Make sure to mark all the methods in the dynamic sizing data source as required
C
lgpl-2.1
xNUTs/MIT-Mobile-for-iOS,xNUTs/MIT-Mobile-for-iOS,smartcop/MIT-Mobile-for-iOS,MIT-Mobile/MIT-Mobile-for-iOS,smartcop/MIT-Mobile-for-iOS,MIT-Mobile/MIT-Mobile-for-iOS
0aec39c69e2f002dd5020272f30bf1f488ce4815
src/condor_ckpt/machdep.old.h
src/condor_ckpt/machdep.old.h
#include <setjmp.h> /* Portability: A single method works on all the platforms we have tried so far, but this may not be true for all platforms. */ #if defined(ULTRIX42) || defined(ULTRIX43) || defined(SUNOS41) # define SETJMP _setjmp # define LONGJMP _longjmp extern "C" { int SETJMP( jmp_buf env ); void LONGJMP( jmp_buf env, int retval ); } #else // Unknown platforms fall through to here, generating compile time error # error #endif int data_start_addr(); int data_end_addr(); int stack_start_addr(); int stack_end_addr(); void ExecuteOnTmpStk( void (*func)() );
#include <setjmp.h> #include <sys/param.h> #include <sys/vmparam.h> /* Portability: A single method works on all the platforms we have tried so far, but this may not be true for all platforms. */ #if defined(ULTRIX42) || defined(ULTRIX43) || defined(SUNOS41) # define SETJMP _setjmp # define LONGJMP _longjmp extern "C" { int SETJMP( jmp_buf env ); void LONGJMP( jmp_buf env, int retval ); } #else // Unknown platforms fall through to here, generating compile time error # error #endif int data_start_addr(); int data_end_addr(); int stack_start_addr(); int stack_end_addr(); void ExecuteOnTmpStk( void (*func)() );
Include both <sys/param.h> and <sys/vmparam.h> since both SUNOS and ULTRIX will need them.
Include both <sys/param.h> and <sys/vmparam.h> since both SUNOS and ULTRIX will need them.
C
apache-2.0
htcondor/htcondor,clalancette/condor-dcloud,htcondor/htcondor,djw8605/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,djw8605/condor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/condor,neurodebian/htcondor,htcondor/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,djw8605/condor,clalancette/condor-dcloud,htcondor/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,djw8605/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/condor,mambelli/osg-bosco-marco,djw8605/condor,zhangzhehust/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/condor,djw8605/condor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,zhangzhehust/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor
b41a7d20027f4730f34885ebbca539d9fdb78c9c
test/CodeGen/address-space.c
test/CodeGen/address-space.c
// RUN: clang -emit-llvm < %s 2>&1 | grep 'addrspace(1)' | count 5 int foo __attribute__((address_space(1))); int ban[10] __attribute__((address_space(1))); int bar() { return foo; } int baz(int i) { return ban[i]; }
// RUN: clang -emit-llvm < %s 2>&1 | grep 'addrspace(1)' | count 5 int foo __attribute__((address_space(1))); int ban[10] __attribute__((address_space(1))); int bar() { return foo; } int baz(int i) { return ban[i]; }
Add ending newline to test.
Add ending newline to test. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@46692 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
cbbe9c8b5c645affee7aadc2d6aebb989de81989
src/libmv/base/id_generator.h
src/libmv/base/id_generator.h
// Copyright (c) 2007, 2008 libmv authors. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. #ifndef LIBMV_ID_GENERATOR_H #define LIBMV_ID_GENERATOR_H namespace libmv { class IdGenerator { public: IdGenerator() : next_(0) {} uint Generate() { return next_++; } private: uint next_; }; } // namespace libmv #endif // LIBMV_ID_GENERATOR_H
Add another missing file :(
Add another missing file :(
C
mit
SoylentGraham/libmv,rgkoo/libmv-blender,keir/libmv,rgkoo/libmv-blender,Nazg-Gul/libmv,petertsoi/libmv,petertsoi/libmv,keir/libmv,libmv/libmv,libmv/libmv,petertsoi/libmv,libmv/libmv,rgkoo/libmv-blender,Nazg-Gul/libmv,SoylentGraham/libmv,Nazg-Gul/libmv,petertsoi/libmv,Nazg-Gul/libmv,rgkoo/libmv-blender,Nazg-Gul/libmv,rgkoo/libmv-blender,keir/libmv,SoylentGraham/libmv,keir/libmv,libmv/libmv,SoylentGraham/libmv
25110f8d507c8432ac6849e2682a40983f752d8e
config.def.h
config.def.h
#ifdef HAVE_FORK #define HAVE_FORK 1 #endif #if HAVE_FORK # if TARGET_OS_IPHONE || APPLE_SDK_IPHONEOS # define HAVE_SYSTEM 0 # else # define HAVE_SYSTEM 1 # endif #else # define HAVE_SYSTEM 0 #endif #if HAVE_SYSTEM #include "p/sh.h" #endif #include "p/spp.h" #include "p/acr.h" #include "p/pod.h" #include "p/cpp.h" struct Proc *procs[] = { &spp_proc, &cpp_proc, &pod_proc, &acr_proc, #if HAVE_SYSTEM &sh_proc, #endif NULL }; DEFAULT_PROC(spp) #define DEBUG 0
#ifdef HAVE_FORK #define HAVE_FORK 1 #endif #if HAVE_FORK # if TARGET_OS_IPHONE || APPLE_SDK_IPHONEOS || APPLE_SDK_IPHONESIMULATOR # define HAVE_SYSTEM 0 # else # define HAVE_SYSTEM 1 # endif #else # define HAVE_SYSTEM 0 #endif #if HAVE_SYSTEM #include "p/sh.h" #endif #include "p/spp.h" #include "p/acr.h" #include "p/pod.h" #include "p/cpp.h" struct Proc *procs[] = { &spp_proc, &cpp_proc, &pod_proc, &acr_proc, #if HAVE_SYSTEM &sh_proc, #endif NULL }; DEFAULT_PROC(spp) #define DEBUG 0
Fix build for the iPhone Simulator
Fix build for the iPhone Simulator
C
mit
radare/spp,radare/spp,radare/spp,radare/spp
7c3bd324629ef4acd69b8c9eed9379c872283916
include/matrix_constructors_impl.h
include/matrix_constructors_impl.h
//----------------------------------------------------------------------------- // Constructors //----------------------------------------------------------------------------- template<class T> matrix<T>::matrix():data_(),rows_(0),cols_(0){} template<class T> matrix<T>::matrix( std::size_t rows, std::size_t cols ): data_(rows*cols),rows_(rows),cols_(cols){} template<class T> matrix<T>::matrix( std::initializer_list<std::initializer_list<T>> init_list): data_( init_list.size() * init_list.begin()->size() ), rows_(init_list.size()),cols_( init_list.begin()->size() ){ // TODO: copy values } /* template<class T> matrix<T>::matrix( const matrix& ); template<class T> matrix<T>::matrix( matrix&& ); */
//----------------------------------------------------------------------------- // Constructors //----------------------------------------------------------------------------- template<class T> matrix<T>::matrix():data_(),rows_(0),cols_(0){} template<class T> matrix<T>::matrix( std::size_t rows, std::size_t cols ): data_(rows*cols),rows_(rows),cols_(cols){} template<class T> matrix<T>::matrix( std::initializer_list<std::initializer_list<T>> init_list): data_( init_list.size() * init_list.begin()->size() ), rows_(init_list.size()),cols_( init_list.begin()->size() ){ // TODO: copy values // Or create concat function for init_list and use it to initialize // data_ vector. } /* template<class T> matrix<T>::matrix( const matrix& ); template<class T> matrix<T>::matrix( matrix&& ); */
Add comment about init_list constructor.
Add comment about init_list constructor.
C
mit
actinium/cppMatrix,actinium/cppMatrix
e17247a4550b9c9b3394ea378b61ecea17a75da3
Linkedlists/02.c
Linkedlists/02.c
#include <stdio.h> #include <stdlib.h> typedef struct n { int data; struct n * next; } node; /* Print Linked list values */ void showList(node * list){ int i = 1; while( list != NULL){ printf("#%d. node, data: %d at pointed: %p, and points to %p\n", i, list->data, list, list->next); list = list->next; i++; } } int main(){ node * root; /* First Node Allocation */ root = (node *) malloc(sizeof(node)); root->data = 0; root->next = NULL; /* Create another 9 nodes in the list. */ node * iter = root; for(int i = 1; i < 10; i++){ iter->next = (node *) malloc(sizeof(node)); iter = iter->next; iter->data = i*10; iter->next = NULL; } showList(root); return 0; } /* -- Resulted as -- #1. node, data: 0 at pointed: 00541738, and points to 00541768 #2. node, data: 10 at pointed: 00541768, and points to 00541778 #3. node, data: 20 at pointed: 00541778, and points to 00541788 #4. node, data: 30 at pointed: 00541788, and points to 00541798 #5. node, data: 40 at pointed: 00541798, and points to 005417A8 #6. node, data: 50 at pointed: 005417A8, and points to 005417B8 #7. node, data: 60 at pointed: 005417B8, and points to 005417C8 #8. node, data: 70 at pointed: 005417C8, and points to 005417D8 #9. node, data: 80 at pointed: 005417D8, and points to 005417E8 #10. node, data: 90 at pointed: 005417E8, and points to 00000000 */
Add another nodes by for loop way.
Add another nodes by for loop way.
C
mit
enverarslan/DataStructures
d1bc8e95445224276d7896b8b08cbb0b28a0ca80
include/linux/err.h
include/linux/err.h
#ifndef _LINUX_ERR_H #define _LINUX_ERR_H #include <linux/compiler.h> #include <asm/errno.h> /* * Kernel pointers have redundant information, so we can use a * scheme where we can return either an error code or a dentry * pointer with the same return value. * * This should be a per-architecture thing, to allow different * error and pointer decisions. */ #define MAX_ERRNO 4095 #ifndef __ASSEMBLY__ #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) static inline void *ERR_PTR(long error) { return (void *) error; } static inline long PTR_ERR(const void *ptr) { return (long) ptr; } static inline long IS_ERR(const void *ptr) { return IS_ERR_VALUE((unsigned long)ptr); } #endif #endif /* _LINUX_ERR_H */
#ifndef _LINUX_ERR_H #define _LINUX_ERR_H #include <linux/compiler.h> #include <asm/errno.h> /* * Kernel pointers have redundant information, so we can use a * scheme where we can return either an error code or a dentry * pointer with the same return value. * * This should be a per-architecture thing, to allow different * error and pointer decisions. */ #define MAX_ERRNO 4095 #ifndef __ASSEMBLY__ #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) static inline void *ERR_PTR(long error) { return (void *) error; } static inline long PTR_ERR(const void *ptr) { return (long) ptr; } static inline long IS_ERR(const void *ptr) { return IS_ERR_VALUE((unsigned long)ptr); } /** * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type * @ptr: The pointer to cast. * * Explicitly cast an error-valued pointer to another pointer type in such a * way as to make it clear that's what's going on. */ static inline void *ERR_CAST(const void *ptr) { /* cast away the const */ return (void *) ptr; } #endif #endif /* _LINUX_ERR_H */
Add an ERR_CAST() function to complement ERR_PTR and co.
Add an ERR_CAST() function to complement ERR_PTR and co. Add an ERR_CAST() function to complement ERR_PTR and co. for the purposes of casting an error entyped as one pointer type to an error of another pointer type whilst making it explicit as to what is going on. This provides a replacement for the ERR_PTR(PTR_ERR(p)) construct. Signed-off-by: David Howells <ebac1d06c1688626821bb0e574a037a7a5354e49@redhat.com> Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org> Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>
C
apache-2.0
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,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas
ef63a5a9f90205a0d9067b3b27d44118fd195bdb
sift/recorder/threads.h
sift/recorder/threads.h
#ifndef __THREAD_INFO_H #define __THREAD_INFO_H #include "globals.h" #include "sift_writer.h" #include "bbv_count.h" #include "pin.H" #include <deque> typedef struct { Sift::Writer *output; ADDRINT dyn_addresses[Sift::MAX_DYNAMIC_ADDRESSES]; UINT32 num_dyn_addresses; Bbv *bbv; UINT64 thread_num; ADDRINT bbv_base; UINT64 bbv_count; ADDRINT bbv_last; BOOL bbv_end; UINT64 blocknum; UINT64 icount; UINT64 icount_cacheonly; UINT64 icount_cacheonly_pending; UINT64 icount_detailed; UINT64 icount_reported; ADDRINT last_syscall_number; ADDRINT last_syscall_returnval; UINT64 flowcontrol_target; ADDRINT tid_ptr; ADDRINT last_routine; ADDRINT last_call_site; BOOL last_syscall_emulated; BOOL running; } __attribute__((packed,aligned(LINE_SIZE_BYTES))) thread_data_t; extern thread_data_t *thread_data; void initThreads(); #endif // __THREAD_INFO_H
#ifndef __THREAD_INFO_H #define __THREAD_INFO_H #include "globals.h" #include "sift_writer.h" #include "bbv_count.h" #include "pin.H" #include <deque> typedef struct { Sift::Writer *output; UINT64 dyn_addresses[Sift::MAX_DYNAMIC_ADDRESSES]; UINT32 num_dyn_addresses; Bbv *bbv; UINT64 thread_num; ADDRINT bbv_base; UINT64 bbv_count; ADDRINT bbv_last; BOOL bbv_end; UINT64 blocknum; UINT64 icount; UINT64 icount_cacheonly; UINT64 icount_cacheonly_pending; UINT64 icount_detailed; UINT64 icount_reported; ADDRINT last_syscall_number; ADDRINT last_syscall_returnval; UINT64 flowcontrol_target; ADDRINT tid_ptr; ADDRINT last_routine; ADDRINT last_call_site; BOOL last_syscall_emulated; BOOL running; } __attribute__((packed,aligned(LINE_SIZE_BYTES))) thread_data_t; extern thread_data_t *thread_data; void initThreads(); #endif // __THREAD_INFO_H
Fix 32-bit compile by making the per-thread address data 64-bit
[recorder] Fix 32-bit compile by making the per-thread address data 64-bit
C
mit
abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper
b9d54ddf6698d75309f2ea4b0dbd8fb2b5f63517
common_video/interface/texture_video_frame.h
common_video/interface/texture_video_frame.h
/* * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef COMMON_VIDEO_INTERFACE_TEXTURE_VIDEO_FRAME_H #define COMMON_VIDEO_INTERFACE_TEXTURE_VIDEO_FRAME_H #include "webrtc/common_video/interface/i420_video_frame.h" // TODO(magjed): Remove this when all external dependencies are updated. namespace webrtc { typedef I420VideoFrame TextureVideoFrame; } // namespace webrtc #endif // COMMON_VIDEO_INTERFACE_TEXTURE_VIDEO_FRAME_H
Add intermediate TextureVideoFrame typedef for Chromium
Add intermediate TextureVideoFrame typedef for Chromium BUG=1128 R=perkj@webrtc.org TBR=stefan Review URL: https://webrtc-codereview.appspot.com/42239004 git-svn-id: 03ae4fbe531b1eefc9d815f31e49022782c42458@8630 4adac7df-926f-26a2-2b94-8c16560cd09d
C
bsd-3-clause
svn2github/webrtc-Revision-8758,svn2github/webrtc-Revision-8758,svn2github/webrtc-Revision-8758,svn2github/webrtc-Revision-8758,svn2github/webrtc-Revision-8758,svn2github/webrtc-Revision-8758
c5ae794fe0663a31138d5e248076a9dbd6bafa76
src/flsputils.c
src/flsputils.c
#include <math.h> #include <glib.h> #include <gtk/gtk.h> #include "fake-lock-screen-pattern.h" void flsp_draw_circle(cairo_t *context, gint x, gint y, gint radius, GdkRGBA circle, GdkRGBA border) { cairo_set_line_width(context, 9); cairo_set_source_rgb(context, border.red, border.green, border.blue); cairo_arc(context, x, y, radius, 0, 2 * M_PI); cairo_stroke_preserve(context); cairo_set_source_rgb(context, circle.red, circle.green, circle.blue); cairo_fill(context); }
Implement function to draw circle
Implement function to draw circle
C
mit
kenhys/fake-lock-screen-pattern,kenhys/fake-lock-screen-pattern
9af5280bb7f53ddff998b69ad6007349ffcfeb7c
src/lib/ioloop-notify-none.c
src/lib/ioloop-notify-none.c
/* Copyright (C) 2003 Timo Sirainen */ #include "lib.h" #include "ioloop-internal.h" #ifdef IOLOOP_NOTIFY_NONE struct io *io_loop_notify_add(struct ioloop *ioloop __attr_unused__, const char *path __attr_unused__, io_callback_t *callback __attr_unused__, void *context __attr_unused__) { return NULL; } void io_loop_notify_remove(struct ioloop *ioloop __attr_unused__, struct io *io __attr_unused__) { } void io_loop_notify_handler_init(struct ioloop *ioloop __attr_unused__) { } void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__) { } #endif
/* Copyright (C) 2003 Timo Sirainen */ #include "lib.h" #include "ioloop-internal.h" #ifdef IOLOOP_NOTIFY_NONE #undef io_add_notify struct io *io_add_notify(const char *path __attr_unused__, io_callback_t *callback __attr_unused__, void *context __attr_unused__) { return NULL; } void io_loop_notify_remove(struct ioloop *ioloop __attr_unused__, struct io *io __attr_unused__) { } void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__) { } #endif
Fix for building without notify
Fix for building without notify
C
mit
LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot
7197e7747848558933d7ee48da1d4ffd5ddc335b
libsel4muslccamkes/src/sys_yield.c
libsel4muslccamkes/src/sys_yield.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 <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <sel4/sel4.h> long sys_sched_yield(va_list ap) { seL4_Yield(); return 0; }
/* * 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 <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <sel4/sel4.h> long sys_sched_yield(va_list ap) { /* won't work */ return 0; }
Remove seL4_Yield() since it's removed from the RT kernel.
Remove seL4_Yield() since it's removed from the RT kernel. JIRA CAMKES-429
C
bsd-2-clause
smaccm/camkes-tool,smaccm/camkes-tool,smaccm/camkes-tool,smaccm/camkes-tool
4afc72fe4adaa08c52b1b5fcbd7ef76ff60404b2
Sift/SFDebug.h
Sift/SFDebug.h
// Copyright (c) 2016 Sift Science. All rights reserved. @import Foundation; /** Debug output that can be turned on/off by SF_DEBUG_ENABLE macro. */ #ifdef SF_DEBUG_ENABLE #define SF_DEBUG(FORMAT, ...) NSLog(@"%s:%d " FORMAT, __FUNCTION__, __LINE__, ## __VA_ARGS__) #else #define SF_DEBUG(...) #endif /** Log messages to console that are important to the SDK users. */ #ifdef DEBUG #define SF_IMPORTANT(FORMAT, ...) NSLog(@"%s:%d " FORMAT, __FUNCTION__, __LINE__, ## __VA_ARGS__) #endif
// Copyright (c) 2016 Sift Science. All rights reserved. @import Foundation; /** Debug output that can be turned on/off by SF_DEBUG_ENABLE macro. */ #ifdef SF_DEBUG_ENABLE #define SF_DEBUG(FORMAT, ...) NSLog(@"%s:%d " FORMAT, __FUNCTION__, __LINE__, ## __VA_ARGS__) #else #define SF_DEBUG(...) #endif /** Log messages to console that are important to the SDK users. */ #ifdef DEBUG #define SF_IMPORTANT(FORMAT, ...) NSLog(@"%s:%d " FORMAT, __FUNCTION__, __LINE__, ## __VA_ARGS__) #else #define SF_IMPORTANT(...) #endif
Add empty SF_IMPORTANT macro for release build
Add empty SF_IMPORTANT macro for release build
C
mit
SiftScience/sift-ios,SiftScience/sift-ios,SiftScience/sift-ios,SiftScience/sift-ios
1980b7bb0ffee0750ed832fc1b474c6ae6e85b00
lib/libc/minimal/include/stddef.h
lib/libc/minimal/include/stddef.h
/* stddef.h */ /* * Copyright (c) 2014 Wind River Systems, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __INC_stddef_h__ #define __INC_stddef_h__ #include <bits/null.h> #include <bits/size_t.h> #if !defined(__ptrdiff_t_defined) #define __ptrdiff_t_defined typedef int ptrdiff_t; #endif #define offsetof(type, member) ((size_t) (&((type *) NULL)->member)) #endif /* __INC_stddef_h__ */
/* stddef.h */ /* * Copyright (c) 2014 Wind River Systems, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __INC_stddef_h__ #define __INC_stddef_h__ #include <bits/null.h> #include <bits/size_t.h> #if !defined(__ptrdiff_t_defined) #define __ptrdiff_t_defined typedef int ptrdiff_t; #endif #if defined(__GNUC__) #define offsetof(type, member) __builtin_offsetof(type, member) #else #define offsetof(type, member) ((size_t) (&((type *) NULL)->member)) #endif #endif /* __INC_stddef_h__ */
Use offsetof() builtin with GCC
lib: Use offsetof() builtin with GCC The default offsetof() implementation generates a warning (variably modified <variable> at file scope) when used in to define the size of an array. By using this builtin with GCC we avoid the warning and make sure no variable-size arrays are used. Change-Id: Iae215f777241f7daaa061067230086dffaa8311d Signed-off-by: Carles Cufi <853081dc8dca4fe6a7e3c984752718b5db36e060@nordicsemi.no>
C
apache-2.0
erwango/zephyr,zephyriot/zephyr,rsalveti/zephyr,runchip/zephyr-cc3220,holtmann/zephyr,aceofall/zephyr-iotos,holtmann/zephyr,punitvara/zephyr,finikorg/zephyr,pklazy/zephyr,zephyriot/zephyr,kraj/zephyr,erwango/zephyr,galak/zephyr,bboozzoo/zephyr,finikorg/zephyr,mbolivar/zephyr,runchip/zephyr-cc3220,ldts/zephyr,galak/zephyr,Vudentz/zephyr,ldts/zephyr,fractalclone/zephyr-riscv,galak/zephyr,kraj/zephyr,mbolivar/zephyr,kraj/zephyr,nashif/zephyr,fractalclone/zephyr-riscv,tidyjiang8/zephyr-doc,bboozzoo/zephyr,erwango/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,fbsder/zephyr,mbolivar/zephyr,bigdinotech/zephyr,runchip/zephyr-cc3200,nashif/zephyr,kraj/zephyr,sharronliu/zephyr,bigdinotech/zephyr,sharronliu/zephyr,fractalclone/zephyr-riscv,runchip/zephyr-cc3220,nashif/zephyr,tidyjiang8/zephyr-doc,holtmann/zephyr,holtmann/zephyr,explora26/zephyr,Vudentz/zephyr,punitvara/zephyr,runchip/zephyr-cc3200,rsalveti/zephyr,fbsder/zephyr,aceofall/zephyr-iotos,GiulianoFranchetto/zephyr,sharronliu/zephyr,bigdinotech/zephyr,finikorg/zephyr,aceofall/zephyr-iotos,pklazy/zephyr,nashif/zephyr,finikorg/zephyr,runchip/zephyr-cc3220,sharronliu/zephyr,runchip/zephyr-cc3200,tidyjiang8/zephyr-doc,bboozzoo/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,pklazy/zephyr,fractalclone/zephyr-riscv,Vudentz/zephyr,pklazy/zephyr,bigdinotech/zephyr,runchip/zephyr-cc3200,aceofall/zephyr-iotos,erwango/zephyr,zephyriot/zephyr,rsalveti/zephyr,tidyjiang8/zephyr-doc,bboozzoo/zephyr,finikorg/zephyr,galak/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,explora26/zephyr,bigdinotech/zephyr,runchip/zephyr-cc3200,erwango/zephyr,pklazy/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,rsalveti/zephyr,rsalveti/zephyr,zephyriot/zephyr,holtmann/zephyr,sharronliu/zephyr,Vudentz/zephyr,kraj/zephyr,fbsder/zephyr,explora26/zephyr,aceofall/zephyr-iotos,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,explora26/zephyr,punitvara/zephyr,fractalclone/zephyr-riscv,zephyriot/zephyr,tidyjiang8/zephyr-doc,mbolivar/zephyr,fbsder/zephyr,Vudentz/zephyr,punitvara/zephyr,mbolivar/zephyr,galak/zephyr,explora26/zephyr,runchip/zephyr-cc3220,fbsder/zephyr,bboozzoo/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr
188b56251284352d2a2da90d5fab31276a834ff7
testsuite/tests/rts/T7037_main.c
testsuite/tests/rts/T7037_main.c
#include <stddef.h> #include <unistd.h> int main(int argc, char *argv[]) { const char *args[2] = {"T7037", NULL}; execv("./T7037", args); }
#include <stddef.h> #include <unistd.h> int main(int argc, char *argv[]) { #ifdef __MINGW32__ const #endif char * args[2] = {"T7037", NULL}; execv("./T7037", args); }
Make T7037 work on both Windows and other platforms
Make T7037 work on both Windows and other platforms
C
bsd-3-clause
mcschroeder/ghc,forked-upstream-packages-for-ghcjs/ghc,tibbe/ghc,ryantm/ghc,TomMD/ghc,oldmanmike/ghc,nkaretnikov/ghc,mettekou/ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,nkaretnikov/ghc,mfine/ghc,mettekou/ghc,mcschroeder/ghc,AlexanderPankiv/ghc,christiaanb/ghc,snoyberg/ghc,ghc-android/ghc,snoyberg/ghc,christiaanb/ghc,hferreiro/replay,spacekitteh/smcghc,acowley/ghc,fmthoma/ghc,wxwxwwxxx/ghc,tjakway/ghcjvm,ghc-android/ghc,da-x/ghc,nushio3/ghc,nkaretnikov/ghc,bitemyapp/ghc,anton-dessiatov/ghc,holzensp/ghc,nkaretnikov/ghc,oldmanmike/ghc,vikraman/ghc,bitemyapp/ghc,tjakway/ghcjvm,anton-dessiatov/ghc,elieux/ghc,christiaanb/ghc,oldmanmike/ghc,TomMD/ghc,vikraman/ghc,spacekitteh/smcghc,mfine/ghc,frantisekfarka/ghc-dsi,ryantm/ghc,frantisekfarka/ghc-dsi,sdiehl/ghc,vikraman/ghc,jstolarek/ghc,GaloisInc/halvm-ghc,forked-upstream-packages-for-ghcjs/ghc,nathyong/microghc-ghc,holzensp/ghc,elieux/ghc,anton-dessiatov/ghc,fmthoma/ghc,lukexi/ghc-7.8-arm64,nushio3/ghc,christiaanb/ghc,mettekou/ghc,nushio3/ghc,hferreiro/replay,nkaretnikov/ghc,forked-upstream-packages-for-ghcjs/ghc,ezyang/ghc,sgillespie/ghc,ghc-android/ghc,mettekou/ghc,sgillespie/ghc,gridaphobe/ghc,sgillespie/ghc,AlexanderPankiv/ghc,da-x/ghc,vTurbine/ghc,urbanslug/ghc,ryantm/ghc,christiaanb/ghc,anton-dessiatov/ghc,elieux/ghc,oldmanmike/ghc,holzensp/ghc,TomMD/ghc,urbanslug/ghc,siddhanathan/ghc,snoyberg/ghc,elieux/ghc,gcampax/ghc,ml9951/ghc,ezyang/ghc,shlevy/ghc,oldmanmike/ghc,bitemyapp/ghc,urbanslug/ghc,GaloisInc/halvm-ghc,urbanslug/ghc,green-haskell/ghc,urbanslug/ghc,nushio3/ghc,jstolarek/ghc,frantisekfarka/ghc-dsi,hferreiro/replay,olsner/ghc,forked-upstream-packages-for-ghcjs/ghc,forked-upstream-packages-for-ghcjs/ghc,anton-dessiatov/ghc,sdiehl/ghc,nushio3/ghc,tibbe/ghc,vTurbine/ghc,wxwxwwxxx/ghc,mettekou/ghc,ml9951/ghc,nkaretnikov/ghc,acowley/ghc,da-x/ghc,GaloisInc/halvm-ghc,da-x/ghc,shlevy/ghc,olsner/ghc,gcampax/ghc,oldmanmike/ghc,snoyberg/ghc,olsner/ghc,vTurbine/ghc,lukexi/ghc-7.8-arm64,sdiehl/ghc,green-haskell/ghc,ezyang/ghc,hferreiro/replay,tibbe/ghc,nathyong/microghc-ghc,gridaphobe/ghc,sdiehl/ghc,ml9951/ghc,sdiehl/ghc,wxwxwwxxx/ghc,TomMD/ghc,anton-dessiatov/ghc,nathyong/microghc-ghc,ezyang/ghc,sgillespie/ghc,ml9951/ghc,urbanslug/ghc,AlexanderPankiv/ghc,GaloisInc/halvm-ghc,siddhanathan/ghc,lukexi/ghc,ezyang/ghc,wxwxwwxxx/ghc,vTurbine/ghc,sgillespie/ghc,gridaphobe/ghc,lukexi/ghc,tjakway/ghcjvm,bitemyapp/ghc,olsner/ghc,tjakway/ghcjvm,acowley/ghc,mcschroeder/ghc,christiaanb/ghc,gcampax/ghc,fmthoma/ghc,lukexi/ghc,christiaanb/ghc,AlexanderPankiv/ghc,hferreiro/replay,ml9951/ghc,gridaphobe/ghc,olsner/ghc,mfine/ghc,ml9951/ghc,olsner/ghc,lukexi/ghc,vikraman/ghc,shlevy/ghc,fmthoma/ghc,olsner/ghc,shlevy/ghc,mfine/ghc,tibbe/ghc,siddhanathan/ghc,AlexanderPankiv/ghc,ezyang/ghc,bitemyapp/ghc,tjakway/ghcjvm,mcschroeder/ghc,ezyang/ghc,wxwxwwxxx/ghc,gcampax/ghc,mcschroeder/ghc,holzensp/ghc,lukexi/ghc,GaloisInc/halvm-ghc,siddhanathan/ghc,nkaretnikov/ghc,hferreiro/replay,gcampax/ghc,sdiehl/ghc,nathyong/microghc-ghc,sgillespie/ghc,ghc-android/ghc,jstolarek/ghc,siddhanathan/ghc,ryantm/ghc,spacekitteh/smcghc,lukexi/ghc-7.8-arm64,ghc-android/ghc,ml9951/ghc,fmthoma/ghc,mfine/ghc,green-haskell/ghc,gcampax/ghc,TomMD/ghc,da-x/ghc,acowley/ghc,mettekou/ghc,forked-upstream-packages-for-ghcjs/ghc,ghc-android/ghc,vikraman/ghc,fmthoma/ghc,vTurbine/ghc,mettekou/ghc,nushio3/ghc,sdiehl/ghc,green-haskell/ghc,vTurbine/ghc,frantisekfarka/ghc-dsi,acowley/ghc,elieux/ghc,gridaphobe/ghc,snoyberg/ghc,gridaphobe/ghc,vTurbine/ghc,ghc-android/ghc,tjakway/ghcjvm,snoyberg/ghc,fmthoma/ghc,nushio3/ghc,ryantm/ghc,mcschroeder/ghc,nathyong/microghc-ghc,holzensp/ghc,vikraman/ghc,elieux/ghc,hferreiro/replay,wxwxwwxxx/ghc,mfine/ghc,elieux/ghc,acowley/ghc,lukexi/ghc-7.8-arm64,wxwxwwxxx/ghc,ml9951/ghc,shlevy/ghc,jstolarek/ghc,da-x/ghc,shlevy/ghc,nathyong/microghc-ghc,tjakway/ghcjvm,mfine/ghc,sgillespie/ghc,gcampax/ghc,acowley/ghc,oldmanmike/ghc,anton-dessiatov/ghc,nathyong/microghc-ghc,spacekitteh/smcghc,vikraman/ghc,urbanslug/ghc,lukexi/ghc-7.8-arm64,spacekitteh/smcghc,TomMD/ghc,AlexanderPankiv/ghc,jstolarek/ghc,siddhanathan/ghc,mcschroeder/ghc,TomMD/ghc,forked-upstream-packages-for-ghcjs/ghc,shlevy/ghc,da-x/ghc,AlexanderPankiv/ghc,gridaphobe/ghc,siddhanathan/ghc,frantisekfarka/ghc-dsi,tibbe/ghc,snoyberg/ghc,green-haskell/ghc
27e5d7c74125784cb278b44e12881ca3596ee868
STM32F103GNU/src/startup.c
STM32F103GNU/src/startup.c
/* * startup.h * * Created on: Nov 15, 2016 * Author: RoyerAriel */ #ifndef STARTUP_C_ #define STARTUP_C_ #include "Timer.h" void startup() { //Start Systick Timer at 1ms Systick_Startup(); AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //0x‭2000000‬ } #endif /* STARTUP_C_ */
/* * startup.h * * Created on: Nov 15, 2016 * Author: RoyerAriel */ #ifndef STARTUP_C_ #define STARTUP_C_ #include "Timer.h" void startup() { //Start Systick Timer at 1ms Systick_Startup(); AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //0x‭2000000‬disable jtag } #endif /* STARTUP_C_ */
Disable Jtag came enable by default
Disable Jtag came enable by default Disable Jtag came enable by default and use GPIOB P04,P03 and P05
C
epl-1.0
royel21/STM32F103GNU,royel21/STM32F103GNU
d6e3fda253c18d1a30c14d5b176737c337c00b00
IAAI.c
IAAI.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { system(RAW); const char *str; if ( argc == 2 ) str = argv[1]; else str = default_str; size_t len = strlen(str); while ( 1 ) { for ( size_t i = 0 ; i < len ; i++ ) { getchar(); printf("\b%c", str[i]); } system(COOKED); printf("\n"); system(RAW); } return 0; }
#include <stdio.h> #include <stdlib.h> #include <string.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { system(RAW); const char *str; if ( argc == 2 ) str = argv[1]; else str = default_str; size_t len = strlen(str); while ( 1 ) { for ( size_t i = 0 ; i < len ; i++ ) { getchar(); printf("\r"); for ( size_t j = 0 ; j <= i ; j++ ) { printf("%c", str[j]); } } system(COOKED); printf("\n"); system(RAW); } return 0; }
Allow non printing chars to also work well
Allow non printing chars to also work well
C
mit
vinamarora8/IAAI
7e9ee0eb7233bcfb93f53a18320cf8187c5f5d89
libutils/include/utils/fence.h
libutils/include/utils/fence.h
/* * Copyright 2016, Data61 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) * ABN 41 687 119 230. * * 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(D61_BSD) */ #pragma once /* Prevent the compiler from re-ordering any read or write across the fence. */ #define COMPILER_MEMORY_FENCE() __atomic_signal_fence(__ATOMIC_ACQ_REL) /* Prevent the compiler from re-ordering any write which follows the fence * in program order with any read or write which preceeds the fence in * program order. */ #define COMPILER_MEMORY_RELEASE() __atomic_signal_fence(__ATOMIC_RELEASE) /* Prevent the compiler from re-ordering any read which preceeds the fence * in program order with any read or write which follows the fence in * program order */. #define COMPILER_MEMORY_ACQUIRE() __atomic_signal_fence(__ATOMIC_ACQUIRE)
/* * Copyright 2016, Data61 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) * ABN 41 687 119 230. * * 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(D61_BSD) */ #pragma once /* Prevent the compiler from re-ordering any read or write across the fence. */ #define COMPILER_MEMORY_FENCE() __atomic_signal_fence(__ATOMIC_ACQ_REL) /* Prevent the compiler from re-ordering any write which follows the fence * in program order with any read or write which preceeds the fence in * program order. */ #define COMPILER_MEMORY_RELEASE() __atomic_signal_fence(__ATOMIC_RELEASE) /* Prevent the compiler from re-ordering any read which preceeds the fence * in program order with any read or write which follows the fence in * program order. */ #define COMPILER_MEMORY_ACQUIRE() __atomic_signal_fence(__ATOMIC_ACQUIRE)
Move trailing . inside comment
libutils: Move trailing . inside comment
C
bsd-2-clause
agacek/util_libs,agacek/util_libs,agacek/util_libs,agacek/util_libs
5ffd5d785b8d50aae883fe39055de6e422649418
qstr/main.c
qstr/main.c
// ** QueryString // // This program reads chars from stdin without echo and put to stdout. // #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <termios.h> int main(int argc, char * args[]) { struct termios old_tio, new_tio; unsigned char c; /* get the terminal settings for stdin */ tcgetattr(STDIN_FILENO, &old_tio); /* we want to keep the old setting to restore them a the end */ new_tio = old_tio; /* disable canonical mode (buffered i/o) and local echo */ new_tio.c_lflag &= (~ICANON & ~ECHO); /* set the new settings immediately */ tcsetattr(STDIN_FILENO, TCSANOW, &new_tio); while ((c = getchar()) != '\n') { putchar(c); }; /* restore the former settings */ tcsetattr(STDIN_FILENO, TCSANOW, &old_tio); return 0; }
Add qstr - query string utility
Add qstr - query string utility
C
mit
showcode/tools
86fb835194f54ccecc33bfaf71f38b636993baab
test/Preprocessor/comment_save_macro.c
test/Preprocessor/comment_save_macro.c
// RUN: clang-cc -E -C %s | FileCheck -strict-whitespace %s // CHECK: boo bork bar // zot // RUN: clang-cc -E -CC %s | FileCheck -strict-whitespace %s // CHECK: boo bork /* blah*/ bar // zot // RUN: clang-cc -E %s | FileCheck -strict-whitespace %s // CHECK: boo bork bar #define FOO bork // blah boo FOO bar // zot
// RUN: clang-cc -E -C %s | FileCheck -strict-whitespace %s && // CHECK: boo bork bar // zot // RUN: clang-cc -E -CC %s | FileCheck -strict-whitespace %s && // CHECK: boo bork /* blah*/ bar // zot // RUN: clang-cc -E %s | FileCheck -strict-whitespace %s // CHECK: boo bork bar #define FOO bork // blah boo FOO bar // zot
Fix a broken test in rev. 85199.
Fix a broken test in rev. 85199. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@85200 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
22f57814c548ceb55bd4295768ff1873f3f4e3ae
webserver.c
webserver.c
#include <netinet/in.h> #include <stdio.h> #include <sys/socket.h> int main(int argc, char** argv) { int listen_fd; struct sockaddr_in serv_addr; listen_fd = socket(AF_INET, SOCK_STREAM, 0); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); serv_addr.sin_port = htons(8080); bind(listen_fd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)); if (listen(listen_fd, 64)) { perror("listen"); } else { } return 0; }
#include <netinet/in.h> #include <stdio.h> #include <sys/socket.h> #include <unistd.h> #define TRUE 1 #define BUFFER_SIZE 8096 int main(int argc, char** argv) { int listen_fd; int connection_fd; socklen_t length; int err; int read_len; char buffer[BUFFER_SIZE+1]; struct sockaddr_in serv_addr; struct sockaddr_in client_addr; listen_fd = socket(AF_INET, SOCK_STREAM, 0); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); serv_addr.sin_port = htons(8080); err = bind(listen_fd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)); if (err == -1) { perror("bind"); } err = listen(listen_fd, 64); if (err == -1) { perror("listen"); } while (TRUE) { connection_fd = accept(listen_fd, (struct sockaddr*)&client_addr, &length); read_len = read(connection_fd, buffer, BUFFER_SIZE); printf("Read %d bytes: %s\n", read_len, buffer); close(connection_fd); } return 0; }
Implement accept of incoming requests
Implement accept of incoming requests
C
apache-2.0
benjic/web-server,benjic/web-server
a2c066c1346a897b8a62fac75951009107437f34
serialization/include/SerializationToStream.h
serialization/include/SerializationToStream.h
/// \file /// \brief This header contains functionality needed for serializing and deserealizing to/from a stream #pragma once #include "ISerializable.h" #include "IStorage.h" #include <iostream> /// Contains all the functionality provided by the library. namespace simpson { /// Serialize object to ostream std::ostream& operator<<(std::ostream& outStream, simpson::ISerializable& obj); /// Deserialize object from istream std::istream& operator>>(std::istream& inStream, simpson::ISerializable* obj); } // simpson
/// \file /// \brief This header contains functionality needed for serializing and deserealizing to/from a stream #pragma once #include "IStorage.h" #include <iostream> /// Contains all the functionality provided by the library. namespace simpson { class ISerializable; /// Serialize object to ostream std::ostream& operator<<(std::ostream& outStream, ISerializable& obj); /// Deserialize object from istream std::istream& operator>>(std::istream& inStream, ISerializable* obj); } // simpson
Change include to forward declaration
Change include to forward declaration
C
mit
artem-ogre/simpson,artem-ogre/simpson
6779aa4e1884e4bb6e87820f7d29f08a84fde425
Kiwi/KiwiConfiguration.h
Kiwi/KiwiConfiguration.h
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import <Foundation/Foundation.h> #define KW_VERSION 0.5 // Blocks being unavailable cripples the usability of Kiwi, but is supported // because they are not available on anything less than a device running 3.2. #if defined(__BLOCKS__) #define KW_BLOCKS_ENABLED 1 #endif // #if defined(__BLOCKS__) // As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or // forwardInvocation: boundary in the simulator will terminate the app instead // of being caught in @catch blocks from the caller side of the -invoke. Kiwi // tries to handle this by storing the first exception that it would have // otherwise thrown in a nasty global that callers can look for and handle. // (Buggy termination is less desirable than global variables). // // Obviously, this can only handles cases where Kiwi itself would have raised // an exception. #if TARGET_IPHONE_SIMULATOR #define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1 #endif // #if TARGET_IPHONE_SIMULATOR
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import <Foundation/Foundation.h> #define KW_VERSION 0.5 // Blocks being unavailable cripples the usability of Kiwi, but is supported // because they are not available on anything less than a device running 3.2. #if defined(__BLOCKS__) #ifndef KW_BLOCKS_ENABLED #define KW_BLOCKS_ENABLED 1 #endif // #ifndef KW_BLOCKS_ENABLED #endif // #if defined(__BLOCKS__) // As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or // forwardInvocation: boundary in the simulator will terminate the app instead // of being caught in @catch blocks from the caller side of the -invoke. Kiwi // tries to handle this by storing the first exception that it would have // otherwise thrown in a nasty global that callers can look for and handle. // (Buggy termination is less desirable than global variables). // // Obviously, this can only handles cases where Kiwi itself would have raised // an exception. #if TARGET_IPHONE_SIMULATOR #define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1 #endif // #if TARGET_IPHONE_SIMULATOR
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level
C
bsd-3-clause
ecaselles/Kiwi,allending/Kiwi,LiuShulong/Kiwi,TaemoonCho/Kiwi,emodeqidao/Kiwi,weslindsay/Kiwi,depop/Kiwi,emodeqidao/Kiwi,unisontech/Kiwi,samkrishna/Kiwi,tangwei6423471/Kiwi,samkrishna/Kiwi,tangwei6423471/Kiwi,indiegogo/Kiwi,JoistApp/Kiwi,LiuShulong/Kiwi,ashfurrow/Kiwi,howandhao/Kiwi,iosRookie/Kiwi,hyperoslo/Tusen,emodeqidao/Kiwi,indiegogo/Kiwi,alloy/Kiwi,unisontech/Kiwi,weslindsay/Kiwi,alloy/Kiwi,tcirwin/Kiwi,tangwei6423471/Kiwi,ecaselles/Kiwi,iosRookie/Kiwi,tonyarnold/Kiwi,samkrishna/Kiwi,carezone/Kiwi,tonyarnold/Kiwi,ashfurrow/Kiwi,emodeqidao/Kiwi,depop/Kiwi,ecaselles/Kiwi,JoistApp/Kiwi,tonyarnold/Kiwi,ecaselles/Kiwi,hyperoslo/Tusen,cookov/Kiwi,hyperoslo/Tusen,tangwei6423471/Kiwi,howandhao/Kiwi,LiuShulong/Kiwi,tcirwin/Kiwi,samkrishna/Kiwi,tcirwin/Kiwi,JoistApp/Kiwi,tcirwin/Kiwi,hyperoslo/Tusen,howandhao/Kiwi,cookov/Kiwi,indiegogo/Kiwi,PaulTaykalo/Kiwi,allending/Kiwi,carezone/Kiwi,TaemoonCho/Kiwi,depop/Kiwi,depop/Kiwi,unisontech/Kiwi,allending/Kiwi,iosRookie/Kiwi,TaemoonCho/Kiwi,ashfurrow/Kiwi,howandhao/Kiwi,cookov/Kiwi,TaemoonCho/Kiwi,LiuShulong/Kiwi,alloy/Kiwi,unisontech/Kiwi,cookov/Kiwi,weslindsay/Kiwi,iosRookie/Kiwi,tonyarnold/Kiwi,JoistApp/Kiwi,indiegogo/Kiwi,PaulTaykalo/Kiwi,weslindsay/Kiwi,PaulTaykalo/Kiwi,PaulTaykalo/Kiwi,carezone/Kiwi,allending/Kiwi,carezone/Kiwi
5df03525b7db34b41c9993140e55877a1f0e8fd3
test/Driver/avr-mmcu.c
test/Driver/avr-mmcu.c
// A test for the propagation of the -mmcu option to -cc1 and -cc1as // RUN: %clang -### -target avr -mmcu=atmega328p -save-temps %s 2>&1 | FileCheck %s // CHECK: clang{{.*}} "-cc1" {{.*}} "-target-cpu" "atmega328p" // CHECK: clang{{.*}} "-cc1as" {{.*}} "-target-cpu" "atmega328p"
// A test for the propagation of the -mmcu option to -cc1 and -cc1as // RUN: %clang -### -target avr -no-canonical-prefixes -mmcu=atmega328p -save-temps %s 2>&1 | FileCheck %s // CHECK: clang{{.*}} "-cc1" {{.*}} "-target-cpu" "atmega328p" // CHECK: clang{{.*}} "-cc1as" {{.*}} "-target-cpu" "atmega328p"
Add a missing -no-canonical-prefixes to test.
[Driver] Add a missing -no-canonical-prefixes to test. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@300873 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
6f92873e8a06ee7d5159d04aac1377c67e2b8c44
BIObjCHelpers/Interface/BIObjCHelpers.h
BIObjCHelpers/Interface/BIObjCHelpers.h
// // BIObjCHelpers.h // BIObjCHelpersExample // // Created by Bogdan Iusco on 1/19/15. // Copyright (c) 2015 Bogdan Iusco. All rights reserved. // // Starters #import "BIStarterProtocol.h" #import "BILifecycle.h" #import "BIStartersFactory.h" #import "BIOperationQueue.h" // Views #import "BITableView.h" // Datasources #import "BIDatasourceTableView.h" #import "BIDatasourceCollectionView.h" #import "BIDatasourceFetchedTableView.h" #import "BIDatasourceFetchedCollectionView.h" #import "BIDatasourceFeedTableView.h" #import "BIBatch.h" // Handlers #import "BIHandlerBase.h" #import "BIHandlerTableView.h" // Categories #import "NSBundle+BIExtra.h" #import "NSString+BIExtra.h" #import "NSDate+BIAttributedString.h" // Batch #import "BIBatch.h" #import "BIBatchRequest.h" #import "BIBatchResponse.h"
// // BIObjCHelpers.h // BIObjCHelpersExample // // Created by Bogdan Iusco on 1/19/15. // Copyright (c) 2015 Bogdan Iusco. All rights reserved. // // Starters #import "BIStarterProtocol.h" #import "BILifecycle.h" #import "BIStartersFactory.h" #import "BIOperationQueue.h" #import "BILaunchStartersFactory.h" // Views #import "BITableView.h" // Datasources #import "BIDatasourceTableView.h" #import "BIDatasourceCollectionView.h" #import "BIDatasourceFetchedTableView.h" #import "BIDatasourceFetchedCollectionView.h" #import "BIDatasourceFeedTableView.h" #import "BIBatch.h" // Handlers #import "BIHandlerBase.h" #import "BIHandlerTableView.h" // Categories #import "NSBundle+BIExtra.h" #import "NSString+BIExtra.h" #import "NSDate+BIAttributedString.h" // Batch #import "BIBatch.h" #import "BIBatchRequest.h" #import "BIBatchResponse.h"
Add BILaunchStartersFactory to interface file
Add BILaunchStartersFactory to interface file
C
mit
grigaci/BIObjCHelpers
0e4d41f065f7803d096e6c53b3956c820186c3ea
freebsd/util.h
freebsd/util.h
#include <libutil.h> #ifndef TAILQ_END #define TAILQ_END(head) NULL #endif
#include <libutil.h> #ifndef TAILQ_END #define TAILQ_END(head) NULL #endif #ifndef SIMPLEQ_HEAD #define SIMPLEQ_HEAD STAILQ_HEAD #define SIMPLEQ_HEAD_INITIALIZER STAILQ_HEAD_INITIALIZER #define SIMPLEQ_ENTRY STAILQ_ENTRY #define SIMPLEQ_INIT STAILQ_INIT #define SIMPLEQ_INSERT_AFTER STAILQ_INSERT_AFTER #define SIMPLEQ_INSERT_HEAD STAILQ_INSERT_HEAD #define SIMPLEQ_INSERT_TAIL STAILQ_INSERT_TAIL #define SIMPLEQ_EMPTY STAILQ_EMPTY #define SIMPLEQ_FIRST STAILQ_FIRST #define SIMPLEQ_REMOVE_AFTER STAILQ_REMOVE_AFTER #define SIMPLEQ_REMOVE_HEAD STAILQ_REMOVE_HEAD #define SIMPLEQ_FOREACH STAILQ_FOREACH #define SIMPLEQ_END(head) NULL #endif
Add SIMPLEQ->STAILQ macros for freebsd.
Add SIMPLEQ->STAILQ macros for freebsd.
C
isc
conformal/spectrwm,conformal/spectrwm,conformal/spectrwm
e5155ae7c734428d5456c1b7d47bbc2ac31f6da9
inputhandler.c
inputhandler.c
//This is a preliminary version of this file for testing and learning purposes //Author: Jonas Iacobi #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h> char* getMessage(char* filename){ char* msg = NULL; int msgLength, txtLength; FILE *fp = fopen( filename, "r"); if(fp){ //Find end of text file, find file size, and go back to beginning of file. fseek(fp, 0, SEEK_END); msgLength = ftell(fp); fseek(fp, SEEK_SET, 0); //Allocate memory for the string msg = ((char*) malloc(sizeof(char) * msgLength+1)); //Read the entire file pointed to by fp in chunks of 2 byte to the string msg and store the read size in txtLength. txtLength = fread(msg, sizeof(char), msgLength, fp); msg[msgLength] = '\0'; fclose(fp); //Error check if(msgLength != txtLength){ //The read failed somehow. Abort mission. free(msg); msg = NULL; return "Error: Length of file not equal to length of read. That's probably my fault -Jonas"; } return msg; } else{ return "Error: File not found. Please contact the poor students who made this."; } } int main(){ char* filename = "C:/Users/iacob/Desktop/msg.txt"; printf("%s\n", filename); char* message = getMessage(filename); printf("%s\n", message); return 0; }
Revert "Revert "Created a preliminary getMessage method""
Revert "Revert "Created a preliminary getMessage method"" This reverts commit 7d29c8faff9ffba05d14e7597e78dd24da7eaab4.
C
mit
Zaladar/PPM,Zaladar/PPM,Zaladar/PPM
264a4058eb58ba078069f2cc2ff6fa9ae015bc4d
src/stack.h
src/stack.h
#ifndef _STACK_H_ #define _STACK_H_ /* * data stack for use with automaton infrastructure */ #include "dataStackEntry.h" typedef struct stack Stack; Stack *stack_create(int size); void stack_destroy(Stack *st); void reset(Stack *st); void push(Stack *st, DataStackEntry d); DataStackEntry pop(Stack *st); #endif /* _STACK_H_ */
/* * Copyright (c) 2013, Court of the University of Glasgow * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of the University of Glasgow nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _STACK_H_ #define _STACK_H_ /* * data stack for use with automaton infrastructure */ #include "dataStackEntry.h" typedef struct stack Stack; Stack *stack_create(int size); void stack_destroy(Stack *st); void reset(Stack *st); void push(Stack *st, DataStackEntry d); DataStackEntry pop(Stack *st); #endif /* _STACK_H_ */
Add BSD 3-clause open source header
Add BSD 3-clause open source header
C
bsd-3-clause
jsventek/Cache,fergul/Cache,jsventek/Cache,fergul/Cache,jsventek/Cache,fergul/Cache
eee5fc4106b389daeb709112f77b1a2e41ceee30
src/sysdeps/tryarc4random_addrandom.c
src/sysdeps/tryarc4random_addrandom.c
/* ISC license. */ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE #include <stdlib.h> int main (void) { arc4random_addrandom("", 1) ; return 0 ; }
/* ISC license. */ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE #include <stdlib.h> int main (void) { unsigned char *blah = "" ; arc4random_addrandom(blah, 1) ; return 0 ; }
Fix arc4random_addrandom detection for -Werror=pointer-sign
Fix arc4random_addrandom detection for -Werror=pointer-sign
C
isc
skarnet/skalibs,skarnet/skalibs
b56a4389c1ae7ce29e2221db3339ce7a9ec2ff62
test/main.c
test/main.c
#include <stdio.h> #include "bincookie.h" int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]); printf("Example: %s Cookies.binarycookies\n", argv[0]); return 1; } binarycookies_t *bc = binarycookies_init(argv[1]); unsigned int i, j; binarycookies_flag flags; // Output in Netscape cookies.txt format for (i = 0; i < bc->num_pages; i++) { for (j = 0; j < bc->pages[i]->number_of_cookies; j++) { flags = bc->pages[i]->cookies[j]->flags; // domain, flag, path, secure, expiration, name, value printf("%s\t%s\t%s\t%s\t%.f\t%s\t%s\n", bc->pages[i]->cookies[j]->url, bc->pages[i]->cookies[j]->url[0] == '.' ? "TRUE" : "FALSE", bc->pages[i]->cookies[j]->path, flags == secure || flags == secure_http_only ? "TRUE" : "FALSE", bc->pages[i]->cookies[j]->expiration_date, bc->pages[i]->cookies[j]->name, bc->pages[i]->cookies[j]->value); } } binarycookies_free(bc); return 0; }
#include <stdio.h> #include "bincookie.h" int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]); printf("Example: %s Cookies.binarycookies\n", argv[0]); return 1; } binarycookies_t *bc = binarycookies_init(argv[1]); unsigned int i, j; // Output in Netscape cookies.txt format for (i = 0; i < bc->num_pages; i++) { for (j = 0; j < bc->pages[i]->number_of_cookies; j++) { // domain, flag, path, secure, expiration, name, value printf("%s\t%s\t%s\t%s\t%.f\t%s\t%s\n", bc->pages[i]->cookies[j]->url, bc->pages[i]->cookies[j]->url[0] == '.' ? "TRUE" : "FALSE", bc->pages[i]->cookies[j]->path, binarycookies_is_secure(bc->pages[i]->cookies[j]) ? "TRUE" : "FALSE", bc->pages[i]->cookies[j]->expiration_date, bc->pages[i]->cookies[j]->name, bc->pages[i]->cookies[j]->value); } } binarycookies_free(bc); return 0; }
Use macro to check security of cookie
Use macro to check security of cookie
C
mit
Tatsh/libbinarycookies,Tatsh/libbinarycookies
1f1e880a7ff7fc1dcb3dbba5910ff6e5a65603c6
net/proxy/proxy_resolver_mac.h
net/proxy/proxy_resolver_mac.h
// Copyright (c) 2008 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_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ #pragma once #include <string> #include "googleurl/src/gurl.h" #include "net/base/net_errors.h" #include "net/proxy/proxy_resolver.h" namespace net { // Implementation of ProxyResolver that uses the Mac CFProxySupport to implement // proxies. class ProxyResolverMac : public ProxyResolver { public: ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {} // ProxyResolver methods: virtual int GetProxyForURL(const GURL& url, ProxyInfo* results, CompletionCallback* callback, RequestHandle* request, const BoundNetLog& net_log); virtual void CancelRequest(RequestHandle request) { NOTREACHED(); } virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* /*callback*/) { script_data_ = script_data_; return OK; } private: scoped_refptr<ProxyResolverScriptData> script_data_; }; } // namespace net #endif // NET_PROXY_PROXY_RESOLVER_MAC_H_
// Copyright (c) 2008 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_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ #pragma once #include <string> #include "googleurl/src/gurl.h" #include "net/base/net_errors.h" #include "net/proxy/proxy_resolver.h" namespace net { // Implementation of ProxyResolver that uses the Mac CFProxySupport to implement // proxies. class ProxyResolverMac : public ProxyResolver { public: ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {} // ProxyResolver methods: virtual int GetProxyForURL(const GURL& url, ProxyInfo* results, CompletionCallback* callback, RequestHandle* request, const BoundNetLog& net_log); virtual void CancelRequest(RequestHandle request) { NOTREACHED(); } virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* /*callback*/) { script_data_ = script_data; return OK; } private: scoped_refptr<ProxyResolverScriptData> script_data_; }; } // namespace net #endif // NET_PROXY_PROXY_RESOLVER_MAC_H_
Fix a typo, that could cause a crash on mac.
Fix a typo, that could cause a crash on mac. BUG=50717 TBR=rvargas TEST=Set system proxy settings to use a custom PAC script, then launch TestShell.app -- should not crash. Review URL: http://codereview.chromium.org/3023030 git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@54279 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
6f608d521539a6c6d492185c964853021ba4a5a3
lib/assembly.h
lib/assembly.h
/* ===-- assembly.h - compiler-rt assembler support macros -----------------=== * * The LLVM Compiler Infrastructure * * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * * This file defines macros for use in compiler-rt assembler source. * This file is not part of the interface of this library. * * ===----------------------------------------------------------------------=== */ #ifndef COMPILERRT_ASSEMBLY_H #define COMPILERRT_ASSEMBLY_H // Define SYMBOL_NAME to add the appropriate symbol prefix; we can't use // USER_LABEL_PREFIX directly because of cpp brokenness. #if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__) #define SYMBOL_NAME(name) name #define SEPARATOR @ #else #define SYMBOL_NAME(name) _##name #define SEPARATOR ; #endif #define DEFINE_COMPILERRT_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ SYMBOL_NAME(name): #define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ .private_extern SYMBOL_NAME(name) SEPARATOR \ SYMBOL_NAME(name): #endif /* COMPILERRT_ASSEMBLY_H */
/* ===-- assembly.h - compiler-rt assembler support macros -----------------=== * * The LLVM Compiler Infrastructure * * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== * * This file defines macros for use in compiler-rt assembler source. * This file is not part of the interface of this library. * * ===----------------------------------------------------------------------=== */ #ifndef COMPILERRT_ASSEMBLY_H #define COMPILERRT_ASSEMBLY_H // Define SYMBOL_NAME to add the appropriate symbol prefix; we can't use // USER_LABEL_PREFIX directly because of cpp brokenness. #if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__) #define SYMBOL_NAME(name) name #define SEPARATOR @ #else #define SYMBOL_NAME(name) #__USER_LABEL_PREFIX__ ##name #define SEPARATOR ; #endif #define DEFINE_COMPILERRT_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ SYMBOL_NAME(name): #define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ .private_extern SYMBOL_NAME(name) SEPARATOR \ SYMBOL_NAME(name): #endif /* COMPILERRT_ASSEMBLY_H */
Use __USER_LABEL_PREFIX__ so that we don't add a _ prefix on ELF.
Use __USER_LABEL_PREFIX__ so that we don't add a _ prefix on ELF. git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@86542 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
c1c9990cbac5231efe8989ab34909ef948fb73cd
cpp/include/phevaluator/card.h
cpp/include/phevaluator/card.h
#ifndef PHEVALUATOR_CARD_H #define PHEVALUATOR_CARD_H #ifdef __cplusplus #include <unordered_map> #include <string> namespace phevaluator { class Card { public: Card() {} Card(int id) : id_(id) {} Card(std::string name) { const std::unordered_map<char, int> rankMap = { {'2', 0}, {'3', 1}, {'4', 2}, {'5', 3}, {'6', 4}, {'7', 5}, {'8', 6}, {'9', 7}, {'T', 8}, {'J', 9}, {'Q', 10}, {'K', 11}, {'A', 12}, }; const std::unordered_map<char, int> suitMap = { {'C', 0}, {'D', 1}, {'H', 2}, {'S', 3}, {'c', 0}, {'d', 1}, {'h', 2}, {'s', 3}, }; if (name.length() < 2) { // TODO: throw an exception here } id_ = rankMap.at(name[0]) * 4 + suitMap.at(name[1]); } operator int() const { return id_; } private: int id_; }; } // namespace phevaluator #endif // __cplusplus #endif // PHEVALUATOR_CARD_H
#ifndef PHEVALUATOR_CARD_H #define PHEVALUATOR_CARD_H #ifdef __cplusplus #include <unordered_map> #include <string> namespace phevaluator { class Card { public: Card() {} Card(int id) : id_(id) {} Card(std::string name) { const std::unordered_map<char, int> rankMap = { {'2', 0}, {'3', 1}, {'4', 2}, {'5', 3}, {'6', 4}, {'7', 5}, {'8', 6}, {'9', 7}, {'T', 8}, {'J', 9}, {'Q', 10}, {'K', 11}, {'A', 12}, }; const std::unordered_map<char, int> suitMap = { {'C', 0}, {'D', 1}, {'H', 2}, {'S', 3}, {'c', 0}, {'d', 1}, {'h', 2}, {'s', 3}, }; if (name.length() < 2) { // TODO: throw an exception here } id_ = rankMap.at(name[0]) * 4 + suitMap.at(name[1]); } Card(const char name[]) : Card(std::string(name)) {} operator int() const { return id_; } private: int id_; }; } // namespace phevaluator #endif // __cplusplus #endif // PHEVALUATOR_CARD_H
Add parameter type `const char []` to the Card constructor
Add parameter type `const char []` to the Card constructor
C
apache-2.0
HenryRLee/PokerHandEvaluator,HenryRLee/PokerHandEvaluator,HenryRLee/PokerHandEvaluator
213ebf26505763a32d7248b0e86a1cb7b50d9f6a
test2/arrays/qualified_type_checks.c
test2/arrays/qualified_type_checks.c
// RUN: %ucc -fsyntax-only %s typedef int array[3]; const array yo; // int const yo[3]; // ^~ no const here h(array); // int h(int [3]); i(const array); // int i(int const [3]); // ^~ no const here j(int[const]); // int j(int *const); _Static_assert(_Generic(yo, const int[3]: 1) == 1, ""); _Static_assert(_Generic(&h, int (*)(int[3]): 1) == 1, ""); _Static_assert(_Generic(&h, int (*)(int const[3]): 1, default: 2) == 2, ""); _Static_assert(_Generic(&h, int (*)(int *const): 1) == 1, ""); _Static_assert(_Generic(&h, int (*)(int *): 1) == 1, ""); _Static_assert(_Generic(&i, int (*)(int const[3]): 1) == 1, ""); _Static_assert(_Generic(&i, int (*)(int [3]): 1, default: 2) == 2, ""); _Static_assert(_Generic(&i, int (*)(int const *): 1) == 1, ""); _Static_assert(_Generic(&i, int (*)(int const *const): 1) == 1, ""); _Static_assert(_Generic(&j, int (*)(int *const): 1) == 1, ""); _Static_assert(_Generic(&j, int (*)(int [const]): 1) == 1, ""); _Static_assert(_Generic(&j, int (*)(int const *const): 1, default: 2) == 2, ""); _Static_assert(_Generic(&j, int (*)(int const [const]): 1, default: 2) == 2, "");
Add function parameter qualifier type tests
Add function parameter qualifier type tests
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
c13fa6ae63ef93364adc41d332eaa249f3585ec6
lib/bytestream.h
lib/bytestream.h
#ifndef __BYTESTREAM__ #define __BYTESTREAM__ #include <stdint.h> #include <unistd.h> #define BS_RO 0 #define BS_RW 1 typedef struct _ByteStream { char* filename; size_t size; uint8_t* data; uint32_t offset; int exhausted; } ByteStream; ByteStream* bsalloc(unsigned int size); ByteStream* bsmap(char* filename); int bsfree(ByteStream* bstream); void bsseek(ByteStream* bs, uint32_t offset); void bsreset(ByteStream* bs); unsigned int bsread(ByteStream* bs, uint8_t* buf, size_t size); unsigned int bsread_offset(ByteStream* bs, uint8_t* buf, size_t size, uint32_t offset); int bswrite(ByteStream* bs, uint8_t* data, unsigned int size); unsigned int bswrite_offset(ByteStream* bs, uint8_t* buf, size_t size, uint32_t offset); int bssave(ByteStream* bs, char* filename); #endif
#ifndef __BYTESTREAM__ #define __BYTESTREAM__ #include <stdint.h> #include <unistd.h> #define BS_RO 0 #define BS_RW 1 // MAP_ANONYMOUS is MAP_ANON on OSX, so this will let us compile #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif typedef struct _ByteStream { char* filename; size_t size; uint8_t* data; uint32_t offset; int exhausted; } ByteStream; ByteStream* bsalloc(unsigned int size); ByteStream* bsmap(char* filename); int bsfree(ByteStream* bstream); void bsseek(ByteStream* bs, uint32_t offset); void bsreset(ByteStream* bs); unsigned int bsread(ByteStream* bs, uint8_t* buf, size_t size); unsigned int bsread_offset(ByteStream* bs, uint8_t* buf, size_t size, uint32_t offset); int bswrite(ByteStream* bs, uint8_t* data, unsigned int size); unsigned int bswrite_offset(ByteStream* bs, uint8_t* buf, size_t size, uint32_t offset); int bssave(ByteStream* bs, char* filename); #endif
Fix compilation on OSX MAP_ANONYMOUS is MAP_ANON on OSX, so this will let the project compile.
Fix compilation on OSX MAP_ANONYMOUS is MAP_ANON on OSX, so this will let the project compile.
C
bsd-3-clause
strazzere/dexterity,rchiossi/dexterity,rchiossi/dexterity,rchiossi/dexterity,strazzere/dexterity,strazzere/dexterity
766a76e551d945fc2513a7c2968544a19c810d96
common/bpf/lib/dbg.h
common/bpf/lib/dbg.h
#ifndef __LIB_DBG__ #define __LIB_DBG__ #define DEBUG #ifdef DEBUG # define printk(fmt, ...) \ ({ \ char ____fmt[] = fmt; \ trace_printk(____fmt, sizeof(____fmt), \ ##__VA_ARGS__); \ }) #else # define printk(fmt, ...) \ do { } while (0) #endif #endif /* __LIB_DBG__ */
#ifndef __LIB_DBG__ #define __LIB_DBG__ #ifdef DEBUG # define printk(fmt, ...) \ ({ \ char ____fmt[] = fmt; \ trace_printk(____fmt, sizeof(____fmt), \ ##__VA_ARGS__); \ }) #else # define printk(fmt, ...) \ do { } while (0) #endif #endif /* __LIB_DBG__ */
Remove DEBUG for performance testing.
Remove DEBUG for performance testing.
C
apache-2.0
gumpt/cilium,mskarbek/cilium,scanf/cilium,tgraf/cilium,scanf/cilium,cilium/cilium,gumpt/cilium,ivar-lazzaro/cilium,michi-covalent/cilium,michi-covalent/cilium,michi-covalent/cilium,ivar-lazzaro/cilium,scanf/cilium,michi-covalent/cilium,tklauser/cilium,mskarbek/cilium,gumpt/cilium,scanf/cilium,ivar-lazzaro/cilium,mskarbek/cilium,cilium/cilium,tgraf/cilium,ivar-lazzaro/cilium,eloycoto/cilium,eloycoto/cilium,tgraf/cilium,gumpt/cilium,scanf/cilium,eloycoto/cilium,ivar-lazzaro/cilium,tklauser/cilium,tgraf/cilium,mskarbek/cilium,eloycoto/cilium,mskarbek/cilium,gumpt/cilium,scanf/cilium,scanf/cilium,gumpt/cilium,tgraf/cilium,eloycoto/cilium,ivar-lazzaro/cilium,eloycoto/cilium,tklauser/cilium,eloycoto/cilium,cilium/cilium,cilium-team/cilium,tklauser/cilium,mskarbek/cilium,cilium/cilium,tklauser/cilium,michi-covalent/cilium,cilium-team/cilium,cilium/cilium,tgraf/cilium,gumpt/cilium
399869422abf30a0f635596263fd315ea9bde266
Kiwi/KiwiConfiguration.h
Kiwi/KiwiConfiguration.h
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import <Foundation/Foundation.h> #define KW_VERSION 0.5 // Blocks being unavailable cripples the usability of Kiwi, but is supported // because they are not available on anything less than a device running 3.2. #if defined(__BLOCKS__) #define KW_BLOCKS_ENABLED 1 #endif // #if defined(__BLOCKS__) // As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or // forwardInvocation: boundary in the simulator will terminate the app instead // of being caught in @catch blocks from the caller side of the -invoke. Kiwi // tries to handle this by storing the first exception that it would have // otherwise thrown in a nasty global that callers can look for and handle. // (Buggy termination is less desirable than global variables). // // Obviously, this can only handles cases where Kiwi itself would have raised // an exception. #if TARGET_IPHONE_SIMULATOR #define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1 #endif // #if TARGET_IPHONE_SIMULATOR
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import <Foundation/Foundation.h> #define KW_VERSION 0.5 // Blocks being unavailable cripples the usability of Kiwi, but is supported // because they are not available on anything less than a device running 3.2. #if defined(__BLOCKS__) #ifndef KW_BLOCKS_ENABLED #define KW_BLOCKS_ENABLED 1 #endif // #ifndef KW_BLOCKS_ENABLED #endif // #if defined(__BLOCKS__) // As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or // forwardInvocation: boundary in the simulator will terminate the app instead // of being caught in @catch blocks from the caller side of the -invoke. Kiwi // tries to handle this by storing the first exception that it would have // otherwise thrown in a nasty global that callers can look for and handle. // (Buggy termination is less desirable than global variables). // // Obviously, this can only handles cases where Kiwi itself would have raised // an exception. #if TARGET_IPHONE_SIMULATOR #define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1 #endif // #if TARGET_IPHONE_SIMULATOR
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level
C
bsd-3-clause
LiuShulong/Kiwi,samkrishna/Kiwi,carezone/Kiwi,howandhao/Kiwi,ecaselles/Kiwi,allending/Kiwi,TaemoonCho/Kiwi,howandhao/Kiwi,indiegogo/Kiwi,PaulTaykalo/Kiwi,JoistApp/Kiwi,samkrishna/Kiwi,indiegogo/Kiwi,carezone/Kiwi,LiuShulong/Kiwi,unisontech/Kiwi,ashfurrow/Kiwi,weslindsay/Kiwi,iosRookie/Kiwi,depop/Kiwi,TaemoonCho/Kiwi,howandhao/Kiwi,ashfurrow/Kiwi,cookov/Kiwi,tangwei6423471/Kiwi,ecaselles/Kiwi,allending/Kiwi,weslindsay/Kiwi,emodeqidao/Kiwi,alloy/Kiwi,weslindsay/Kiwi,tangwei6423471/Kiwi,PaulTaykalo/Kiwi,PaulTaykalo/Kiwi,TaemoonCho/Kiwi,TaemoonCho/Kiwi,tcirwin/Kiwi,emodeqidao/Kiwi,tangwei6423471/Kiwi,carezone/Kiwi,tonyarnold/Kiwi,depop/Kiwi,iosRookie/Kiwi,unisontech/Kiwi,hyperoslo/Tusen,cookov/Kiwi,indiegogo/Kiwi,weslindsay/Kiwi,cookov/Kiwi,cookov/Kiwi,carezone/Kiwi,tonyarnold/Kiwi,unisontech/Kiwi,depop/Kiwi,allending/Kiwi,JoistApp/Kiwi,hyperoslo/Tusen,samkrishna/Kiwi,samkrishna/Kiwi,ashfurrow/Kiwi,alloy/Kiwi,iosRookie/Kiwi,ecaselles/Kiwi,howandhao/Kiwi,unisontech/Kiwi,emodeqidao/Kiwi,iosRookie/Kiwi,JoistApp/Kiwi,LiuShulong/Kiwi,alloy/Kiwi,emodeqidao/Kiwi,hyperoslo/Tusen,indiegogo/Kiwi,JoistApp/Kiwi,LiuShulong/Kiwi,tcirwin/Kiwi,tonyarnold/Kiwi,tcirwin/Kiwi,tangwei6423471/Kiwi,allending/Kiwi,ecaselles/Kiwi,PaulTaykalo/Kiwi,tcirwin/Kiwi,depop/Kiwi,tonyarnold/Kiwi,hyperoslo/Tusen
a5f492b226f651d8296498f9b412756868b5b333
src/http/resourcestrategy.h
src/http/resourcestrategy.h
#ifndef APIMOCK_RESOURCESTRATEGY_H #define APIMOCK_RESOURCESTRATEGY_H #include "requestdata.h" #include "responsedata.h" namespace ApiMock { class ResourceStrategy { public: virtual ~ResourceStrategy() {} virtual ResponseData CreateResponse(const RequestData& request) = 0; }; } #endif
Add a resource strategy interface
Add a resource strategy interface
C
mit
Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock
d2283df39723e542416a1fcb4fd292780fe690f5
src/qt4compat.h
src/qt4compat.h
#ifndef QT4COMPAT_H #define QT4COMPAT_H #include <QtCore/QtGlobal> #ifndef Q_LIKELY # define Q_LIKELY(s) s #endif #ifndef Q_UNLIKELY # define Q_UNLIKELY(s) s #endif #ifndef Q_UNREACHABLE # define Q_UNREACHABLE() Q_ASSERT(false) #endif #ifndef Q_ASSUME # define Q_ASSUME(s) if (s) {} else { Q_UNREACHABLE(); } #endif #endif // QT4COMPAT_H
#ifndef QT4COMPAT_H #define QT4COMPAT_H #include <QtCore/QtGlobal> #if !defined(Q_UNREACHABLE) && !defined(Q_ASSUME) # if defined(Q_CC_INTEL) || defined(Q_CC_MSVC) # define Q_UNREACHABLE() __assume(0) # define Q_ASSUME(s) __assume(s) # elif defined(Q_CC_CLANG) # define Q_UNREACHABLE() __builtin_unreachable() # elif defined(Q_CC_GNU) && defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 # define Q_UNREACHABLE() __builtin_unreachable() # endif #endif #if !defined(Q_LIKELY) && !defined(Q_UNLIKELY) # ifdef __GNUC__ # define Q_LIKELY(expr) __builtin_expect(!!(expr), true) # define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false) # endif #endif #ifndef Q_LIKELY # define Q_LIKELY(s) s #endif #ifndef Q_UNLIKELY # define Q_UNLIKELY(s) s #endif #ifndef Q_UNREACHABLE # define Q_UNREACHABLE() Q_ASSERT(false) #endif #ifndef Q_ASSUME # define Q_ASSUME(s) if (s) {} else { Q_UNREACHABLE(); } #endif #endif // QT4COMPAT_H
Use compiler detection for Q_LIKELY, Q_UNLIKELY, Q_ASSUME, Q_UNREACHABLE
Use compiler detection for Q_LIKELY, Q_UNLIKELY, Q_ASSUME, Q_UNREACHABLE [ci skip]
C
mit
sjinks/qt_eventdispatcher_epoll,sjinks/qt_eventdispatcher_epoll
6f55e50c181265bae4615173f62f806db75bc33f
src/streampos.h
src/streampos.h
#ifndef ICAL_STREAMPOS_H #define ICAL_STREAMPOS_H namespace ical { /** * Represents a postion in the (source) stream. It is used for constructing * nice error messages. * * Note: only CRLF ("\r\n") is considered as a line ending in order to match * the definition of 'content line' from RFC 5545. */ class StreamPos { private: unsigned long column = 0; unsigned long line = 0; public: unsigned long getLine() const { return line; } unsigned long getColumn() const { return column; } StreamPos() { } void advanceColumn() { ++column; } void advanceLine() { column = 0; ++line; } }; } // namespace ical #endif // ICAL_STREAMPOS_H
#ifndef ICAL_STREAMPOS_H #define ICAL_STREAMPOS_H namespace ical { /** * Represents a postion in the (source) stream. It is used for constructing * nice error messages. * * Note: only CRLF ("\r\n") is considered as a line ending in order to match * the definition of 'content line' from RFC 5545. */ class StreamPos { private: unsigned long column = 0; unsigned long line = 0; public: unsigned long getLine() const { return line + 1; } unsigned long getColumn() const { return column + 1; } StreamPos() { } void advanceColumn() { ++column; } void advanceLine() { column = 0; ++line; } }; } // namespace ical #endif // ICAL_STREAMPOS_H
Return one-based line/column numbers from StreamPos.
Return one-based line/column numbers from StreamPos. (Because obviously people expect "Line 1" to mean the first line...)
C
mit
LuboO/iCalendar-parser_PA193_Rteam
e4953de7dde3021a682d99e05b2784177ebebc93
include/icmpv4.h
include/icmpv4.h
#ifndef ICMPV4_H #define ICMPV4_H #include "syshead.h" #include "netdev.h" #define ICMP_V4_REPLY 0x00 #define ICMP_V4_DST_UNREACHABLE 0x03 #define ICMP_V4_SRC_QUENCH 0x04 #define ICMP_V4_REDIRECT 0x05 #define ICMP_V4_ECHO 0x08 #define ICMP_V4_ROUTER_ADV 0x09 #define ICMP_V4_ROUTER_SOL 0x0a #define ICMP_V4_TIMEOUT 0x0b #define ICMP_V4_MALFORMED 0x0c struct icmp_v4 { uint8_t type; uint8_t code; uint16_t csum; uint8_t data[]; } __attribute__((packed)); struct icmp_v4_echo { uint16_t id; uint16_t seq; uint8_t data[]; } __attribute__((packed)); void icmpv4_incoming(struct netdev *netdev, struct eth_hdr *hdr); void icmpv4_reply(struct netdev *netdev, struct eth_hdr *hdr); #endif
#ifndef ICMPV4_H #define ICMPV4_H #include "syshead.h" #include "netdev.h" #define ICMP_V4_REPLY 0x00 #define ICMP_V4_DST_UNREACHABLE 0x03 #define ICMP_V4_SRC_QUENCH 0x04 #define ICMP_V4_REDIRECT 0x05 #define ICMP_V4_ECHO 0x08 #define ICMP_V4_ROUTER_ADV 0x09 #define ICMP_V4_ROUTER_SOL 0x0a #define ICMP_V4_TIMEOUT 0x0b #define ICMP_V4_MALFORMED 0x0c struct icmp_v4 { uint8_t type; uint8_t code; uint16_t csum; uint8_t data[]; } __attribute__((packed)); struct icmp_v4_echo { uint16_t id; uint16_t seq; uint8_t data[]; } __attribute__((packed)); struct icmp_v4_dst_unreachable { uint8_t unused; uint8_t len; uint16_t var; uint8_t data[]; } __attribute__((packed)); void icmpv4_incoming(struct netdev *netdev, struct eth_hdr *hdr); void icmpv4_reply(struct netdev *netdev, struct eth_hdr *hdr); #endif
Add ICMPv4 dst unreachable -message definition
Add ICMPv4 dst unreachable -message definition Yeah, this might end up being unimplemented :-(
C
mit
saminiir/level-ip,saminiir/level-ip
fc1d23276088fe389f4e804da1b8f071ee3b00f9
src/tool/hpcrun/utilities/arch/aarch64/specific-inline-asm-gctxt.h
src/tool/hpcrun/utilities/arch/aarch64/specific-inline-asm-gctxt.h
#ifndef SPECIFIC_INLINE_ASM_GCTXT #define SPECIFIC_INLINE_ASM_GCTXT #endif
#ifndef SPECIFIC_INLINE_ASM_GCTXT #define SPECIFIC_INLINE_ASM_GCTXT #define INLINE_ASM_GCTXT(uc) getcontext(&uc) #endif
Define the INLINE_ASM_GCTXT() macro for aarch64. This was breaking the MEMLEAK source on arm.
Define the INLINE_ASM_GCTXT() macro for aarch64. This was breaking the MEMLEAK source on arm.
C
bsd-3-clause
HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit,HPCToolkit/hpctoolkit
0cad538ae17f8e05375d1edf1d9f49bb4049e39b
test/Preprocessor/header_lookup1.c
test/Preprocessor/header_lookup1.c
// RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3.*4' #include <stddef.h>
// RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3' #include <stddef.h>
Change this test to reflect the state we are moving in. The Clang builtin headers are no longer going to receive the old 'implicit extern "C" block' semantics. This hint is actually ignored by both Clang and GCC at this point, and Clang's own builtin headers can simply be changed if there is any issue with this. Clang should be free to include these however it wants, and so shorter and simpler is better.
Change this test to reflect the state we are moving in. The Clang builtin headers are no longer going to receive the old 'implicit extern "C" block' semantics. This hint is actually ignored by both Clang and GCC at this point, and Clang's own builtin headers can simply be changed if there is any issue with this. Clang should be free to include these however it wants, and so shorter and simpler is better. Note: *nothing* is changing about the *system* stddef.h include. That should always have the exact same include semantics, whether with Clang or GCC or any other compiler. Only the compiler-builtin header search path is changing. If anyone knows of some risk that this introduces that I've not thought of, please chime in. So far, only Windows has switched to the Brave New World, but others should be switching soon. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@143806 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
ccdd7bb8566b2fd1da5c4b5c8eaa2db43a69e720
testsuite/libffi.go/static-chain.h
testsuite/libffi.go/static-chain.h
#ifdef __aarch64__ # define STATIC_CHAIN_REG "x18" #elif defined(__alpha__) # define STATIC_CHAIN_REG "r1" #elif defined(__arm__) # define STATIC_CHAIN_REG "ip" #elif defined(__sparc__) # if defined(__arch64__) || defined(__sparcv9) # define STATIC_CHAIN_REG "g5" # else # define STATIC_CHAIN_REG "g2" # endif #elif defined(__x86_64__) # define STATIC_CHAIN_REG "r10" #elif defined(__i386__) # ifndef ABI_NUM # define STATIC_CHAIN_REG "ecx" /* FFI_DEFAULT_ABI only */ # endif #endif
#ifdef __aarch64__ # define STATIC_CHAIN_REG "x18" #elif defined(__alpha__) # define STATIC_CHAIN_REG "$1" #elif defined(__arm__) # define STATIC_CHAIN_REG "ip" #elif defined(__sparc__) # if defined(__arch64__) || defined(__sparcv9) # define STATIC_CHAIN_REG "g5" # else # define STATIC_CHAIN_REG "g2" # endif #elif defined(__x86_64__) # define STATIC_CHAIN_REG "r10" #elif defined(__i386__) # ifndef ABI_NUM # define STATIC_CHAIN_REG "ecx" /* FFI_DEFAULT_ABI only */ # endif #endif
Fix alpha static chain register name
testsuite: Fix alpha static chain register name
C
mit
biosbits/libffi,Distrotech/libffi,Distrotech/libffi,joshtriplett/libffi,Pan7/libffi,Pan7/libffi,biosbits/libffi,s1341/libffi,bgarrels/libffi,joshtriplett/libffi,nmav/libffi,rth7680/libffi,joshtriplett/libffi,rth7680/libffi,plicease/libffi,Pan7/libffi,bgarrels/libffi,s1341/libffi,nmav/libffi,biosbits/libffi,joshtriplett/libffi,nmav/libffi,Pan7/libffi,plicease/libffi,bgarrels/libffi,nmav/libffi,rth7680/libffi,Distrotech/libffi,s1341/libffi,plicease/libffi,bgarrels/libffi,s1341/libffi,Distrotech/libffi,plicease/libffi,rth7680/libffi,biosbits/libffi
d4bca385d8d7e068e7d2075131bf14e5bb417692
src/autowiring/stdafx.h
src/autowiring/stdafx.h
// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #pragma once // Internal build flag for namespace discrimination #define AUTOWIRING_IS_BEING_BUILT // Only include these headers in cases where a pch can be generated // Currently this is only supported on MSVC #ifdef _MSC_VER #include <thread> #ifndef NOMINMAX #define NOMINMAX #endif #endif #ifndef _MSC_VER #include <stdlib.h> #endif // Preconfiguration: #include "AutowiringConfig.h" // C++11 glue logic, for platforms that have incomplete C++11 support #include "C++11/cpp11.h"
// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #pragma once // Internal build flag for namespace discrimination #define AUTOWIRING_IS_BEING_BUILT // Only include these headers in cases where a pch can be generated // Currently this is only supported on MSVC #ifdef _MSC_VER #ifndef NOMINMAX #define NOMINMAX #endif #include <algorithm> #include <functional> #include <future> #include <iosfwd> #include <list> #include <map> #include <memory> #include <mutex> #include <queue> #include <set> #include <sstream> #include <string> #include <thread> #include <tuple> #include <type_traits> #include <typeindex> #include <unordered_map> #include <unordered_set> #include <vector> #endif #ifndef _MSC_VER #include <stdlib.h> #endif // Preconfiguration: #include "AutowiringConfig.h" // C++11 glue logic, for platforms that have incomplete C++11 support #include "C++11/cpp11.h"
Make better use of precompiled header
Make better use of precompiled header These headers are used pretty much everywhere in autowiring. New compile time is 50% of what it was on MSVC. Before: 33.87s After: 17.77s
C
apache-2.0
leapmotion/autowiring,leapmotion/autowiring,codemercenary/autowiring,leapmotion/autowiring,leapmotion/autowiring,codemercenary/autowiring,codemercenary/autowiring,codemercenary/autowiring,codemercenary/autowiring,leapmotion/autowiring,leapmotion/autowiring,codemercenary/autowiring