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
0e70a5167953692bb96d0d84e7337ed7f833b0d5
Wangscape/noise/module/codecs/ModuleCodecs.h
Wangscape/noise/module/codecs/ModuleCodecs.h
#pragma once #include "AbsWrapperCodec.h" #include "AddWrapperCodec.h" #include "BillowWrapperCodec.h" #include "BlendWrapperCodec.h" #include "CacheWrapperCodec.h" #include "CheckerboardWrapperCodec.h" #include "ClampWrapperCodec.h" #include "ConstWrapperCodec.h" #include "CornerCombinerBaseWrapperCodec.h" #include "CurveWrapperCodec.h" #include "CylindersWrapperCodec.h" #include "DisplaceWrapperCodec.h" #include "ExpWrapperCodec.h" #include "ExponentWrapperCodec.h" #include "ForwardWrapperCodec.h" #include "InvertWrapperCodec.h" #include "MaxWrapperCodec.h" #include "MinWrapperCodec.h" #include "MultiplyWrapperCodec.h" #include "NormLPQWrapperCodec.h" #include "NoiseSourcesCodec.h" #include "PerlinWrapperCodec.h" #include "PowWrapperCodec.h" #include "PowerWrapperCodec.h" #include "RidgedMultiWrapperCodec.h" #include "RotatePointWrapperCodec.h" #include "ScaleBiasWrapperCodec.h" #include "ScalePointCodec.h" #include "SelectWrapperCodec.h" #include "SpheresWrapperCodec.h" #include "TerraceWrapperCodec.h" #include "TranslatePointWrapperCodec.h" #include "TurbulenceWrapperCodec.h" #include "VoronoiWrapperCodec.h"
#pragma once #include "AbsWrapperCodec.h" #include "AddWrapperCodec.h" #include "BillowWrapperCodec.h" #include "BlendWrapperCodec.h" #include "CacheWrapperCodec.h" #include "CheckerboardWrapperCodec.h" #include "ClampWrapperCodec.h" #include "ConstWrapperCodec.h" #include "CornerCombinerBaseWrapperCodec.h" #include "CurveWrapperCodec.h" #include "CylindersWrapperCodec.h" #include "DisplaceWrapperCodec.h" #include "ExpWrapperCodec.h" #include "ExponentWrapperCodec.h" #include "ForwardWrapperCodec.h" #include "GradientWrapperCodec.h" #include "InvertWrapperCodec.h" #include "MaxWrapperCodec.h" #include "MinWrapperCodec.h" #include "MultiplyWrapperCodec.h" #include "NormLPQWrapperCodec.h" #include "NoiseSourcesCodec.h" #include "PerlinWrapperCodec.h" #include "PowWrapperCodec.h" #include "PowerWrapperCodec.h" #include "RidgedMultiWrapperCodec.h" #include "RotatePointWrapperCodec.h" #include "ScaleBiasWrapperCodec.h" #include "ScalePointCodec.h" #include "SelectWrapperCodec.h" #include "SpheresWrapperCodec.h" #include "TerraceWrapperCodec.h" #include "TranslatePointWrapperCodec.h" #include "TurbulenceWrapperCodec.h" #include "VoronoiWrapperCodec.h"
Add Gradient* codec header to all-codecs header
Add Gradient* codec header to all-codecs header
C
mit
serin-delaunay/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape,serin-delaunay/Wangscape
dbdcd34d8dfea30fcfcbb176db89e2a14f88eabc
webkit/glue/webkit_constants.h
webkit/glue/webkit_constants.h
// Copyright (c) 2011 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 WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ #define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ namespace webkit_glue { // Chromium sets the minimum interval timeout to 4ms, overriding the // default of 10ms. We'd like to go lower, however there are poorly // coded websites out there which do create CPU-spinning loops. Using // 4ms prevents the CPU from spinning too busily and provides a balance // between CPU spinning and the smallest possible interval timer. const double kForegroundTabTimerInterval = 0.004; // Provides control over the minimum timer interval for background tabs. const double kBackgroundTabTimerInterval = 1.0; } // namespace webkit_glue #endif // WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
// Copyright (c) 2011 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 WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ #define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ namespace webkit_glue { // Chromium sets the minimum interval timeout to 4ms, overriding the // default of 10ms. We'd like to go lower, however there are poorly // coded websites out there which do create CPU-spinning loops. Using // 4ms prevents the CPU from spinning too busily and provides a balance // between CPU spinning and the smallest possible interval timer. const double kForegroundTabTimerInterval = 0.004; // Provides control over the minimum timer interval for background tabs. const double kBackgroundTabTimerInterval = 0.004; } // namespace webkit_glue #endif // WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
Revert 75430 because it's causing failures in dom_checker_tests. : Increase the minimum interval for timers on background tabs to reduce their CPU consumption.
Revert 75430 because it's causing failures in dom_checker_tests. : Increase the minimum interval for timers on background tabs to reduce their CPU consumption. The new interval is 1000 ms, or once per second. We can easily adjust this value up or down, but this seems like a reasonable value to judge the compatibility impact of this change. BUG=66078 TEST=none (tested manually with minimal test case) Review URL: http://codereview.chromium.org/6546021 [email protected] Review URL: http://codereview.chromium.org/6538073 git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@75490 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
48604212f8046625c0392b53b65d5f8440ae35e8
src/test_interface.c
src/test_interface.c
#include <stdio.h> #include "decode.h" #include "event_detection.h" #include "fast5_interface.h" #include "homopolymer.h" #include "kseq.h" #include "layers.h" #include "networks.h" #include "nnfeatures.h" #include "scrappie_common.h" #include "scrappie_licence.h" #include "scrappie_matrix.h" #include "scrappie_seq_helpers.h" #include "scrappie_stdlib.h" #include "scrappie_structures.h" #include "scrappie_subcommands.h" #include "sse_mathfun.h" #include "util.h" #include "../python/pyscrap.h" int main(void){ return EXIT_SUCCESS; }
#include <stdio.h> #include "decode.h" #include "event_detection.h" #include "fast5_interface.h" #include "homopolymer.h" #include "kseq.h" #include "layers.h" #include "networks.h" #include "nnfeatures.h" #include "scrappie_common.h" #include "scrappie_matrix.h" #include "scrappie_seq_helpers.h" #include "scrappie_stdlib.h" #include "scrappie_structures.h" #include "scrappie_subcommands.h" #include "sse_mathfun.h" #include "util.h" #include "../python/pyscrap.h" int main(void){ return EXIT_SUCCESS; }
Remove licence from interface test
Remove licence from interface test
C
mpl-2.0
nanoporetech/scrappie,nanoporetech/scrappie,nanoporetech/scrappie
2d3728610e716835f1d54606dee0f7c5cb404f66
backend/tests/grouter/openflow_flowtable_t.c
backend/tests/grouter/openflow_flowtable_t.c
#include "openflow_flowtable.h" #include "mut.h" #include <stdint.h> #include "common_def.h" extern void openflow_flowtable_set_defaults(void); extern uint8_t openflow_flowtable_ip_compare(uint32_t ip_1, uint32_t ip_2, uint8_t ip_len); TESTSUITE_BEGIN TEST_BEGIN("Flowtable Modification") openflow_flowtable_init(); ofp_flow_mod mod; uint16_t error_code, error_type; mod.flags = OFPFF_SEND_FLOW_REM; mod.command = OFPFC_ADD; mod.match.wildcards = OFPFW_ALL; mod.out_port = OFPP_NONE; openflow_flowtable_modify(&mod, &error_type, &error_code); openflow_flowtable_release(); TEST_END TESTSUITE_END
#include "openflow_flowtable.h" #include "mut.h" #include <stdint.h> #include "common_def.h" extern void openflow_flowtable_set_defaults(void); extern uint8_t openflow_flowtable_ip_compare(uint32_t ip_1, uint32_t ip_2, uint8_t ip_len); TESTSUITE_BEGIN TEST_BEGIN("Flowtable Modification") openflow_flowtable_init(); ofp_flow_mod mod; uint16_t error_code, error_type; memset(&mod, 0, sizeof(ofp_flow_mod)); mod.flags = htons(OFPFF_SEND_FLOW_REM); mod.command = htons(OFPFC_ADD); mod.match.wildcards = htons(OFPFW_ALL); mod.out_port = htons(OFPP_NONE); mod.header.length = htons(0); mod.priority = htons(19); openflow_flowtable_modify(&mod, &error_type, &error_code); openflow_flowtable_release(); TEST_END TESTSUITE_END
Clean up test, use proper structuring functions
Clean up test, use proper structuring functions
C
mit
anrl/gini3,anrl/gini3,anrl/gini3,anrl/gini3,michaelkourlas/gini,michaelkourlas/gini,anrl/gini3,michaelkourlas/gini,michaelkourlas/gini,michaelkourlas/gini
2a608956279a2bc37c762f3f2b5e20ee38b1f43c
ui/reflectionview.h
ui/reflectionview.h
#pragma once #include <QtGui/QMouseEvent> #include <QtGui/QPaintEvent> #include <QtWidgets/QWidget> #include "binaryninjaapi.h" #include "dockhandler.h" #include "uitypes.h" class ContextMenuManager; class DisassemblyContainer; class Menu; class ViewFrame; class BINARYNINJAUIAPI ReflectionView: public QWidget, public DockContextHandler { Q_OBJECT Q_INTERFACES(DockContextHandler) ViewFrame* m_frame; BinaryViewRef m_data; DisassemblyContainer* m_disassemblyContainer; public: ReflectionView(ViewFrame* frame, BinaryViewRef data); ~ReflectionView(); virtual void notifyViewLocationChanged(View* view, const ViewLocation& viewLocation) override; virtual void notifyVisibilityChanged(bool visible) override; virtual bool shouldBeVisible(ViewFrame* frame) override; protected: virtual void contextMenuEvent(QContextMenuEvent* event) override; };
#pragma once #include <QtGui/QMouseEvent> #include <QtGui/QPaintEvent> #include <QtWidgets/QWidget> #include "binaryninjaapi.h" #include "dockhandler.h" #include "uitypes.h" class ContextMenuManager; class DisassemblyContainer; class Menu; class ViewFrame; class BINARYNINJAUIAPI ReflectionView: public QWidget, public DockContextHandler { Q_OBJECT Q_INTERFACES(DockContextHandler) ViewFrame* m_frame; BinaryViewRef m_data; DisassemblyContainer* m_disassemblyContainer; std::map<BNFunctionGraphType, BNFunctionGraphType> m_ilMap; bool m_ilSync; bool m_locationSync; public: ReflectionView(ViewFrame* frame, BinaryViewRef data); ~ReflectionView(); void toggleILSync(); void toggleLocationSync(); virtual void notifyViewLocationChanged(View* view, const ViewLocation& viewLocation) override; virtual void notifyVisibilityChanged(bool visible) override; virtual bool shouldBeVisible(ViewFrame* frame) override; protected: virtual void contextMenuEvent(QContextMenuEvent* event) override; };
Add some synchronization modes to reflection view along with a context menu.
Add some synchronization modes to reflection view along with a context menu.
C
mit
Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api
2137ddf9dc59273c6444330246fd1c2c34586679
driver/driver.c
driver/driver.c
/* * driver - driver for loading mruby source code */ #include <stdio.h> #include "mruby.h" #include "mruby/compile.h" #include "mruby/irep.h" /* The generated mruby bytecodes are stored in this array */ extern const char app_irep[]; int webruby_internal_run(mrb_state* mrb) { mrb_load_irep(mrb, app_irep); return (mrb->exc == NULL) ? (0) : (1); } int webruby_internal_run_bytecode(mrb_state* mrb, const char *bc) { mrb_load_irep(mrb, bc); return (mrb->exc == NULL) ? (0) : (1); } int webruby_internal_run_source(mrb_state* mrb, const char *s) { mrb_load_string(mrb, s); return (mrb->exc == NULL) ? (0) : (1); }
/* * driver - driver for loading mruby source code */ #include <stdio.h> #include "mruby.h" #include "mruby/compile.h" #include "mruby/irep.h" /* The generated mruby bytecodes are stored in this array */ extern const char app_irep[]; static int check_and_print_errors(mrb_state* mrb) { if (mrb->exc) { mrb_p(mrb, mrb_obj_value(mrb->exc)); return 1; } return 0; } int webruby_internal_run(mrb_state* mrb) { mrb_load_irep(mrb, app_irep); return check_and_print_errors(mrb); } int webruby_internal_run_bytecode(mrb_state* mrb, const char *bc) { mrb_load_irep(mrb, bc); return check_and_print_errors(mrb); } int webruby_internal_run_source(mrb_state* mrb, const char *s) { mrb_load_string(mrb, s); return check_and_print_errors(mrb); }
Print exceptions to console if exist.
Print exceptions to console if exist.
C
mit
sadasant/webruby,sadasant/webruby,xxuejie/webruby,xxuejie/webruby
7df596443ac992039d239aa34212ff83943f6d7f
test/time-test.c
test/time-test.c
#include <stdlib.h> #include <time.h> #include <detest/detest.h> #include <disco/time.h> void test_zero_milliseconds_to_timeval() { size_t milliseconds = 0; struct timeval t = milliseconds_to_timeval(milliseconds); expect(t.tv_sec == 0 && t.tv_usec == 0); } void test_one_millisecond_to_timeval() { size_t milliseconds = 1; struct timeval t = milliseconds_to_timeval(milliseconds); expect(t.tv_sec == 0 && t.tv_usec == 1000); } void test_one_thousand_milliseconds_to_timeval() { size_t milliseconds = 1000; struct timeval t = milliseconds_to_timeval(milliseconds); expect(t.tv_sec == 1 && t.tv_usec == 0); } int main() { add_test(test_zero_milliseconds_to_timeval); add_test(test_one_millisecond_to_timeval); add_test(test_one_thousand_milliseconds_to_timeval); return run_tests(); }
#include <stdlib.h> #include <time.h> #include <detest/detest.h> #include <disco/time.h> void test_zero_milliseconds_to_timeval() { size_t milliseconds = 0; struct timeval t = milliseconds_to_timeval(milliseconds); expect(t.tv_sec == 0 && t.tv_usec == 0); } void test_one_millisecond_to_timeval() { size_t milliseconds = 1; struct timeval t = milliseconds_to_timeval(milliseconds); expect(t.tv_sec == 0 && t.tv_usec == 1000); } void test_one_thousand_milliseconds_to_timeval() { size_t milliseconds = 1000; struct timeval t = milliseconds_to_timeval(milliseconds); expect(t.tv_sec == 1 && t.tv_usec == 0); } void test_one_thousand_and_one_milliseconds_to_timeval() { size_t milliseconds = 1001; struct timeval t = milliseconds_to_timeval(milliseconds); expect(t.tv_sec == 1 && t.tv_usec == 1000); } int main() { add_test(test_zero_milliseconds_to_timeval); add_test(test_one_millisecond_to_timeval); add_test(test_one_thousand_milliseconds_to_timeval); add_test(test_one_thousand_and_one_milliseconds_to_timeval); return run_tests(); }
Add milliseconds to timeval test
Add milliseconds to timeval test
C
unlicense
mmurdoch/disco,mmurdoch/disco
574f35bfae6ea591603ead5a8a7db2154058ca6d
firmware/greatfet_usb/usb_api_dac.c
firmware/greatfet_usb/usb_api_dac.c
/* * This file is part of GreatFET */ #include "usb_api_dac.h" #include "usb.h" #include "usb_queue.h" #include "usb_endpoint.h" #include <stddef.h> #include <greatfet_core.h> #include <dac.h> #include <pins_greatfet.h> usb_request_status_t usb_vendor_request_dac_set( usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) { usb_endpoint_init(&usb0_endpoint_bulk_in); if (stage == USB_TRANSFER_STAGE_SETUP) { // set J2_P5 up as a DAC pin scu_pinmux(SCU_PINMUX_GPIO2_3, SCU_GPIO_FAST | SCU_GPIO_PUP | SCU_CONF_FUNCTION0); static struct gpio_t dac_pin = GPIO(2, 3); gpio_input(&dac_pin); DAC_CR = DAC_CR_VALUE(endpoint->setup.value); DAC_CTRL = DAC_CTRL_DMA_ENA(1); usb_transfer_schedule_ack(endpoint->in); } return USB_REQUEST_STATUS_OK; }
/* * This file is part of GreatFET */ #include "usb_api_dac.h" #include "usb.h" #include "usb_queue.h" #include "usb_endpoint.h" #include <stddef.h> #include <greatfet_core.h> #include <dac.h> #include <pins.h> usb_request_status_t usb_vendor_request_dac_set( usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) { usb_endpoint_init(&usb0_endpoint_bulk_in); if (stage == USB_TRANSFER_STAGE_SETUP) { // set J2_P5 up as a DAC pin scu_pinmux(SCU_PINMUX_GPIO2_3, SCU_GPIO_FAST | SCU_GPIO_PUP | SCU_CONF_FUNCTION0); static struct gpio_t dac_pin = GPIO(2, 3); gpio_input(&dac_pin); DAC_CR = DAC_CR_VALUE(endpoint->setup.value) && DAC_CR_VALUE_MASK; DAC_CTRL = DAC_CTRL_DMA_ENA(1); usb_transfer_schedule_ack(endpoint->in); } return USB_REQUEST_STATUS_OK; }
Fix wrong pins header from being included, add mask to DAC control register
Fix wrong pins header from being included, add mask to DAC control register
C
bsd-3-clause
dominicgs/GreatFET-experimental,greatscottgadgets/greatfet,greatscottgadgets/greatfet,greatscottgadgets/greatfet,greatscottgadgets/greatfet,dominicgs/GreatFET-experimental,dominicgs/GreatFET-experimental
21e21481fc3887bf87731c045e72e5a4b78ec2d7
lib/image/pgm.c
lib/image/pgm.c
#include "image.h" #include <inttypes.h> static unsigned char* read_pgm(const char* filename, size_t* width, size_t* height, size_t* nimages) { *nimages = 1; unsigned char* image = NULL; FILE* f = strcmp(filename,"-") ? fopen(filename,"r") : stdin; uint16_t depth; if( f && fscanf(f,"P5 %zu %zu %" PRIu16,width,height,&depth) == 3 && fgetc(f) != EOF && depth < 256 && *width && *height && !(*width > PIXEL_MAX / *height) && (image = malloc(*width * *height)) && fread(image,1,*width * *height,f) == *width * *height ) return image; free(image); return NULL; } struct image_reader resdet_image_reader_pgm = { .read = read_pgm };
#include "image.h" #include <inttypes.h> static unsigned char* read_pgm(const char* filename, size_t* width, size_t* height, size_t* nimages) { *nimages = 1; unsigned char* image = NULL; FILE* f = strcmp(filename,"-") ? fopen(filename,"r") : stdin; uint16_t depth; if( f && fscanf(f,"P5 %zu %zu %" SCNu16,width,height,&depth) == 3 && fgetc(f) != EOF && depth < 256 && *width && *height && !(*width > PIXEL_MAX / *height) && (image = malloc(*width * *height)) && fread(image,1,*width * *height,f) == *width * *height ) return image; free(image); return NULL; } struct image_reader resdet_image_reader_pgm = { .read = read_pgm };
Use proper u16 macro for scanf
Use proper u16 macro for scanf The PRIu16 macro only guarantees that the resulting conversion specifier will be suitable for printing, not scanning. SCNu16 provides the appropriate specifier for the latter. Some libcs define PRIu16 to just "%u" rather than defining both as "%hu", which is makes sense but results in undefined behavior when used with scanf.
C
lgpl-2.1
0x09/resdet,0x09/resdet,0x09/resdet,0x09/resdet
72e5c6bb8c0df5b6b0812155474065b30f9e95e2
firmware/BlynkWidgets.h
firmware/BlynkWidgets.h
/** * @file BlynkWidgets.h * @author Volodymyr Shymanskyy * @license This project is released under the MIT License (MIT) * @copyright Copyright (c) 2015 Volodymyr Shymanskyy * @date Mar 2015 * @brief */ #include "WidgetLED.h" #include "WidgetLCD.h" //#include <WidgetTerminal.h> // No Print.h on Spark? #include "WidgetBridge.h" // Cannot auto-include WidgetSD, as it has library dependency
/** * @file BlynkWidgets.h * @author Volodymyr Shymanskyy * @license This project is released under the MIT License (MIT) * @copyright Copyright (c) 2015 Volodymyr Shymanskyy * @date Mar 2015 * @brief */ #include "WidgetLED.h" #include "WidgetLCD.h" #include "WidgetTerminal.h" #include "WidgetBridge.h" // Cannot auto-include WidgetSD, as it has library dependency
Add terminal to common widgets
Add terminal to common widgets
C
mit
vshymanskyy/blynk-library-spark,domo-connect/blynk-library-spark,yaneexy/blynk-library-spark,vshymanskyy/blynk-library-spark,domo-connect/blynk-library-spark,yaneexy/blynk-library-spark,chieftuscan/blynk-library-spark,chieftuscan/blynk-library-spark
98e6747307ff09935766012ec715e8161722c069
numpy/core/src/multiarray/buffer.h
numpy/core/src/multiarray/buffer.h
#ifndef _NPY_PRIVATE_BUFFER_H_ #define _NPY_PRIVATE_BUFFER_H_ #ifdef NPY_ENABLE_MULTIPLE_COMPILATION extern NPY_NO_EXPORT PyBufferProcs array_as_buffer; #else NPY_NO_EXPORT PyBufferProcs array_as_buffer; #endif #endif
#ifndef _NPY_PRIVATE_BUFFER_H_ #define _NPY_PRIVATE_BUFFER_H_ #ifdef NPY_ENABLE_SEPARATE_COMPILATION extern NPY_NO_EXPORT PyBufferProcs array_as_buffer; #else NPY_NO_EXPORT PyBufferProcs array_as_buffer; #endif #endif
Fix mispelled separate compilation macro.
Fix mispelled separate compilation macro. git-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@6965 94b884b6-d6fd-0310-90d3-974f1d3f35e1
C
bsd-3-clause
Ademan/NumPy-GSoC,efiring/numpy-work,efiring/numpy-work,teoliphant/numpy-refactor,chadnetzer/numpy-gaurdro,efiring/numpy-work,teoliphant/numpy-refactor,teoliphant/numpy-refactor,teoliphant/numpy-refactor,Ademan/NumPy-GSoC,Ademan/NumPy-GSoC,illume/numpy3k,illume/numpy3k,Ademan/NumPy-GSoC,chadnetzer/numpy-gaurdro,illume/numpy3k,jasonmccampbell/numpy-refactor-sprint,chadnetzer/numpy-gaurdro,jasonmccampbell/numpy-refactor-sprint,efiring/numpy-work,jasonmccampbell/numpy-refactor-sprint,jasonmccampbell/numpy-refactor-sprint,chadnetzer/numpy-gaurdro,teoliphant/numpy-refactor,illume/numpy3k
ed0f3ad3cc2fb70eabdd0d8dc09936d51c18639c
Classes/Statistics.h
Classes/Statistics.h
/* Copyright (c) 2008, Stig Brautaset. 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 author 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 OWNER 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. */ #import <Statistics/SBStatistics.h>
/* Copyright (c) 2008, Stig Brautaset. 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 author 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 OWNER 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. */ #import "SBStatistics.h"
Fix for include path slighlty incorrect
Fix for include path slighlty incorrect
C
bsd-3-clause
aug2uag/Statistics
af7e443cb2e40a8c5c3886cf7c37c9a762eaf3b2
source/common/game_state_manager_base.h
source/common/game_state_manager_base.h
/* The Halfling Project - A Graphics Engine and Projects * * The Halfling Project is the legal property of Adrian Astley * Copyright Adrian Astley 2013 */ #ifndef GAME_STATE_MANAGER_H #define GAME_STATE_MANAGER_H namespace Common { class GameStateManagerBase { public: virtual bool Initialize() = 0; virtual void Shutdown() = 0; /** * Return the wanted period of time between update() calls. * * IE: If you want update to be called 20 times a second, this * should return 50. * * NOTE: This should probably be inlined. * NOTE: This will only be called at the beginning of HalflingEngine::Run() * TODO: Contemplate the cost/benefit of calling this once per frame * * @return The period in milliseconds */ virtual double GetUpdatePeriod() = 0; /** * Called every time the game logic should be updated. The frequency * of this being called is determined by getUpdatePeriod() */ virtual void Update() = 0; virtual void GamePaused() = 0; virtual void GameUnpaused() = 0; }; } // End of namespace Common #endif
/* The Halfling Project - A Graphics Engine and Projects * * The Halfling Project is the legal property of Adrian Astley * Copyright Adrian Astley 2013 */ #ifndef GAME_STATE_MANAGER_H #define GAME_STATE_MANAGER_H namespace Common { class GameStateManagerBase { public: virtual bool Initialize() = 0; virtual void Shutdown() = 0; /** * Return the wanted period of time between update() calls. * * IE: If you want update to be called 20 times a second, this * should return 50. * * NOTE: This should probably be inlined. * NOTE: This will only be called at the beginning of HalflingEngine::Run() * TODO: Contemplate the cost/benefit of calling this once per frame * * @return The period in milliseconds */ virtual double GetUpdatePeriod() = 0; /** * Called every time the game logic should be updated. The frequency * of this being called is determined by getUpdatePeriod() */ virtual void Update() = 0; virtual void OnResize(int newClientWidth, int newClientHeight) = 0; virtual void GamePaused() = 0; virtual void GameUnpaused() = 0; virtual void MouseDown(WPARAM buttonState, int x, int y) = 0; virtual void MouseUp(WPARAM buttonState, int x, int y) = 0; virtual void MouseMove(WPARAM buttonState, int x, int y) = 0; virtual void MouseWheel(int zDelta) = 0; }; } // End of namespace Common #endif
Add virtual functions to handle mouse movments and Resize
COMMON: Add virtual functions to handle mouse movments and Resize
C
apache-2.0
RichieSams/thehalflingproject,RichieSams/thehalflingproject,RichieSams/thehalflingproject
45aaeef14a06f927c8ebcd31a36c97f180087a1f
include/rapidcheck/Classify.h
include/rapidcheck/Classify.h
#pragma once /// Tags the current test case if the specified condition is true. If any tags /// are specified after the condition, those will be used. Otherwise, a string /// version of the condition itself will be used as the tag. #define RC_CLASSIFY(condition, ...) \ do { \ if (condition) { \ detail::classify(#condition, {__VA_ARGS__}); \ } \ } while (false) /// Tags the current test case with the given values which will be converted to /// strings. #define RC_TAG(...) detail::tag({__VA_ARGS__}) #include "Classify.hpp"
#pragma once /// Tags the current test case if the specified condition is true. If any tags /// are specified after the condition, those will be used. Otherwise, a string /// version of the condition itself will be used as the tag. #define RC_CLASSIFY(condition, ...) \ do { \ if (condition) { \ ::rc::detail::classify(#condition, {__VA_ARGS__}); \ } \ } while (false) /// Tags the current test case with the given values which will be converted to /// strings. #define RC_TAG(...) ::rc::detail::tag({__VA_ARGS__}) #include "Classify.hpp"
Fix missing namespace qualification in classify macros
Fix missing namespace qualification in classify macros
C
bsd-2-clause
emil-e/rapidcheck,unapiedra/rapidfuzz,emil-e/rapidcheck,emil-e/rapidcheck,unapiedra/rapidfuzz,tm604/rapidcheck,whoshuu/rapidcheck,unapiedra/rapidfuzz,tm604/rapidcheck,whoshuu/rapidcheck,whoshuu/rapidcheck,tm604/rapidcheck
c0bfe92bc801e451e746c8eb8b36d26cb669aa28
src/polyChecksum.h
src/polyChecksum.h
/** Copyright (c) 2017 Ryan Porter You may use, distribute, or modify this code under the terms of the MIT license. */ #ifndef POLY_CHECKSUM_H #define POLY_CHECKSUM_H // based on code found at http://www.relisoft.com/science/CrcOptim.html class PolyChecksum { public: PolyChecksum(); virtual void putBytes(void* bytes, size_t dataSize); virtual int getResult(); public: unsigned long _table[256]; unsigned long _register = 0; unsigned long _key = 0x04c11db7; }; #endif
/** Copyright (c) 2017 Ryan Porter You may use, distribute, or modify this code under the terms of the MIT license. */ #ifndef POLY_CHECKSUM_H #define POLY_CHECKSUM_H #include <cstddef> // based on code found at http://www.relisoft.com/science/CrcOptim.html class PolyChecksum { public: PolyChecksum(); virtual void putBytes(void* bytes, size_t dataSize); virtual int getResult(); public: unsigned long _table[256]; unsigned long _register = 0; unsigned long _key = 0x04c11db7; }; #endif
Add include required to compile on linux.
Add include required to compile on linux.
C
mit
yantor3d/polySymmetry,yantor3d/polySymmetry
f8f561cce68c06ccf63d1ba9e3503c230daf0f8b
src/input.c
src/input.c
#include "input.h" #include "command.h" TreeNode curNode; char curPlane, extra; void initializeInput() { initializeCommands(); curPlane = 0; } void handleInput(char ch, AtcsoData *data, WINDOW *msgWin) { if (!curPlane) { if (ch >= 'a' && ch <= 'z') { curPlane = ch; curNode = commands; waddch(msgWin, ch); waddch(msgWin, ':'); wrefresh(msgWin); } } else if (ch == '\n') { if (curNode.func) { (*curNode.func)(data, curPlane, extra); curPlane = 0; werase(msgWin); wrefresh(msgWin); } } else { extra = '\0'; if (ch >= '0' && ch <= '9') { extra = ch; ch = '#'; } for (int i = 0; i < curNode.nChildren; ++i) { if (curNode.children[i].hotkey == ch) { curNode = curNode.children[i]; waddch(msgWin, ' '); if (extra) { wprintw(msgWin, curNode.str, extra); } else { waddstr(msgWin, curNode.str); } wrefresh(msgWin); break; } } } }
#include "input.h" #include "command.h" TreeNode curNode; char curPlane, extra; void initializeInput() { initializeCommands(); curPlane = 0; } void handleInput(char ch, AtcsoData *data, WINDOW *msgWin) { if (!curPlane) { if (ch >= 'a' && ch <= 'z') { curPlane = ch; curNode = commands; waddch(msgWin, ch); waddch(msgWin, ':'); wrefresh(msgWin); } } else if (ch == '\n') { if (curNode.func) { (*curNode.func)(data, curPlane, extra); curPlane = 0; werase(msgWin); wrefresh(msgWin); } } else { extra = ch; if (ch >= '0' && ch <= '9') ch = '#'; for (int i = 0; i < curNode.nChildren; ++i) { if (curNode.children[i].hotkey == ch) { curNode = curNode.children[i]; waddch(msgWin, ' '); if (ch == '#') { wprintw(msgWin, curNode.str, extra); } else { waddstr(msgWin, curNode.str); } wrefresh(msgWin); break; } } } }
Fix bizarre bug in "altitude [climb|descend]"
Fix bizarre bug in "altitude [climb|descend]" Climb was descending, and descend was climbing. Turns out it's because they were trying to climb/descend... newline amount. O_o
C
mit
KeyboardFire/atcso
f66be80aa2aedddf20d62cdaeb613cf26037ff11
src/nsafepass.c
src/nsafepass.c
#include <stdio.h> #include <config.h> int main(void) { puts("This is " PACKAGE_STRING); return 0; }
/* This file is part of nsafepass Copyright 2015 Sergey Kvachonok nsafepass is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. */ #include <stdio.h> #include <config.h> int main(void) { puts("This is " PACKAGE_STRING); return 0; }
Add AGPLv3 legalese boilerplate to the source files.
Add AGPLv3 legalese boilerplate to the source files. Use the shortened version because nobody really cares about warranties and liabilities.
C
agpl-3.0
ravenexp/nsafepass,ravenexp/nsafepass
35bd31f2613bd766b89ad94cbaf1c7b10791bbe5
tests/padfactory.c
tests/padfactory.c
#include <gst/gst.h> static GstCapsFactory mpeg2dec_sink_caps = { "mpeg2deccaps", "video/mpeg", "mpegtype", GST_PROPS_LIST ( GST_PROPS_INT(1), GST_PROPS_INT(2) ), NULL }; static GstCapsFactory mpeg2dec_src_caps = { "name", "video/raw", "fourcc", GST_PROPS_LIST ( GST_PROPS_FOURCC ('Y','V','1','2'), GST_PROPS_FOURCC_INT (0x56595559) ), "width", GST_PROPS_INT_RANGE (16, 4096), "height", GST_PROPS_INT_RANGE (16, 4096), NULL }; static GstCapsFactory raw_sink_caps = { NULL }; static GstPadFactory pad_caps = { "src", GST_PAD_FACTORY_SRC, GST_PAD_FACTORY_ALWAYS, GST_PAD_FACTORY_CAPS ( "videocaps", "video/raw", "fourcc", GST_PROPS_LIST ( GST_PROPS_FOURCC_INT (0x32315659), GST_PROPS_FOURCC ('Y','U','Y','V') ), "height", GST_PROPS_INT_RANGE (16, 4096) ), GST_PAD_FACTORY_CAPS ( "videocaps2", "video/raw", "fourcc", GST_PROPS_LIST ( GST_PROPS_FOURCC_INT (0x32315659) ), "height", GST_PROPS_INT_RANGE (16, 256) ), NULL }; static GstCaps *sinkcaps = NULL, *rawcaps = NULL; static GstPadTemplate *temp; int main(int argc,char *argv[]) { gboolean testret; xmlDocPtr doc; xmlNodePtr parent; doc = xmlNewDoc ("1.0"); doc->root = xmlNewDocNode (doc, NULL, "Capabilities", NULL); _gst_type_initialize (); sinkcaps = gst_caps_register (&mpeg2dec_sink_caps); parent = xmlNewChild (doc->root, NULL, "Capabilities1", NULL); gst_caps_save_thyself (sinkcaps, parent); rawcaps = gst_caps_register (&mpeg2dec_src_caps); parent = xmlNewChild (doc->root, NULL, "Capabilities2", NULL); gst_caps_save_thyself (rawcaps, parent); temp = gst_padtemplate_new (&pad_caps); parent = xmlNewChild (doc->root, NULL, "Padtemplate", NULL); gst_padtemplate_save_thyself (temp, parent); xmlDocDump(stdout, doc); return 0; }
Test program for the pad factory
Test program for the pad factory Original commit message from CVS: Test program for the pad factory
C
lgpl-2.1
surround-io/gstreamer,krieger-od/gstreamer,centricular/gstreamer,ylatuya/gstreamer,cablelabs/gstreamer,magcius/gstreamer,krieger-od/gstreamer,Lachann/gstreamer,collects/gstreamer,ahmedammar/platform_external_gst_gstreamer,surround-io/gstreamer,jpakkane/gstreamer,Lachann/gstreamer,collects/gstreamer,Distrotech/gstreamer,krichter722/gstreamer,StreamUtils/gstreamer,Distrotech/gstreamer,mparis/gstreamer,lovebug356/gstreamer,Distrotech/gstreamer,jpxiong/gstreamer,justinjoy/gstreamer,mparis/gstreamer,ahmedammar/platform_external_gst_gstreamer,lubosz/gstreamer,shelsonjava/gstreamer,krichter722/gstreamer,jpakkane/gstreamer,ylatuya/gstreamer,StreamUtils/gstreamer,ensonic/gstreamer,cfoch/gstreamer,mparis/gstreamer,jpxiong/gstreamer,drothlis/gstreamer,drothlis/gstreamer,surround-io/gstreamer,lubosz/gstreamer,ensonic/gstreamer,collects/gstreamer,cablelabs/gstreamer,Lachann/gstreamer,collects/gstreamer,jpakkane/gstreamer,ahmedammar/platform_external_gst_gstreamer,krieger-od/gstreamer,surround-io/gstreamer,lovebug356/gstreamer,mrchapp/gstreamer,justinjoy/gstreamer,jpxiong/gstreamer,magcius/gstreamer,justinjoy/gstreamer,justinjoy/gstreamer,magcius/gstreamer,magcius/gstreamer,krichter722/gstreamer,lubosz/gstreamer,Lachann/gstreamer,StreamUtils/gstreamer,collects/gstreamer,ensonic/gstreamer,mrchapp/gstreamer,cfoch/gstreamer,lovebug356/gstreamer,drothlis/gstreamer,ylatuya/gstreamer,shelsonjava/gstreamer,ylatuya/gstreamer,lovebug356/gstreamer,cablelabs/gstreamer,mparis/gstreamer,Distrotech/gstreamer,ahmedammar/platform_external_gst_gstreamer,shelsonjava/gstreamer,StreamUtils/gstreamer,ylatuya/gstreamer,jpxiong/gstreamer,ensonic/gstreamer,shelsonjava/gstreamer,krieger-od/gstreamer,krieger-od/gstreamer,mparis/gstreamer,cfoch/gstreamer,centricular/gstreamer,ahmedammar/platform_external_gst_gstreamer,krichter722/gstreamer,cablelabs/gstreamer,justinjoy/gstreamer,StreamUtils/gstreamer,mrchapp/gstreamer,shelsonjava/gstreamer,centricular/gstreamer,ensonic/gstreamer,mrchapp/gstreamer,centricular/gstreamer,centricular/gstreamer,Distrotech/gstreamer,jpakkane/gstreamer,lovebug356/gstreamer,cfoch/gstreamer,cfoch/gstreamer,jpakkane/gstreamer,lubosz/gstreamer,mrchapp/gstreamer,jpxiong/gstreamer,surround-io/gstreamer,drothlis/gstreamer,Lachann/gstreamer,krichter722/gstreamer,cablelabs/gstreamer,lubosz/gstreamer,drothlis/gstreamer,magcius/gstreamer
63bd713f7609ffb72b8592b772ef525224e6ffdf
test/mocks/Servo.h
test/mocks/Servo.h
/** * Servo "mock" class. Ideally our ServoMotor class would be using composition * to become an (Arduino) Servo motor. However, we want to make usage easier and * transparent to the user, so we are extending the Arduino Servo class. * The inheritance instead of composition makes things a little bit trickier * to mock and that is why we need a stub implementation of `Servo` that can get * injected with the mock which in turn we can set our expectations upon. */ #pragma once #include <memory> #include <stdexcept> #include <stdint.h> #include "gmock/gmock.h" class MockServo { public: MOCK_METHOD3(attach, void(uint8_t pin, int maxPulseLength, int minPulseLength)); MOCK_METHOD1(writeMicroseconds, void(int microseconds)); }; class Servo { public: void attach(uint8_t pin, int maxPulseLength, int minPulseLength) { if (!mMockServo) { throw std::logic_error("No mockServo attached! Please set the mMockServo with a MockServo shared pointer."); } mMockServo->attach(pin, maxPulseLength, minPulseLength); } void writeMicroseconds(int microseconds) { if (!mMockServo) { throw std::logic_error("No mockServo attached! Please set the mMockServo with a MockServo shared pointer."); } mMockServo->writeMicroseconds(microseconds); } std::shared_ptr<MockServo> mMockServo; };
/** * Servo "mock" class. Ideally our ServoMotor class would be using composition * to become an (Arduino) Servo motor. However, we want to make usage easier and * transparent to the user, so we are extending the Arduino Servo class. * The inheritance instead of composition makes things a little bit trickier * to mock and that is why we need a stub implementation of `Servo` that can get * injected with the mock which in turn we can set our expectations upon. */ #pragma once #include <memory> #include <stdexcept> #include <stdint.h> #include "gmock/gmock.h" class MockServo { public: MOCK_METHOD3(attach, void(uint8_t pin, int maxPulseLength, int minPulseLength)); MOCK_METHOD1(writeMicroseconds, void(int microseconds)); }; class Servo { public: void attach(uint8_t pin, int maxPulseLength, int minPulseLength) { mMockServo->attach(pin, maxPulseLength, minPulseLength); } void writeMicroseconds(int microseconds) { mMockServo->writeMicroseconds(microseconds); } std::shared_ptr<MockServo> mMockServo; };
Remove unecessary checks from mock class
Remove unecessary checks from mock class
C
mit
platisd/smartcar_shield,platisd/smartcar_shield
22190c6a5152fba9cec3807d96762a8da9a31130
test/minc.c
test/minc.c
/* Minimal C SDL example. This code is in the public domain. Compile with: gcc `sdl2-config --cflags` `sdl2-config --libs` minc.c */ #include <unistd.h> #include <assert.h> #include <stdio.h> #include "SDL.h" int main(int argc, char** argv) { assert (SDL_Init(SDL_INIT_VIDEO) == 0); SDL_Window *w = SDL_CreateWindow ("SDL OpenGL (C)", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL); assert (w); SDL_Delay (3000); SDL_DestroyWindow (w); SDL_Quit (); return 0; }
/* Minimal C SDL example. This code is in the public domain. Compile with: gcc -o minc minc.c `sdl2-config --cflags --libs` */ #include <unistd.h> #include <assert.h> #include <stdio.h> #include "SDL.h" int main(int argc, char** argv) { assert (SDL_Init(SDL_INIT_VIDEO) == 0); SDL_Window *w = SDL_CreateWindow ("SDL OpenGL (C)", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL); assert (w); SDL_Delay (3000); SDL_DestroyWindow (w); SDL_Quit (); return 0; }
Update compilation instructions for minimal C example.
Update compilation instructions for minimal C example.
C
isc
dbuenzli/tsdl
2810cf21b632e97ea1aa0d54b2cd4a64f9a83eef
ir/be/test/Bucmp.c
ir/be/test/Bucmp.c
char glob = -1; int main(void) { char x = 126; while (x > 0) { x++; printf("%d\n", x); if (x == -125) break; } return 0; }
Test case to use the correct Cmp mode
Test case to use the correct Cmp mode [r21315]
C
lgpl-2.1
killbug2004/libfirm,davidgiven/libfirm,8l/libfirm,MatzeB/libfirm,killbug2004/libfirm,MatzeB/libfirm,killbug2004/libfirm,davidgiven/libfirm,jonashaag/libfirm,8l/libfirm,MatzeB/libfirm,libfirm/libfirm,davidgiven/libfirm,8l/libfirm,jonashaag/libfirm,8l/libfirm,libfirm/libfirm,davidgiven/libfirm,davidgiven/libfirm,davidgiven/libfirm,killbug2004/libfirm,davidgiven/libfirm,killbug2004/libfirm,jonashaag/libfirm,8l/libfirm,libfirm/libfirm,8l/libfirm,killbug2004/libfirm,MatzeB/libfirm,8l/libfirm,MatzeB/libfirm,jonashaag/libfirm,jonashaag/libfirm,MatzeB/libfirm,MatzeB/libfirm,libfirm/libfirm,killbug2004/libfirm,jonashaag/libfirm,jonashaag/libfirm,libfirm/libfirm
1560265b11bb4b4d20d5f566330060f5f8504b04
test/function.c
test/function.c
int puts(const char *); int noop(void); int foo(char *list[5]) { puts(list[0]); puts(list[1]); return sizeof(list); } int prints(int n, ...) { return n; } char s1[] = "Hello"; char *s2 = "World"; int main() { int size = 0; char *words[2]; words[0] = s1; words[1] = s2; size = foo(words); size = size + sizeof(words); size = size + prints(2, "hei", "hoi"); return size; }
int puts(const char *); int noop(void); int foo(char *list[5]) { puts(list[0]); puts(list[1]); return sizeof(list[6]); } int prints(int n, ...) { return n; } char s1[] = "Hello"; char *s2 = "World"; int main() { int size = 0; char *words[2]; words[0] = s1; words[1] = s2; size = foo(words); size = size + sizeof(words); size = size + prints(2, "hei", "hoi"); return size; }
Change test to get rid of gcc warning
Change test to get rid of gcc warning
C
mit
larmel/lacc,larmel/c-compiler,larmel/c-compiler,larmel/lacc,larmel/c-compiler
ab6d6229cd7659ee49974d0116fe8bca06d7d128
test/Analysis/rdar-6541136-region.c
test/Analysis/rdar-6541136-region.c
// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=region %s struct tea_cheese { unsigned magic; }; typedef struct tea_cheese kernel_tea_cheese_t; extern kernel_tea_cheese_t _wonky_gesticulate_cheese; // This test case exercises the ElementRegion::getRValueType() logic. void foo( void ) { kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese; struct load_wine *cmd = (void*) &wonky[1]; cmd = cmd; char *p = (void*) &wonky[1]; //*p = 1; // this is also an out-of-bound access. kernel_tea_cheese_t *q = &wonky[1]; // This test case tests both the RegionStore logic (doesn't crash) and // the out-of-bounds checking. We don't expect the warning for now since // out-of-bound checking is temporarily disabled. kernel_tea_cheese_t r = *q; // expected-warning{{Access out-of-bound array element (buffer overflow)}} }
// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=region %s struct tea_cheese { unsigned magic; }; typedef struct tea_cheese kernel_tea_cheese_t; extern kernel_tea_cheese_t _wonky_gesticulate_cheese; // This test case exercises the ElementRegion::getRValueType() logic. void test1( void ) { kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese; struct load_wine *cmd = (void*) &wonky[1]; cmd = cmd; char *p = (void*) &wonky[1]; kernel_tea_cheese_t *q = &wonky[1]; // This test case tests both the RegionStore logic (doesn't crash) and // the out-of-bounds checking. We don't expect the warning for now since // out-of-bound checking is temporarily disabled. kernel_tea_cheese_t r = *q; // expected-warning{{Access out-of-bound array element (buffer overflow)}} } void test1_b( void ) { kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese; struct load_wine *cmd = (void*) &wonky[1]; cmd = cmd; char *p = (void*) &wonky[1]; *p = 1; // expected-warning{{Access out-of-bound array element (buffer overflow)}} }
Split buffer overflow test case into two test cases, removing out logic that was commented out.
Split buffer overflow test case into two test cases, removing out logic that was commented out. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@86845 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
889c1530c9b25a784447cd57659aecd3e5434942
src/include/executor/execdefs.h
src/include/executor/execdefs.h
/*------------------------------------------------------------------------- * * execdefs.h * * * * Copyright (c) 1994, Regents of the University of California * * $Id: execdefs.h,v 1.4 1999/02/13 23:21:22 momjian Exp $ * *------------------------------------------------------------------------- */ #ifndef EXECDEFS_H #define EXECDEFS_H /* ---------------- * ExecutePlan() tuplecount definitions * ---------------- */ #define ALL_TUPLES 0 /* return all tuples */ #define ONE_TUPLE 1 /* return only one tuple */ /* ---------------- * constants used by ExecMain * ---------------- */ #define EXEC_RUN 3 #define EXEC_FOR 4 #define EXEC_BACK 5 #define EXEC_RETONE 6 #define EXEC_RESULT 7 /* ---------------- * Merge Join states * ---------------- */ #define EXEC_MJ_INITIALIZE 1 #define EXEC_MJ_JOINMARK 2 #define EXEC_MJ_JOINTEST 3 #define EXEC_MJ_JOINTUPLES 4 #define EXEC_MJ_NEXTOUTER 5 #define EXEC_MJ_TESTOUTER 6 #define EXEC_MJ_NEXTINNER 7 #define EXEC_MJ_SKIPINNER 8 #define EXEC_MJ_SKIPOUTER 9 #endif /* EXECDEFS_H */
/*------------------------------------------------------------------------- * * execdefs.h * * * * Copyright (c) 1994, Regents of the University of California * * $Id: execdefs.h,v 1.5 1999/02/23 07:37:31 thomas Exp $ * *------------------------------------------------------------------------- */ #ifndef EXECDEFS_H #define EXECDEFS_H /* ---------------- * ExecutePlan() tuplecount definitions * ---------------- */ #define ALL_TUPLES 0 /* return all tuples */ #define ONE_TUPLE 1 /* return only one tuple */ /* ---------------- * constants used by ExecMain * ---------------- */ #define EXEC_RUN 3 #define EXEC_FOR 4 #define EXEC_BACK 5 #define EXEC_RETONE 6 #define EXEC_RESULT 7 /* ---------------- * Merge Join states * ---------------- */ #define EXEC_MJ_INITIALIZE 1 #define EXEC_MJ_JOINMARK 2 #define EXEC_MJ_JOINTEST 3 #define EXEC_MJ_JOINTUPLES 4 #define EXEC_MJ_NEXTOUTER 5 #define EXEC_MJ_TESTOUTER 6 #define EXEC_MJ_NEXTINNER 7 #define EXEC_MJ_SKIPINNER 8 #define EXEC_MJ_SKIPOUTER 9 #define EXEC_MJ_FILLINNER 10 #define EXEC_MJ_FILLOUTER 11 #endif /* EXECDEFS_H */
Add constants for outer join states in executor.
Add constants for outer join states in executor.
C
apache-2.0
Quikling/gpdb,greenplum-db/gpdb,pavanvd/postgres-xl,kmjungersen/PostgresXL,royc1/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,ovr/postgres-xl,chrishajas/gpdb,rubikloud/gpdb,Chibin/gpdb,Quikling/gpdb,rvs/gpdb,oberstet/postgres-xl,tpostgres-projects/tPostgres,lintzc/gpdb,Chibin/gpdb,lisakowen/gpdb,ahachete/gpdb,0x0FFF/gpdb,lisakowen/gpdb,snaga/postgres-xl,rvs/gpdb,lisakowen/gpdb,Chibin/gpdb,cjcjameson/gpdb,lisakowen/gpdb,ashwinstar/gpdb,zaksoup/gpdb,50wu/gpdb,lpetrov-pivotal/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,ahachete/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,lpetrov-pivotal/gpdb,Chibin/gpdb,kaknikhil/gpdb,atris/gpdb,techdragon/Postgres-XL,yazun/postgres-xl,lpetrov-pivotal/gpdb,Postgres-XL/Postgres-XL,lintzc/gpdb,kaknikhil/gpdb,xuegang/gpdb,royc1/gpdb,royc1/gpdb,xuegang/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,zaksoup/gpdb,arcivanov/postgres-xl,kaknikhil/gpdb,zaksoup/gpdb,tangp3/gpdb,yazun/postgres-xl,50wu/gpdb,xuegang/gpdb,chrishajas/gpdb,ashwinstar/gpdb,chrishajas/gpdb,xinzweb/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,ovr/postgres-xl,foyzur/gpdb,ahachete/gpdb,foyzur/gpdb,kaknikhil/gpdb,pavanvd/postgres-xl,xinzweb/gpdb,rvs/gpdb,chrishajas/gpdb,zaksoup/gpdb,lisakowen/gpdb,rvs/gpdb,kaknikhil/gpdb,arcivanov/postgres-xl,arcivanov/postgres-xl,tangp3/gpdb,greenplum-db/gpdb,oberstet/postgres-xl,zaksoup/gpdb,greenplum-db/gpdb,xinzweb/gpdb,0x0FFF/gpdb,snaga/postgres-xl,jmcatamney/gpdb,rvs/gpdb,jmcatamney/gpdb,postmind-net/postgres-xl,zeroae/postgres-xl,techdragon/Postgres-XL,cjcjameson/gpdb,kaknikhil/gpdb,foyzur/gpdb,edespino/gpdb,janebeckman/gpdb,rubikloud/gpdb,royc1/gpdb,randomtask1155/gpdb,CraigHarris/gpdb,edespino/gpdb,cjcjameson/gpdb,tpostgres-projects/tPostgres,jmcatamney/gpdb,lisakowen/gpdb,CraigHarris/gpdb,techdragon/Postgres-XL,zeroae/postgres-xl,kaknikhil/gpdb,xuegang/gpdb,zaksoup/gpdb,lpetrov-pivotal/gpdb,Chibin/gpdb,janebeckman/gpdb,kmjungersen/PostgresXL,xinzweb/gpdb,xuegang/gpdb,lintzc/gpdb,kaknikhil/gpdb,Quikling/gpdb,rubikloud/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,royc1/gpdb,CraigHarris/gpdb,foyzur/gpdb,ahachete/gpdb,foyzur/gpdb,Quikling/gpdb,yazun/postgres-xl,postmind-net/postgres-xl,royc1/gpdb,adam8157/gpdb,yuanzhao/gpdb,lintzc/gpdb,kmjungersen/PostgresXL,ovr/postgres-xl,atris/gpdb,foyzur/gpdb,tangp3/gpdb,50wu/gpdb,randomtask1155/gpdb,jmcatamney/gpdb,snaga/postgres-xl,rvs/gpdb,oberstet/postgres-xl,Quikling/gpdb,royc1/gpdb,xuegang/gpdb,cjcjameson/gpdb,zaksoup/gpdb,rvs/gpdb,lpetrov-pivotal/gpdb,janebeckman/gpdb,edespino/gpdb,CraigHarris/gpdb,tangp3/gpdb,xinzweb/gpdb,techdragon/Postgres-XL,rubikloud/gpdb,rvs/gpdb,Quikling/gpdb,lintzc/gpdb,yazun/postgres-xl,lpetrov-pivotal/gpdb,edespino/gpdb,Postgres-XL/Postgres-XL,Postgres-XL/Postgres-XL,xuegang/gpdb,jmcatamney/gpdb,50wu/gpdb,50wu/gpdb,CraigHarris/gpdb,lintzc/gpdb,zaksoup/gpdb,randomtask1155/gpdb,atris/gpdb,adam8157/gpdb,royc1/gpdb,chrishajas/gpdb,janebeckman/gpdb,edespino/gpdb,yuanzhao/gpdb,xinzweb/gpdb,50wu/gpdb,rvs/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,Quikling/gpdb,lpetrov-pivotal/gpdb,randomtask1155/gpdb,adam8157/gpdb,kmjungersen/PostgresXL,edespino/gpdb,zeroae/postgres-xl,edespino/gpdb,lisakowen/gpdb,Quikling/gpdb,tpostgres-projects/tPostgres,jmcatamney/gpdb,tangp3/gpdb,pavanvd/postgres-xl,ovr/postgres-xl,0x0FFF/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,oberstet/postgres-xl,ashwinstar/gpdb,postmind-net/postgres-xl,lpetrov-pivotal/gpdb,lisakowen/gpdb,lintzc/gpdb,randomtask1155/gpdb,yuanzhao/gpdb,50wu/gpdb,arcivanov/postgres-xl,xinzweb/gpdb,yuanzhao/gpdb,janebeckman/gpdb,Chibin/gpdb,Quikling/gpdb,zeroae/postgres-xl,atris/gpdb,rubikloud/gpdb,Quikling/gpdb,rubikloud/gpdb,snaga/postgres-xl,kmjungersen/PostgresXL,randomtask1155/gpdb,janebeckman/gpdb,50wu/gpdb,ahachete/gpdb,yazun/postgres-xl,techdragon/Postgres-XL,Chibin/gpdb,yuanzhao/gpdb,janebeckman/gpdb,adam8157/gpdb,lintzc/gpdb,chrishajas/gpdb,lintzc/gpdb,tangp3/gpdb,janebeckman/gpdb,randomtask1155/gpdb,atris/gpdb,jmcatamney/gpdb,janebeckman/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,tangp3/gpdb,arcivanov/postgres-xl,pavanvd/postgres-xl,rubikloud/gpdb,Chibin/gpdb,foyzur/gpdb,0x0FFF/gpdb,pavanvd/postgres-xl,randomtask1155/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,edespino/gpdb,kaknikhil/gpdb,janebeckman/gpdb,ashwinstar/gpdb,edespino/gpdb,foyzur/gpdb,0x0FFF/gpdb,xinzweb/gpdb,Chibin/gpdb,oberstet/postgres-xl,ovr/postgres-xl,CraigHarris/gpdb,tpostgres-projects/tPostgres,ahachete/gpdb,rvs/gpdb,adam8157/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,adam8157/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,xuegang/gpdb,atris/gpdb,atris/gpdb,atris/gpdb,0x0FFF/gpdb,chrishajas/gpdb,jmcatamney/gpdb,ahachete/gpdb,chrishajas/gpdb,tpostgres-projects/tPostgres,ahachete/gpdb,CraigHarris/gpdb,rubikloud/gpdb,xuegang/gpdb,postmind-net/postgres-xl,tangp3/gpdb,greenplum-db/gpdb,Chibin/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,edespino/gpdb,snaga/postgres-xl,greenplum-db/gpdb,postmind-net/postgres-xl,zeroae/postgres-xl
b7ba8230802b1db4906f3d3f7489b60458b51ad5
examples/wc_mock.h
examples/wc_mock.h
// Copyright 2015. All Rights Reserved. // Author: [email protected] (Xiaotian Pei) #ifndef EXAMPLES_COREUTILS_WC_MOCK_H_ #define EXAMPLES_COREUTILS_WC_MOCK_H_ #include "examples/coreutils/wc.h" #include "third_party/gmock/gmock.h" namespace coreutils { class MockFile : public File { public: MOCK_METHOD2(Open, bool(const char* filename, const char* mode)); MOCK_METHOD0(Close, bool()); MOCK_METHOD2(Read, int(char* buffer, int buf_size)); MOCK_METHOD0(Eof, bool()); }; } // namespace coreutils #endif // EXAMPLES_COREUTILS_WC_MOCK_H_
// Copyright 2015. All Rights Reserved. // Author: [email protected] (Xiaotian Pei) #ifndef EXAMPLES_COREUTILS_WC_MOCK_H_ #define EXAMPLES_COREUTILS_WC_MOCK_H_ #include "examples/wc.h" #include "third_party/gmock/gmock.h" namespace coreutils { class MockFile : public File { public: MOCK_METHOD2(Open, bool(const char* filename, const char* mode)); MOCK_METHOD0(Close, bool()); MOCK_METHOD2(Read, int(char* buffer, int buf_size)); MOCK_METHOD0(Eof, bool()); }; } // namespace coreutils #endif // EXAMPLES_COREUTILS_WC_MOCK_H_
Fix path in header file
Fix path in header file
C
mit
skyshaw/skynet3,skyshaw/skynet3,skyshaw/skynet3,skyshaw/skynet3
2fcfd9bc68a3bc3063eb4f2c56e591fe931bb2be
chrome/app/scoped_ole_initializer.h
chrome/app/scoped_ole_initializer.h
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_ #define CHROME_APP_SCOPED_OLE_INITIALIZER_H_ // Wraps OLE initialization in a cross-platform class meant to be used on the // stack so init/uninit is done with scoping. This class is ok for use by // non-windows platforms; it just doesn't do anything. #if defined(OS_WIN) #include <ole2.h> class ScopedOleInitializer { public: ScopedOleInitializer() { int ole_result = OleInitialize(NULL); DCHECK(ole_result == S_OK); } ~ScopedOleInitializer() { OleUninitialize(); } }; #else class ScopedOleInitializer { public: // Empty, this class does nothing on non-win32 systems. Empty ctor is // necessary to avoid "unused variable" warning on gcc. ScopedOleInitializer() { } }; #endif #endif // CHROME_APP_SCOPED_OLE_INITIALIZER_H_
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_ #define CHROME_APP_SCOPED_OLE_INITIALIZER_H_ #include "base/logging.h" #include "build/build_config.h" // Wraps OLE initialization in a cross-platform class meant to be used on the // stack so init/uninit is done with scoping. This class is ok for use by // non-windows platforms; it just doesn't do anything. #if defined(OS_WIN) #include <ole2.h> class ScopedOleInitializer { public: ScopedOleInitializer() { int ole_result = OleInitialize(NULL); DCHECK(ole_result == S_OK); } ~ScopedOleInitializer() { OleUninitialize(); } }; #else class ScopedOleInitializer { public: // Empty, this class does nothing on non-win32 systems. Empty ctor is // necessary to avoid "unused variable" warning on gcc. ScopedOleInitializer() { } }; #endif #endif // CHROME_APP_SCOPED_OLE_INITIALIZER_H_
Make ScopedOleInitializer work on windows if you aren't including build_config already.
Make ScopedOleInitializer work on windows if you aren't including build_config already. BUG=none TEST=none Review URL: http://codereview.chromium.org/19640 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@8835 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
Crystalnix/house-of-life-chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,adobe/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,adobe/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,adobe/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,ropik/chromium,adobe/chromium
773c265c96b48b95e5e71ef3388611ffcf39fef8
public/platform/WebBlobInfo.h
public/platform/WebBlobInfo.h
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WebBlobInfo_h #define WebBlobInfo_h #include "WebCommon.h" #include "WebString.h" namespace blink { class WebBlobInfo { public: WebBlobInfo() : m_isFile(false) , m_size(-1) , m_lastModified(0) { } WebBlobInfo(const WebString& uuid, const WebString& type, long long size) : m_isFile(false) , m_uuid(uuid) , m_type(type) , m_size(size) , m_lastModified(0) { } WebBlobInfo(const WebString& uuid, const WebString& filePath, const WebString& fileName, const WebString& type) : m_isFile(true) , m_uuid(uuid) , m_type(type) , m_size(-1) , m_filePath(filePath) , m_fileName(fileName) , m_lastModified(0) { } WebBlobInfo(const WebString& uuid, const WebString& filePath, const WebString& fileName, const WebString& type, double lastModified, long long size) : m_isFile(true) , m_uuid(uuid) , m_type(type) , m_size(size) , m_filePath(filePath) , m_fileName(fileName) , m_lastModified(lastModified) { } bool isFile() const { return m_isFile; } const WebString& uuid() const { return m_uuid; } const WebString& type() const { return m_type; } long long size() const { return m_size; } const WebString& filePath() const { return m_filePath; } const WebString& fileName() const { return m_fileName; } double lastModified() const { return m_lastModified; } private: bool m_isFile; WebString m_uuid; WebString m_type; // MIME type long long m_size; WebString m_filePath; // Only for File WebString m_fileName; // Only for File double m_lastModified; // Only for File }; } // namespace blink #endif
Add two classes [as yet unused] needed for upcoming IDB Blob support.
Add two classes [as yet unused] needed for upcoming IDB Blob support. BUG=108012 R=cmumford,jsbell,abarth Review URL: https://codereview.chromium.org/205413004 git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@170686 bbb929c8-8fbe-4397-9dbb-9b2b20218538
C
bsd-3-clause
primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs
28eb97299e564daee96d3af1f9130d6439f170f6
include/ipc.h
include/ipc.h
#ifndef _SWAY_IPC_H #define _SWAY_IPC_H #define event_mask(ev) (1 << (ev & 0x7F)) enum ipc_command_type { IPC_COMMAND = 0, IPC_GET_WORKSPACES = 1, IPC_SUBSCRIBE = 2, IPC_GET_OUTPUTS = 3, IPC_GET_TREE = 4, IPC_GET_MARKS = 5, IPC_GET_BAR_CONFIG = 6, IPC_GET_VERSION = 7, IPC_GET_INPUTS = 8, IPC_GET_CLIPBOARD = 9, IPC_GET_SEATS = 10, // Events send from sway to clients. Events have the highest bits set. IPC_EVENT_WORKSPACE = ((1<<31) | 0), IPC_EVENT_OUTPUT = ((1<<31) | 1), IPC_EVENT_MODE = ((1<<31) | 2), IPC_EVENT_WINDOW = ((1<<31) | 3), IPC_EVENT_BARCONFIG_UPDATE = ((1<<31) | 4), IPC_EVENT_BINDING = ((1<<31) | 5), IPC_EVENT_MODIFIER = ((1<<31) | 6), IPC_EVENT_INPUT = ((1<<31) | 7), }; #endif
#ifndef _SWAY_IPC_H #define _SWAY_IPC_H #define event_mask(ev) (1 << (ev & 0x7F)) enum ipc_command_type { // i3 command types - see i3's I3_REPLY_TYPE constants IPC_COMMAND = 0, IPC_GET_WORKSPACES = 1, IPC_SUBSCRIBE = 2, IPC_GET_OUTPUTS = 3, IPC_GET_TREE = 4, IPC_GET_MARKS = 5, IPC_GET_BAR_CONFIG = 6, IPC_GET_VERSION = 7, // sway-specific command types IPC_GET_INPUTS = 100, IPC_GET_CLIPBOARD = 101, IPC_GET_SEATS = 102, // Events sent from sway to clients. Events have the highest bits set. IPC_EVENT_WORKSPACE = ((1<<31) | 0), IPC_EVENT_OUTPUT = ((1<<31) | 1), IPC_EVENT_MODE = ((1<<31) | 2), IPC_EVENT_WINDOW = ((1<<31) | 3), IPC_EVENT_BARCONFIG_UPDATE = ((1<<31) | 4), IPC_EVENT_BINDING = ((1<<31) | 5), IPC_EVENT_MODIFIER = ((1<<31) | 6), IPC_EVENT_INPUT = ((1<<31) | 7), }; #endif
Fix conflicting IPC command type constants with i3's
Fix conflicting IPC command type constants with i3's
C
mit
1ace/sway,ascent12/sway,ascent12/sway,taiyu-len/sway,1ace/sway,taiyu-len/sway,1ace/sway,taiyu-len/sway,ascent12/sway,SirCmpwn/sway
58bb08f20b070180b9729f19ab5160867961ad33
Example/Tests/TestModels/FLXTestModels.h
Example/Tests/TestModels/FLXTestModels.h
// // TETestModels.h // FLUX // // Created by Alex Faizullov on 10/28/16. // Copyright © 2016 Alexey Fayzullov. All rights reserved. // #import <Foundation/Foundation.h> #import <FLUX/FLXStore.h> #define te_defineStoreTestDouble(name) \ \ @interface name : FLXStore <NSObject *> \ \ @end \ \ @implementation name \ \ + (id)defaultState { return [NSObject new]; } \ \ @end \ \ te_defineStoreTestDouble(FLXFakeStore) te_defineStoreTestDouble(FLXTestStore)
// // TETestModels.h // FLUX // // Created by Alex Faizullov on 10/28/16. // Copyright © 2016 Alexey Fayzullov. All rights reserved. // #import <Foundation/Foundation.h> #import <FLUX/FLXStore.h> #define flx_defineStoreTestDouble(name) \ \ @interface name : FLXStore <NSObject *> \ \ @end \ \ @implementation name \ \ + (id)defaultState { return [NSObject new]; } \ \ @end \ \ flx_defineStoreTestDouble(FLXFakeStore) flx_defineStoreTestDouble(FLXTestStore)
Change test model define prefix
Change test model define prefix
C
mit
techery/FLUX
21abbc66f6f0575e910ff19ea782662ab52780d8
installations/src/installations_internal.h
installations/src/installations_internal.h
// Copyright 2020 Google LLC // // 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 FIREBASE_FIS_CLIENT_CPP_SRC_INSTALLATIONS_INTERNAL_H_ #define FIREBASE_FIS_CLIENT_CPP_SRC_INSTALLATIONS_INTERNAL_H_ // InstallationsInternal is defined in these 2 files, one implementation for // each OS. #if FIREBASE_PLATFORM_ANDROID || FIREBASE_ANDROID_FOR_DESKTOP #include "installations/src/android/installations_android.h" #elif FIREBASE_PLATFORM_IOS #include "installations/src/ios/installations_ios.h" #else #include "installations/src/stub/installations_stub.h" #endif // FIREBASE_PLATFORM_ANDROID, FIREBASE_PLATFORM_IOS #endif // FIREBASE_FIS_CLIENT_CPP_SRC_INSTALLATIONS_INTERNAL_H_
// Copyright 2020 Google LLC // // 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 FIREBASE_FIS_CLIENT_CPP_SRC_INSTALLATIONS_INTERNAL_H_ #define FIREBASE_FIS_CLIENT_CPP_SRC_INSTALLATIONS_INTERNAL_H_ #include "app/src/include/firebase/internal/platform.h" // InstallationsInternal is defined in these 2 files, one implementation for // each OS. #if FIREBASE_PLATFORM_ANDROID || FIREBASE_ANDROID_FOR_DESKTOP #include "installations/src/android/installations_android.h" #elif FIREBASE_PLATFORM_IOS #include "installations/src/ios/installations_ios.h" #else #include "installations/src/stub/installations_stub.h" #endif // FIREBASE_PLATFORM_ANDROID, FIREBASE_PLATFORM_IOS #endif // FIREBASE_FIS_CLIENT_CPP_SRC_INSTALLATIONS_INTERNAL_H_
Add platform include to installations header
Add platform include to installations header The Installations header uses the platform information to include the correct sub header, so it needs to include the platform header itself.
C
apache-2.0
firebase/firebase-cpp-sdk,firebase/firebase-cpp-sdk,firebase/firebase-cpp-sdk,firebase/firebase-cpp-sdk,firebase/firebase-cpp-sdk,firebase/firebase-cpp-sdk,firebase/firebase-cpp-sdk,firebase/firebase-cpp-sdk
eb97ff0f6d9229d940db0048e486949eaa3383b0
SudokuStart01/Sudoku9by9SolverAnalyzer.h
SudokuStart01/Sudoku9by9SolverAnalyzer.h
// // Sudoku 9by9 Solver and Analyzer // #include "Sudoku9by9Board.h" class Sudoku9by9SolverAnalyzer { private: Sudoku9by9Board *board_ptr; int number_of_solutions; public: Sudoku9by9SolverAnalyzer(); Sudoku9by9SolverAnalyzer(Sudoku9by9Board *board_ptr); bool NextTryOrBackTrack(int i, int j, bool backtrack); void Solve(void); bool Cell_Conflict_Check(int p, int i, int j); int get_number_of_solutions(void); ~Sudoku9by9SolverAnalyzer(); };
// // Sudoku 9by9 Solver and Analyzer // #include "Sudoku9by9PuzzleBoard.h" class Sudoku9by9SolverAnalyzer { private: Sudoku9by9Board *board_ptr; int number_of_solutions; public: Sudoku9by9SolverAnalyzer(); Sudoku9by9SolverAnalyzer(Sudoku9by9Board *board_ptr); bool NextTryOrBackTrack(int i, int j, bool backtrack); void Solve(void); bool Cell_Conflict_Check(int p, int i, int j); int get_number_of_solutions(void); ~Sudoku9by9SolverAnalyzer(); };
Fix Puzzle board .h file reference
Fix Puzzle board .h file reference
C
mit
gitguy101/SudokuStartxx
470b9b8d3739be4b846a08691e4ff7a981106590
HTMLKit/HTMLElement.h
HTMLKit/HTMLElement.h
// // HTMLElement.h // HTMLKit // // Created by Iska on 05/10/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> #import "HTMLNamespaces.h" #import "HTMLNode.h" @interface HTMLElement : HTMLNode @property (nonatomic, assign, readonly) HTMLNamespace htmlNamespace; @property (nonatomic, copy, readonly) NSString *tagName; @property (nonatomic, strong) NSMutableDictionary *attributes; @property (nonatomic, copy) NSString *elementId; @property (nonatomic, copy) NSString *className; - (instancetype)initWithTagName:(NSString *)tagName; - (instancetype)initWithTagName:(NSString *)tagName attributes:(NSDictionary *)attributes; - (instancetype)initWithTagName:(NSString *)tagName attributes:(NSDictionary *)attributes namespace:(HTMLNamespace)htmlNamespace; - (BOOL)hasAttribute:(NSString *)name; - (NSString *)objectForKeyedSubscript:(NSString *)name; - (void)setObject:(NSString *)value forKeyedSubscript:(NSString *)attribute; - (void)removeAttribute:(NSString *)name; @end
// // HTMLElement.h // HTMLKit // // Created by Iska on 05/10/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> #import "HTMLNamespaces.h" #import "HTMLNode.h" @interface HTMLElement : HTMLNode @property (nonatomic, assign, readonly) HTMLNamespace htmlNamespace; @property (nonatomic, copy, readonly) NSString *tagName; @property (nonatomic, strong) NSMutableDictionary *attributes; @property (nonatomic, copy) NSString *elementId; @property (nonatomic, copy) NSString *className; - (instancetype)initWithTagName:(NSString *)tagName; - (instancetype)initWithTagName:(NSString *)tagName attributes:(NSDictionary *)attributes; - (instancetype)initWithTagName:(NSString *)tagName namespace:(HTMLNamespace)htmlNamespace attributes:(NSDictionary *)attributes; - (BOOL)hasAttribute:(NSString *)name; - (NSString *)objectForKeyedSubscript:(NSString *)name; - (void)setObject:(NSString *)value forKeyedSubscript:(NSString *)attribute; - (void)removeAttribute:(NSString *)name; @end
Change arguments order in HTML Element initializer for convenience
Change arguments order in HTML Element initializer for convenience Dictionary argument moved to last position.
C
mit
iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit
ba44961e08720cd64a964d9b5d10fd64f8b6f5b3
Include/bltinmodule.h
Include/bltinmodule.h
/*********************************************************** Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, 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 names of Stichting Mathematisch Centrum or CWI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM 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. ******************************************************************/ /* Built-in module interface */ extern object *getbuiltin PROTO((char *));
/*********************************************************** Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, 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 names of Stichting Mathematisch Centrum or CWI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM 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. ******************************************************************/ /* Built-in module interface */ extern object *getbuiltin PROTO((object *));
Change getbuiltin interface to get the name as an object.
Change getbuiltin interface to get the name as an object.
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
793627ceb48f704bc97867b8c75af2e6f83bc07f
types.h
types.h
#ifndef BFC_TYPES_H #define BFC_TYPES_H #ifndef __cplusplus # include <stdint.h> #else # include <cstdint> #endif typedef bfc_cell uint8_t; #endif /* !BFC_TYPES_H */
Add beginning of what will become files shared between runtime and compiler.
Add beginning of what will become files shared between runtime and compiler.
C
mit
bassettmb/bfc,bassettmb/bfc
a06c8b5a9e08ef2337216c294a6a14ca9579c762
src/Mapper.h
src/Mapper.h
#ifndef MAPPER_H #define MAPPER_H #include <cstdint> #include <vector> #include <CartMemory.h> #include <Mirroring.h> class Mapper { public: Mapper(CartMemory mem) : cartMemory(mem) { init(); }; Mirroring getMirroring() { return cartMemory.mirroring; }; virtual void init() { }; virtual uint8_t readPrg(uint16_t addr) { }; virtual void writePrg(uint16_t addr, uint8_t value) { }; virtual uint8_t readChr(uint16_t addr) { }; virtual void writeChr(uint16_t addr, uint8_t value) { }; protected: CartMemory cartMemory; }; #endif
#ifndef MAPPER_H #define MAPPER_H #include <cstdint> #include <vector> #include <CartMemory.h> #include <Mirroring.h> class Mapper { public: Mapper(CartMemory mem) : cartMemory(mem) { init(); }; Mirroring getMirroring() { return cartMemory.mirroring; }; virtual uint8_t readPrg(uint16_t addr) { }; virtual void writePrg(uint16_t addr, uint8_t value) { }; virtual uint8_t readChr(uint16_t addr) { }; virtual void writeChr(uint16_t addr, uint8_t value) { }; protected: virtual void init() { }; CartMemory cartMemory; }; #endif
Make mapper init function protected
Make mapper init function protected
C
mit
scottjcrouch/ScootNES,scottjcrouch/ScootNES,scottjcrouch/ScootNES
39a69fb6c520d7f4e272610a2d13795eb75dd1f1
src/string.c
src/string.c
#include <stddef.h> void* memcpy(void* restrict destination, const void* restrict source, size_t length) { char* restrict dst = destination; const char* restrict src = source; /* I know this is naive, but compiler will optimized this because we have restrict. */ for (; length; --length) { *dst = *src; ++dst; ++src; } return destination; }
#include <stddef.h> void* memcpy(void* restrict destination, const void* restrict source, size_t length) { char* restrict dst = destination; const char* restrict src = source; /* I know this is naive, but compiler will optimized this because we have restrict. */ for (; length; --length) *dst++ = *src++; return destination; }
Simplify loop body of memcpy
Simplify loop body of memcpy
C
mit
jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic,jdh8/metallic
01145fa196b4158507dfcd7405026c2d51551c69
src/modules/fs/methods/access.c
src/modules/fs/methods/access.c
#include "mininode.h" #include <unistd.h> #include <fcntl.h> duk_ret_t mn_bi_fs_access(duk_context *ctx) { const int nargs = duk_get_top(ctx); const char *path = NULL; uv_fs_t *req = NULL; int mode = 0; if (nargs == 3) { mode = duk_require_int(ctx, -2); path = duk_require_string(ctx, -3); } else { mode = F_OK; path = duk_require_string(ctx, -2); } req = duk_push_fixed_buffer(ctx, sizeof(*req)); req->data = mn_setup_req(ctx, -2); uv_fs_access(mn_loop, req, path, mode, mn_fs_cb); if (req->result != 0) { mn_push_error_result(ctx, req); duk_throw(ctx); return 1; } else { return 0; } }
#include "mininode.h" #include <unistd.h> #include <fcntl.h> duk_ret_t mn_bi_fs_access(duk_context *ctx) { const int nargs = duk_get_top(ctx); const char *path = NULL; uv_fs_t *req = NULL; int mode = 0; if (nargs == 3) { mode = duk_require_int(ctx, -2); path = duk_require_string(ctx, -3); } else if (nargs == 2){ mode = F_OK; path = duk_require_string(ctx, -2); } else if (nargs < 2) { duk_pop_n(ctx, nargs); duk_push_error_object( ctx, DUK_ERR_TYPE_ERROR, "invalid arguments" ); duk_push_string(ctx, "src/modules/fs/methods/access.c"); duk_put_prop_string(ctx, -2, "fileName"); duk_push_int(ctx, 17); duk_put_prop_string(ctx, -2, "lineNumber"); duk_throw(ctx); return 1; } req = duk_push_fixed_buffer(ctx, sizeof(*req)); req->data = mn_setup_req(ctx, -2); uv_fs_access(mn_loop, req, path, mode, mn_fs_cb); if (req->result != 0) { mn_push_error_result(ctx, req); duk_throw(ctx); return 1; } else { return 0; } }
Add fileName and lineNumber properties to Error
Add fileName and lineNumber properties to Error
C
mit
hypoalex/mininode,hypoalex/mininode,hypoalex/mininode
f743a0c0d7c8d67fd5a3263deade3525ce7a0441
src/MotorShield.h
src/MotorShield.h
#include <Arduino.h> class MotorShield { public: MotorShield(uint8_t leftSpeedPin, uint8_t leftDirPin, uint8_t rightSpeedPin, uint8_t rightDirPin); void init(); void forward(); void backward(); void stop(); void fullSpeed(); void stopLeft(); void stopRight(); uint8_t getMaxSpeed(); uint8_t getMinSpeed(); uint8_t getLeftSpeedPin(); uint8_t getLeftDirPin(); uint8_t getRightSpeedPin(); uint8_t getRightDirPin(); uint8_t getLeftSpeed(); uint8_t getRightSpeed(); void setSpeed(uint8_t); void setLeftSpeed(uint8_t); void setRightSpeed(uint8_t); private: uint8_t leftSpeedPin, leftDirPin, rightSpeedPin, rightDirPin, maxSpeed, minSpeed, leftSpeed, rightSpeed; };
#include <Arduino.h> class MotorShield { public: MotorShield(uint8_t leftSpeedPin, uint8_t leftDirPin, uint8_t rightSpeedPin, uint8_t rightDirPin); // Initialization method. Must be called in Arduino's setup() function. void init(); // Makes left and right motors go in the forward direction. void forward(); // Makes left and right motors go in the backward direction. void backward(); // Stops both left and right motors. void stop(); // Puts both left and right motors at the maximum speed. void fullSpeed(); // Stops left motor. void stopLeft(); // Stops right motor. void stopRight(); // Returns the maximum allowed speed. uint8_t getMaxSpeed(); // Returns the minimum allowed speed. uint8_t getMinSpeed(); // Returns the pin used to control left motor speed. uint8_t getLeftSpeedPin(); // Returns the pin used to control left motor direction. uint8_t getLeftDirPin(); // Returns the pin used to control right motor speed. uint8_t getRightSpeedPin(); // Returns the pin used to control right motor direction. uint8_t getRightDirPin(); // Returns the current speed of the left motor. uint8_t getLeftSpeed(); // Returns the current speed of the right motor. uint8_t getRightSpeed(); // Sets the speed of both left and right motors. void setSpeed(uint8_t); // Sets the speed of the left motor. void setLeftSpeed(uint8_t); // Sets the speed of the right motor. void setRightSpeed(uint8_t); private: uint8_t leftSpeedPin, leftDirPin, rightSpeedPin, rightDirPin, maxSpeed, minSpeed, leftSpeed, rightSpeed; };
Include some comments about each method
Include some comments about each method
C
mit
lenon/arduino-motorshield
f31b643032266e29cbd1764abc85ee4619ea5b5d
kernel/core/main.c
kernel/core/main.c
#include <truth/panic.h> #include <truth/cpu.h> #include <truth/types.h> #include <truth/log.h> #include <truth/slab.h> #include <truth/heap.h> #include <truth/physical_allocator.h> string Logo = str("\n" " _.-.\n" " .-. `) | .-.\n" " _.'`. .~./ \\.~. .`'._\n" " .-' .'.'.'.-| |-.'.'.'. '-.\n" " `'`'`'`'` \\ / `'`'`'`'`\n" " /||\\\n" " //||\\\\\n" "\n" " The Kernel of Truth\n"); void kernel_main(void *multiboot_tables) { assert_ok(init_log("log")); log(Logo); logf("\tVersion %d.%d.%d\n\tCommit %s\n\t%s\n\tCPU Time %ld\n", kernel_major, kernel_minor, kernel_patch, vcs_version, project_website, cpu_time()); init_interrupts(); init_physical_allocator(multiboot_tables); init_slab(); assert_ok(init_heap()); assert_ok(init_modules(multiboot_tables)); halt(); }
#include <truth/panic.h> #include <truth/cpu.h> #include <truth/types.h> #include <truth/log.h> #include <truth/slab.h> #include <truth/heap.h> #include <truth/physical_allocator.h> string Logo = str("\n" " _.-.\n" " .-. `) | .-.\n" " _.'`. .~./ \\.~. .`'._\n" " .-' .'.'.'.-| |-.'.'.'. '-.\n" " `'`'`'`'` \\ / `'`'`'`'`\n" " /||\\\n" " //||\\\\\n" "\n" " The Kernel of Truth\n"); void kernel_main(void *multiboot_tables) { assert_ok(init_log("log")); log(Logo); logf("\tVersion %d.%d.%d\n\tCommit %s\n\t%s\n\tCPU Time %ld\n", kernel_major, kernel_minor, kernel_patch, vcs_version, project_website, cpu_time()); init_interrupts(); init_physical_allocator(multiboot_tables); init_slab(); assert_ok(init_heap()); halt(); }
Remove unimplemented line of code
Remove unimplemented line of code
C
mit
iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth
5124c5f903ca10366dcff8497a77eedc8dd30169
app/app_config.h
app/app_config.h
/* * Application configuration */ #pragma once #include <QtCore> typedef struct { QString type; quint64 frequency; qint64 nco; qint64 transverter; unsigned int rate; unsigned int decimation; unsigned int bandwidth; int freq_corr_ppb; } device_config_t; typedef struct { } audio_config_t; typedef struct { unsigned int version; device_config_t input; audio_config_t audio; } app_config_t; // error codes #define APP_CONFIG_OK 0 #define APP_CONFIG_EINVAL 1 // invalid function paramter #define APP_CONFIG_EFILE 2 // error loading or saving file #define APP_CONFIG_EDATA 3 // data error (e.g. missing required config record) class AppConfig { public: explicit AppConfig(); virtual ~AppConfig(); int load(const QString &filename); void save(void); void close(void); app_config_t *getDataPtr(void) { return &app_config; } private: void readDeviceConf(void); void saveDeviceConf(void); private: QSettings *settings; app_config_t app_config; };
/* * Application configuration */ #pragma once #include <QtCore> typedef struct { QString type; quint64 frequency; qint64 nco; qint64 transverter; quint32 rate; quint32 decimation; quint32 bandwidth; qint32 freq_corr_ppb; } device_config_t; typedef struct { } audio_config_t; typedef struct { unsigned int version; device_config_t input; audio_config_t audio; } app_config_t; // error codes #define APP_CONFIG_OK 0 #define APP_CONFIG_EINVAL 1 // invalid function paramter #define APP_CONFIG_EFILE 2 // error loading or saving file #define APP_CONFIG_EDATA 3 // data error (e.g. missing required config record) class AppConfig { public: explicit AppConfig(); virtual ~AppConfig(); int load(const QString &filename); void save(void); void close(void); app_config_t *getDataPtr(void) { return &app_config; } private: void readDeviceConf(void); void saveDeviceConf(void); private: QSettings *settings; app_config_t app_config; };
Use Qt types for integers
Use Qt types for integers
C
bsd-2-clause
csete/softrig,csete/softrig,csete/softrig
e8ff2dd846f477d753af91937e0d67a767d48561
algorithms/include/algorithms/selection_sort.h
algorithms/include/algorithms/selection_sort.h
#ifndef INCLUDE_ALGORITHMS_SELECTION_SORT_H_ #define INCLUDE_ALGORITHMS_SELECTION_SORT_H_ #include <stddef.h> #include <vector> #include <functional> #include "sort_interface.h" /* This class implements sorting of elements using selection sort algorithm The time complexity to sort is quadratic and is insensitive to input, which mean that the algorithm will take quadratic time even if the input is sorted. However the data movement is minimal. The algorithm does linear number of swaps to sort the elements. Each element is moved into its final position once. */ namespace algorithms { template <typename _tp> class SelectionSort : public SortInterface<_tp> { public: typedef _tp value_type; static void Sort(std::vector<value_type>& elements, std::function<bool(const value_type&, const value_type&)> comparer = std::less<value_type>()) { for (size_t index = 0; index < elements.size(); ++index) { auto min = index; for (size_t cnt = index + 1; cnt < elements.size(); ++cnt) { if (comparer(elements[cnt], elements[min])) min = cnt; } std::swap(elements[min], elements[index]); } } }; } #endif //INCLUDE_ALGORITHMS_SELECTION_SORT_H_
#ifndef INCLUDE_ALGORITHMS_SELECTION_SORT_H_ #define INCLUDE_ALGORITHMS_SELECTION_SORT_H_ #include <stddef.h> #include <vector> #include <functional> #include "sort_interface.h" /* This class implements sorting of elements using selection sort algorithm The time complexity to sort is quadratic (N2/4) and is insensitive to input, which mean that the algorithm will take quadratic time even if the input is sorted. However the data movement is minimal. The algorithm does linear number of swaps to sort the elements. Each element is moved into its final position once. */ namespace algorithms { template <typename _tp> class SelectionSort : public SortInterface<_tp> { public: typedef _tp value_type; static void Sort(std::vector<value_type>& elements, std::function<bool(const value_type&, const value_type&)> comparer = std::less<value_type>()) { for (size_t index = 0; index < elements.size(); ++index) { auto min = index; for (size_t cnt = index + 1; cnt < elements.size(); ++cnt) { if (comparer(elements[cnt], elements[min])) min = cnt; } std::swap(elements[min], elements[index]); } } }; } #endif //INCLUDE_ALGORITHMS_SELECTION_SORT_H_
Update comment of selection sort to include time complexity precisely
Update comment of selection sort to include time complexity precisely
C
mit
TusharJadhav/algorithms,TusharJadhav/algorithms
be3d7ac0ccd1363ed9a38b275d07270b224fd893
src/lib/PMDPage.h
src/lib/PMDPage.h
#pragma once #include "geometry.h" #include "yaml_utils.h" #include <vector> #include <boost/shared_ptr.hpp> #include <librevenge/librevenge.h> namespace libpagemaker { class PMDPage { std::vector<boost::shared_ptr<PMDLineSet> > m_shapes; public: PMDPage() : m_shapes() { } void addShape(boost::shared_ptr<PMDLineSet> shape) { m_shapes.push_back(shape); } unsigned numShapes() const { return m_shapes.size(); } boost::shared_ptr<const PMDLineSet> getShape(unsigned i) const { return m_shapes.at(i); } void emitYaml(yaml_emitter_t *emitter) const { yamlIndirectForeach(emitter, "shapes", m_shapes); } }; } /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
#pragma once #include "geometry.h" #include "yaml_utils.h" #include <vector> #include <boost/shared_ptr.hpp> #include <librevenge/librevenge.h> namespace libpagemaker { class PMDPage { std::vector<boost::shared_ptr<PMDLineSet> > m_shapes; public: PMDPage() : m_shapes() { } void addShape(boost::shared_ptr<PMDLineSet> shape) { m_shapes.push_back(shape); } unsigned numShapes() const { return m_shapes.size(); } boost::shared_ptr<const PMDLineSet> getShape(unsigned i) const { return m_shapes.at(i); } void emitYaml(yaml_emitter_t *emitter) const { yamlBeginMap(emitter); yamlIndirectForeach(emitter, "shapes", m_shapes); yamlEndMap(emitter); } }; } /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Fix bug in shape yaml emit
Fix bug in shape yaml emit
C
mpl-2.0
umanwizard/libpagemaker,umanwizard/libpagemaker,umanwizard/libpagemaker,anuragkanungo/libpagemaker,anuragkanungo/libpagemaker,anuragkanungo/libpagemaker,anuragkanungo/libpagemaker,umanwizard/libpagemaker,umanwizard/libpagemaker
8d672cf0cf6df3dc43413663063e7309f30a93f6
HTMLKit/CSSStructuralPseudoSelectors.h
HTMLKit/CSSStructuralPseudoSelectors.h
// // CSSStructuralPseudoSelector.h // HTMLKit // // Created by Iska on 11/10/15. // Copyright © 2015 BrainCookie. All rights reserved. // @class CSSSelector; NS_ASSUME_NONNULL_BEGIN extern CSSSelector * rootSelector(); extern CSSSelector * emptySelector(); extern CSSSelector * parentSelector(); extern CSSSelector * buttonSelector(); extern CSSSelector * checkboxSelector(); extern CSSSelector * fileSelector(); extern CSSSelector * headerSelector(); extern CSSSelector * imageSelector(); extern CSSSelector * inputSelector(); extern CSSSelector * linkSelector(); extern CSSSelector * passwordSelector(); extern CSSSelector * radioSelector(); extern CSSSelector * resetSelector(); extern CSSSelector * submitSelector(); extern CSSSelector * textSelector(); extern CSSSelector * enabledSelector(); extern CSSSelector * disabledSelector(); extern CSSSelector * checkedSelector(); extern CSSSelector * optionalSelector(); extern CSSSelector * requiredSelector(); extern CSSSelector * ltSelector(); extern CSSSelector * gtSelector(); extern CSSSelector * eqSelector(); NS_ASSUME_NONNULL_END
// // CSSStructuralPseudoSelector.h // HTMLKit // // Created by Iska on 11/10/15. // Copyright © 2015 BrainCookie. All rights reserved. // @class CSSSelector; NS_ASSUME_NONNULL_BEGIN extern CSSSelector * rootSelector(); extern CSSSelector * emptySelector(); extern CSSSelector * parentSelector(); extern CSSSelector * buttonSelector(); extern CSSSelector * checkboxSelector(); extern CSSSelector * fileSelector(); extern CSSSelector * headerSelector(); extern CSSSelector * imageSelector(); extern CSSSelector * inputSelector(); extern CSSSelector * linkSelector(); extern CSSSelector * passwordSelector(); extern CSSSelector * radioSelector(); extern CSSSelector * resetSelector(); extern CSSSelector * submitSelector(); extern CSSSelector * textSelector(); extern CSSSelector * enabledSelector(); extern CSSSelector * disabledSelector(); extern CSSSelector * checkedSelector(); extern CSSSelector * optionalSelector(); extern CSSSelector * requiredSelector(); extern CSSSelector * ltSelector(NSUInteger index); extern CSSSelector * gtSelector(NSUInteger index); extern CSSSelector * eqSelector(NSInteger index); NS_ASSUME_NONNULL_END
Fix "lt", "gt" & "eq"-selectors declarations
Fix "lt", "gt" & "eq"-selectors declarations Added missing index argument
C
mit
iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit,iabudiab/HTMLKit
9f2b03bc934409144841acb496c9067230bcdb56
src/rlc_parameters.h
src/rlc_parameters.h
// 3GPP LTE RLC: 4G Radio Link Control protocol interface // Parameters for RLC AM const char *const rlc_parameter_names[] = { /* RLC mode AM/UM/TM */ "rlc/mode", /* AM */ "maxRetxThreshold", "amWindowSize", "pollPDU", "pollByte", "t-StatusProhibit", "t-PollRetransmit", /* AM & UM */ "t-Reordering", /* UM */ "SN-FieldLength.rx", "SN-FieldLength.tx", /* PDCP */ "headerCompression", "pdcp-SN-Size", "statusReportRequired", "discardTimer", "maxCID", "profiles", "pdcp/t-Reordering", "", NULL };
// 3GPP LTE RLC: 4G Radio Link Control protocol interface // Parameters for RLC AM const char *const rlc_parameter_names[] = { /* RLC mode AM/UM/TM */ "rlc/mode", "rlc/debug", /* AM */ "maxRetxThreshold", "amWindowSize", "pollPDU", "pollByte", "t-StatusProhibit", "t-PollRetransmit", /* AM & UM */ "t-Reordering", /* UM */ "SN-FieldLength.rx", "SN-FieldLength.tx", /* PDCP */ "headerCompression", "pdcp-SN-Size", "statusReportRequired", "discardTimer", "maxCID", "profiles", "pdcp/t-Reordering", "", NULL };
Add rlc/debug to parameter list
Add rlc/debug to parameter list
C
agpl-3.0
mmtorni/HamLTE,mmtorni/HamLTE,mmtorni/HamLTE
3b7d65ec21a63ce20fd93970f1fdf20a41d36ff4
include/Common.h
include/Common.h
#ifndef COMMON_H_INCLUDED #define COMMON_H_INCLUDED #include <string> #include <vector> #include <numeric> #include <iostream> #include "../include/Console.h" // Common functions and data to share across all files. namespace Common { void ClearScreen(); int input(); void ColourPrint(std::string, Console::EColour colour); void Sleep(int ms); int RandomInt(int min, int max); template <typename T> T RandomEvent(std::vector<int> weights, std::vector<T> outcomes) { std::vector <int> events; int k = 0; for (auto it : weights) { for (int i = 0; i < it; i++) { events.push_back(k); } k++; } int denominator = std::accumulate(weights.begin(), weights.end(), 0); int rIndex = Common::RandomInt(0, denominator-1); int outIndex = events.at(rIndex); return outcomes.at(outIndex); } // Indicates if the game is still going. extern bool IsPlaying; extern const int SLEEP_MS; // Number of items held in inventory. extern const int NUM_ITEMS; } #endif // COMMON_H_INCLUDED
#ifndef COMMON_H_INCLUDED #define COMMON_H_INCLUDED #include <string> #include <vector> #include <numeric> #include <iostream> #include "../include/Console.h" // Common functions and data to share across all files. namespace Common { void ClearScreen(); int input(); void ColourPrint(std::string, Console::EColour colour); void Sleep(int ms); int RandomInt(int min, int max); template <typename T> T RandomEvent(std::vector<int> weights, std::vector<T> outcomes) { std::vector <int> indices; int index = 0; // The possible indices for the outcomes vector for (int weight : weights) { for (int i = 0; i < weight; i++) { indices.push_back(index); } index++; } int randomIndex = indices.at(RandomInt(0, indices.size()-1)); return outcomes.at(randomIndex); } // Indicates if the game is still going. extern bool IsPlaying; extern const int SLEEP_MS; // Number of items held in inventory. extern const int NUM_ITEMS; } #endif // COMMON_H_INCLUDED
Improve style and naming conventions
Improve style and naming conventions
C
mit
tagniam/Turn,tagniam/Turn
6852c616edf9fc7ff27e8367d7f72a5d88f32d8c
test/CFrontend/2007-03-27-VarLengthArray.c
test/CFrontend/2007-03-27-VarLengthArray.c
// RUN: %llvmgcc -S %s -o - | grep {getelementptr i32} extern void f(int *); int e(int m, int n) { int x[n]; f(x); return x[m]; }
Test code quality for variable length array references.
Test code quality for variable length array references. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@36163 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm
91412760f32ac1a5ef02e6c9d99218b1539c4142
Pod/Classes/KVOMutableArray.h
Pod/Classes/KVOMutableArray.h
#import <Foundation/Foundation.h> #import "NSObject+BlockObservation.h" @interface KVOMutableArray : NSMutableArray<NSFastEnumeration, NSMutableCopying, NSCoding, NSCopying> - (NSMutableArray*)arr; - (instancetype)init; - (instancetype)initWithMutableArray:(NSMutableArray*)array NS_DESIGNATED_INITIALIZER; - (BOOL)isEqualToArray:(KVOMutableArray*)array; - (AMBlockToken*)addObserverWithTask:(AMBlockTask)task; // Warning!! [NSKeyedUnarchiver unarchiveObject] will return NSMutableArray // see http://stackoverflow.com/questions/18874493/nsmutablearray-subclass-not-calling-subclasss-initwithcoder-when-unarchiving - (void)encodeWithCoder:(NSCoder *)encoder; // Warning!! [kvoMutableArray copy] may return NSArray - (id)copyWithZone:(NSZone *)zone; @end
#import <Foundation/Foundation.h> #import "NSObject+BlockObservation.h" @interface KVOMutableArray<ObjectType> : NSMutableArray<NSFastEnumeration, NSMutableCopying, NSCoding, NSCopying> - (NSMutableArray*)arr; - (instancetype)init; - (instancetype)initWithMutableArray:(NSMutableArray*)array NS_DESIGNATED_INITIALIZER; - (BOOL)isEqualToArray:(KVOMutableArray*)array; - (AMBlockToken*)addObserverWithTask:(AMBlockTask)task; // Warning!! [NSKeyedUnarchiver unarchiveObject] will return NSMutableArray // see http://stackoverflow.com/questions/18874493/nsmutablearray-subclass-not-calling-subclasss-initwithcoder-when-unarchiving - (void)encodeWithCoder:(NSCoder *)encoder; // Warning!! [kvoMutableArray copy] may return NSArray - (id)copyWithZone:(NSZone *)zone; @end
Add type arguments support :)
Add type arguments support :)
C
mit
haifengkao/KVOMutableArray,haifengkao/KVOMutableArray,haifengkao/KVOMutableArray,haifengkao/KVOMutableArray
fd7e4076eb0b2a6aef74d3cca22f08d395b07281
chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.h
chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_AURA_CHROME_BROWSER_MAIN_EXTRA_PARTS_AURA_H_ #define CHROME_BROWSER_UI_AURA_CHROME_BROWSER_MAIN_EXTRA_PARTS_AURA_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/chrome_browser_main_extra_parts.h" namespace aura { class DesktopStackingClient; } class ChromeBrowserMainExtraPartsAura : public ChromeBrowserMainExtraParts { public: ChromeBrowserMainExtraPartsAura(); virtual ~ChromeBrowserMainExtraPartsAura(); // Overridden from ChromeBrowserMainExtraParts: virtual void PreProfileInit() OVERRIDE; virtual void PostMainMessageLoopRun() OVERRIDE; private: scoped_ptr<views::DesktopStackingClient> stacking_client_; DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsAura); }; #endif // CHROME_BROWSER_UI_AURA_CHROME_BROWSER_MAIN_EXTRA_PARTS_AURA_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_AURA_CHROME_BROWSER_MAIN_EXTRA_PARTS_AURA_H_ #define CHROME_BROWSER_UI_AURA_CHROME_BROWSER_MAIN_EXTRA_PARTS_AURA_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/chrome_browser_main_extra_parts.h" namespace views { class DesktopStackingClient; } class ChromeBrowserMainExtraPartsAura : public ChromeBrowserMainExtraParts { public: ChromeBrowserMainExtraPartsAura(); virtual ~ChromeBrowserMainExtraPartsAura(); // Overridden from ChromeBrowserMainExtraParts: virtual void PreProfileInit() OVERRIDE; virtual void PostMainMessageLoopRun() OVERRIDE; private: scoped_ptr<views::DesktopStackingClient> stacking_client_; DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsAura); }; #endif // CHROME_BROWSER_UI_AURA_CHROME_BROWSER_MAIN_EXTRA_PARTS_AURA_H_
Revert 167434 - build fix
Revert 167434 - build fix [email protected] Review URL: https://chromiumcodereview.appspot.com/11366227 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@167442 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
hujiajie/pa-chromium,Fireblend/chromium-crosswalk,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,chuan9/chromium-crosswalk,markYoungH/chromium.src,zcbenz/cefode-chromium,patrickm/chromium.src,Chilledheart/chromium,ltilve/chromium,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,Jonekee/chromium.src,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,Chilledheart/chromium,nacl-webkit/chrome_deps,hujiajie/pa-chromium,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,ltilve/chromium,jaruba/chromium.src,fujunwei/chromium-crosswalk,Chilledheart/chromium,nacl-webkit/chrome_deps,Jonekee/chromium.src,Chilledheart/chromium,jaruba/chromium.src,jaruba/chromium.src,bright-sparks/chromium-spacewalk,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,anirudhSK/chromium,anirudhSK/chromium,bright-sparks/chromium-spacewalk,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,ltilve/chromium,zcbenz/cefode-chromium,anirudhSK/chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,patrickm/chromium.src,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,dushu1203/chromium.src,littlstar/chromium.src,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,Fireblend/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,Fireblend/chromium-crosswalk,nacl-webkit/chrome_deps,anirudhSK/chromium,dushu1203/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,dednal/chromium.src,timopulkkinen/BubbleFish,dushu1203/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,fujunwei/chromium-crosswalk,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,dednal/chromium.src,axinging/chromium-crosswalk,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,M4sse/chromium.src,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,anirudhSK/chromium,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,jaruba/chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,ChromiumWebApps/chromium,M4sse/chromium.src,ChromiumWebApps/chromium,patrickm/chromium.src,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,markYoungH/chromium.src,littlstar/chromium.src,axinging/chromium-crosswalk,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,dushu1203/chromium.src,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,Just-D/chromium-1,timopulkkinen/BubbleFish,dednal/chromium.src,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,anirudhSK/chromium,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,zcbenz/cefode-chromium,dushu1203/chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,ltilve/chromium,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,dednal/chromium.src,anirudhSK/chromium,M4sse/chromium.src,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,anirudhSK/chromium,M4sse/chromium.src,dednal/chromium.src,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,Jonekee/chromium.src,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,Just-D/chromium-1,Chilledheart/chromium,markYoungH/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,zcbenz/cefode-chromium,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,littlstar/chromium.src,markYoungH/chromium.src,zcbenz/cefode-chromium,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,Chilledheart/chromium,dushu1203/chromium.src,anirudhSK/chromium,fujunwei/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,mogoweb/chromium-crosswalk,dednal/chromium.src,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,ChromiumWebApps/chromium,Jonekee/chromium.src,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,ltilve/chromium,ondra-novak/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,zcbenz/cefode-chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,littlstar/chromium.src,dednal/chromium.src,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,Fireblend/chromium-crosswalk,ltilve/chromium,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,markYoungH/chromium.src,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,hujiajie/pa-chromium,hujiajie/pa-chromium,jaruba/chromium.src,mogoweb/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,dednal/chromium.src,patrickm/chromium.src,nacl-webkit/chrome_deps
ee1c651b874656b27267266797d6fb693764c621
BBBAPI/BBBAPI/Classes/BBAAPIErrors.h
BBBAPI/BBBAPI/Classes/BBAAPIErrors.h
// // BBAAPIErrors.h // BBAAPI // // Created by Owen Worley on 11/08/2014. // Copyright (c) 2014 Blinkbox Books. All rights reserved. // NS_ENUM(NSInteger, BBAAPIError) { /** * Used when needed parameter is not supplied to the method * or when object is supplied but it has wrong type or * for example one of it's needed properties is not set */ BBAAPIWrongUsage = 700, /** * Error returned when for any reason API call cannot connect to the server */ BBAAPIErrorCouldNotConnect = 701, /** * Returned when call cannot be authenticated, or when server returns 401 */ BBAAPIErrorUnauthorised = 702, /** * Used when server cannot find a resource and returns 404 */ BBAAPIErrorNotFound = 703, /** * Used when server returns 500 */ BBAAPIServerError = 704, /** * Used when server returns 403 */ BBAAPIErrorForbidden = 705, /** * Used when we cannot decode or read data returned from the server */ BBAAPIUnreadableData = 706, /** * Used when the server returns a 400 (Bad Request) */ BBAAPIBadRequest = 707, };
// // BBAAPIErrors.h // BBAAPI // // Created by Owen Worley on 11/08/2014. // Copyright (c) 2014 Blinkbox Books. All rights reserved. // NS_ENUM(NSInteger, BBAAPIError) { /** * Used when needed parameter is not supplied to the method * or when object is supplied but it has wrong type or * for example one of it's needed properties is not set */ BBAAPIWrongUsage = 700, /** * Error returned when for any reason API call cannot connect to the server */ BBAAPIErrorCouldNotConnect = 701, /** * Returned when call cannot be authenticated, or when server returns 401 */ BBAAPIErrorUnauthorised = 702, /** * Used when server cannot find a resource and returns 404 */ BBAAPIErrorNotFound = 703, /** * Used when server returns 500 */ BBAAPIServerError = 704, /** * Used when server returns 403 */ BBAAPIErrorForbidden = 705, /** * Used when we cannot decode or read data returned from the server */ BBAAPIUnreadableData = 706, /** * Used when the server returns a 400 (Bad Request) */ BBAAPIErrorBadRequest = 707, /** * Used when the server returns a 409 (Conflict) */ BBAAPIErrorConflict = 708, };
Add BBAAPIError code for 409 conflict
Add BBAAPIError code for 409 conflict
C
mit
blinkboxbooks/blinkbox-network.objc,blinkboxbooks/blinkbox-network.objc
93c6f1cc5f73223cdd9f68d765a241188ae8d009
socket.h
socket.h
#include "main.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <errno.h> #include <cstdio>
#include "main.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <arpa/nameser.h> #include <netdb.h> #include <resolv.h> #include <errno.h> #include <cstdio>
Include a couple more important headers.
Include a couple more important headers.
C
mit
ElementalAlchemist/RoBoBo,ElementalAlchemist/RoBoBo
40682086fa8c772523e418515969038aa6deca29
PWG3/PWG3LinkDef.h
PWG3/PWG3LinkDef.h
#ifdef __CINT__ #pragma link off all glols; #pragma link off all classes; #pragma link off all functions; #endif
#ifdef __CINT__ #pragma link off all glols; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class AliD0toKpi+; #pragma link C++ class AliD0toKpiAnalysis+; #pragma link C++ class AliBtoJPSItoEle+; #pragma link C++ class AliBtoJPSItoEleAnalysis+; #endif
Move AliD0toKpi* and AliBtoJPSI* from libPWG3base to libPWG3 (Andrea)
Move AliD0toKpi* and AliBtoJPSI* from libPWG3base to libPWG3 (Andrea)
C
bsd-3-clause
ecalvovi/AliRoot,alisw/AliRoot,sebaleh/AliRoot,alisw/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,mkrzewic/AliRoot,miranov25/AliRoot,coppedis/AliRoot,coppedis/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,shahor02/AliRoot,jgrosseo/AliRoot,miranov25/AliRoot,miranov25/AliRoot,alisw/AliRoot,coppedis/AliRoot,ALICEHLT/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,jgrosseo/AliRoot,coppedis/AliRoot,mkrzewic/AliRoot,ALICEHLT/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,ecalvovi/AliRoot,coppedis/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,shahor02/AliRoot,sebaleh/AliRoot,mkrzewic/AliRoot,alisw/AliRoot,jgrosseo/AliRoot,ecalvovi/AliRoot,shahor02/AliRoot,mkrzewic/AliRoot,sebaleh/AliRoot,shahor02/AliRoot,miranov25/AliRoot,shahor02/AliRoot,alisw/AliRoot,ecalvovi/AliRoot,ALICEHLT/AliRoot,mkrzewic/AliRoot,jgrosseo/AliRoot,mkrzewic/AliRoot,alisw/AliRoot,jgrosseo/AliRoot,coppedis/AliRoot,jgrosseo/AliRoot,ALICEHLT/AliRoot,coppedis/AliRoot,alisw/AliRoot,ecalvovi/AliRoot,shahor02/AliRoot,shahor02/AliRoot,miranov25/AliRoot,mkrzewic/AliRoot,sebaleh/AliRoot,miranov25/AliRoot,jgrosseo/AliRoot,ALICEHLT/AliRoot
63d54af34ad17a158024b9c139b33253cc645274
SWSheetController.h
SWSheetController.h
// // PMDisplaySheet.h // This file is part of the "SWApplicationSupport" project, and is distributed under the MIT License. // // Created by Samuel Williams on 10/07/05. // Copyright 2005 Samuel Williams. All rights reserved. // #import <Cocoa/Cocoa.h> @class SWSheetController; @protocol SWSheetDelegate - (void) sheetController: (SWSheetController*)controller didEndWithResult:(NSInteger) result; @end @interface SWSheetController : NSWindowController @property(nonatomic,strong) IBOutlet NSWindow * parent; @property(nonatomic,unsafe_unretained) id delegate; // Override this to perform setup of the sheet before it is used: - (void)prepareSheet; // Override this to return the name of the nib that contains the sheet - (NSString *) nibName; - (IBAction) showSheet: (id)sender; - (IBAction) cancelSheet: (id) sender; - (IBAction) processSheet: (id) sender; - (void) sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(id)contextInfo; /* Convenience function */ @property (nonatomic, readonly, strong) NSManagedObjectContext *managedObjectContext; @end @interface NSObject (SWSheetControllerDelegate) - (void) sheetController: (SWSheetController*)controller didEndWithResult:(NSInteger) result; @end
// // PMDisplaySheet.h // This file is part of the "SWApplicationSupport" project, and is distributed under the MIT License. // // Created by Samuel Williams on 10/07/05. // Copyright 2005 Samuel Williams. All rights reserved. // #import <Cocoa/Cocoa.h> @class SWSheetController; @protocol SWSheetDelegate - (void) sheetController: (SWSheetController*)controller didEndWithResult:(NSInteger) result; @end @interface SWSheetController : NSWindowController @property(nonatomic,strong) IBOutlet NSWindow * parent; @property(nonatomic,unsafe_unretained) id delegate; // Override this to perform setup of the sheet before it is used: - (void)prepareSheet; // Override this to return the name of the nib that contains the sheet - (NSString *) nibName; - (IBAction) showSheet: (id)sender; - (IBAction) cancelSheet: (id) sender; - (IBAction) processSheet: (id) sender; - (void) sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(id)contextInfo; /* Convenience function */ - (NSManagedObjectContext *)managedObjectContext; @end @interface NSObject (SWSheetControllerDelegate) - (void) sheetController: (SWSheetController*)controller didEndWithResult:(NSInteger) result; @end
Revert back to method, since it's not strictly a getter.
Revert back to method, since it's not strictly a getter.
C
mit
oriontransfer/SWApplicationSupport
d1320f5b3bf39c62adf5280161335d58e22e1ea9
UIforETW/Version.h
UIforETW/Version.h
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. constexpr float kCurrentVersion = 1.55f; // Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version // increment that won't trigger the new-version checks, handy for minor // releases that I don't want to bother users about. //#define VERSION_SUFFIX 'b'
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. // constexpr might help avoid that, but then it breaks my fragile upgrade-needed // detection code, so this should be left as const. const float kCurrentVersion = 1.55f; // Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version // increment that won't trigger the new-version checks, handy for minor // releases that I don't want to bother users about. //#define VERSION_SUFFIX 'b'
Revert constexpr so that upgrade detection works
Revert constexpr so that upgrade detection works
C
apache-2.0
google/UIforETW,google/UIforETW,google/UIforETW,google/UIforETW
a7e4029b1f08c6f2cfbc66eb89e30aec79f2eeed
BStream.h
BStream.h
#ifndef TUVOK_BSTREAM_H #define TUVOK_BSTREAM_H #include <cstdlib> struct BStreamDescriptor { uint64_t elements; ///< number of elements in the stream size_t components; size_t width; ///< byte width bool is_signed; bool fp; ///< is it floating point? bool big_endian; size_t timesteps; }; #endif /* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2012 Scientific Computing and Imaging Institute, Interactive Visualization and Data Analysis Group. 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. */
Add a descriptor for binary streams.
Add a descriptor for binary streams. git-svn-id: 0a20d38d1bcdb3210d244a647211d61b0aabf366@266 5b8196f7-c1c0-4be6-8b13-4feed349168d
C
mit
BlueBrain/Tuvok,BlueBrain/Tuvok,BlueBrain/Tuvok
20e1c433e05c7147af5c267e0e0a38a781a6efb4
thrust/detail/config/cpp_dialect.h
thrust/detail/config/cpp_dialect.h
/* * Copyright 2018 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #if __cplusplus < 201103L #define THRUST_CPP03 #define THRUST_CPP_DIALECT 2003 #elif __cplusplus < 201402L #define THRUST_CPP11 #define THRUST_CPP_DIALECT 2011 #elif __cplusplus < 201703L #define THRUST_CPP14 #define THRUST_CPP_DIALECT 2014 #else #define THRUST_CPP17 #define THRUST_CPP_DIALECT 2017 #endif
/* * Copyright 2018 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #ifdef _MSC_VER #define THRUST_CPP_VER _MSVC_LANG #else #define THRUST_CPP_VER __cplusplus #endif #if THRUST_CPP_VER < 201103L #define THRUST_CPP03 #define THRUST_CPP_DIALECT 2003 #elif THRUST_CPP_VER < 201402L #define THRUST_CPP11 #define THRUST_CPP_DIALECT 2011 #elif THRUST_CPP_VER < 201703L #define THRUST_CPP14 #define THRUST_CPP_DIALECT 2014 #else #define THRUST_CPP17 #define THRUST_CPP_DIALECT 2017 #endif #undef THRUST_CPP_VER
Handle MSVC's definition of __cplusplus
Handle MSVC's definition of __cplusplus MSVC doesnt define __cplusplus correctly unless a compiler flag is passed (/Zc:__cplusplus) but _MSVC_LANG is defined correctly. To avoid users needing to pass an extra compile flag, I suggest we handle it in the cpp_dialect.h file
C
apache-2.0
thrust/thrust,jaredhoberock/thrust,jaredhoberock/thrust,thrust/thrust,jaredhoberock/thrust,jaredhoberock/thrust,jaredhoberock/thrust,thrust/thrust,andrewcorrigan/thrust-multi-permutation-iterator,andrewcorrigan/thrust-multi-permutation-iterator,thrust/thrust,thrust/thrust,andrewcorrigan/thrust-multi-permutation-iterator
b928ab3a7fdbbd3e29f555b1c2b840ffe310f50b
Library/JCNotificationBanner.h
Library/JCNotificationBanner.h
#import <Foundation/Foundation.h> typedef void (^JCNotificationBannerTapHandlingBlock)(); @interface JCNotificationBanner : NSObject @property (nonatomic) NSString* title; @property (nonatomic) NSString* message; @property (nonatomic, strong) JCNotificationBannerTapHandlingBlock tapHandler; - (JCNotificationBanner*) initWithTitle:(NSString*)title message:(NSString*)message tapHandler:(JCNotificationBannerTapHandlingBlock)tapHandler; @end
#import <Foundation/Foundation.h> typedef void (^JCNotificationBannerTapHandlingBlock)(); @interface JCNotificationBanner : NSObject @property (nonatomic) NSString* title; @property (nonatomic) NSString* message; @property (nonatomic, copy) JCNotificationBannerTapHandlingBlock tapHandler; - (JCNotificationBanner*) initWithTitle:(NSString*)title message:(NSString*)message tapHandler:(JCNotificationBannerTapHandlingBlock)tapHandler; @end
Set ARC property semantics to "copy" for block.
Set ARC property semantics to "copy" for block. It seems that ARC should be copying automatically when assigning to a "strong" property of a block type, and this generally appears to be working. But there also appears to be a bug in certain compiler versions in which release mode contains optimizations which do not copy the block as expected (thus leading to an EXC_BAD_ACCESS.) See http://stackoverflow.com/questions/12061756/blocks-and-arc-copy-or-crash-with-release-build-caused-by-optimization-level for more information.
C
mit
jcoleman/JCNotificationBannerPresenter,bobqian1130/JCNotificationBannerPresenter,mitchellporter/JCNotificationBannerPresenter
25f42985825dd93f0593efe454e54c2aa13f7830
arch/x86/lib/usercopy.c
arch/x86/lib/usercopy.c
/* * User address space access functions. * * For licencing details see kernel-base/COPYING */ #include <linux/highmem.h> #include <linux/module.h> #include <asm/word-at-a-time.h> #include <linux/sched.h> /* * best effort, GUP based copy_from_user() that is NMI-safe */ unsigned long copy_from_user_nmi(void *to, const void __user *from, unsigned long n) { unsigned long offset, addr = (unsigned long)from; unsigned long size, len = 0; struct page *page; void *map; int ret; if (__range_not_ok(from, n, TASK_SIZE) == 0) return len; do { ret = __get_user_pages_fast(addr, 1, 0, &page); if (!ret) break; offset = addr & (PAGE_SIZE - 1); size = min(PAGE_SIZE - offset, n - len); map = kmap_atomic(page); memcpy(to, map+offset, size); kunmap_atomic(map); put_page(page); len += size; to += size; addr += size; } while (len < n); return len; } EXPORT_SYMBOL_GPL(copy_from_user_nmi);
/* * User address space access functions. * * For licencing details see kernel-base/COPYING */ #include <linux/highmem.h> #include <linux/module.h> #include <asm/word-at-a-time.h> #include <linux/sched.h> /* * best effort, GUP based copy_from_user() that is NMI-safe */ unsigned long copy_from_user_nmi(void *to, const void __user *from, unsigned long n) { unsigned long offset, addr = (unsigned long)from; unsigned long size, len = 0; struct page *page; void *map; int ret; if (__range_not_ok(from, n, TASK_SIZE)) return len; do { ret = __get_user_pages_fast(addr, 1, 0, &page); if (!ret) break; offset = addr & (PAGE_SIZE - 1); size = min(PAGE_SIZE - offset, n - len); map = kmap_atomic(page); memcpy(to, map+offset, size); kunmap_atomic(map); put_page(page); len += size; to += size; addr += size; } while (len < n); return len; } EXPORT_SYMBOL_GPL(copy_from_user_nmi);
Fix broken LBR fixup code
perf/x86: Fix broken LBR fixup code I noticed that the LBR fixups were not working anymore on programs where they used to. I tracked this down to a recent change to copy_from_user_nmi(): db0dc75d640 ("perf/x86: Check user address explicitly in copy_from_user_nmi()") This commit added a call to __range_not_ok() to the copy_from_user_nmi() routine. The problem is that the logic of the test must be reversed. __range_not_ok() returns 0 if the range is VALID. We want to return early from copy_from_user_nmi() if the range is NOT valid. Signed-off-by: Stephane Eranian <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Acked-by: Arun Sharma <[email protected]> Link: 456f892a31581d7b07f7474f53a32b17b8649829@quad Signed-off-by: Ingo Molnar <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
9e2888609cbee2b693f5b54809d558981006b462
test/CFrontend/2005-02-27-MarkGlobalConstant.c
test/CFrontend/2005-02-27-MarkGlobalConstant.c
// RUN: %llvmgcc -xc %s -S -o - | grep 'ctor_.* constant ' // The synthetic global made by the CFE for big initializer should be marked // constant. void bar(); void foo() { char Blah[] = "asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd"; bar(Blah); }
Test that a global is marked constant when it can be.
Test that a global is marked constant when it can be. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@20349 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap
4b516c3c5a41476be8b4ede752eea260879a0602
includes/StackAllocator.h
includes/StackAllocator.h
#ifndef STACKALLOCATOR_H #define STACKALLOCATOR_H #include "Allocator.h" class StackAllocator : public Allocator { protected: void* m_start_ptr; std::size_t m_offset; public: StackAllocator(const std::size_t totalSize); virtual ~StackAllocator(); virtual void* Allocate(const std::size_t size, const short alignment = 0); virtual void Free(const std::size_t size); virtual void Init() override; private: StackAllocator(StackAllocator &stackAllocator); struct AllocationHeader { char padding; }; }; #endif /* STACKALLOCATOR_H */
#ifndef STACKALLOCATOR_H #define STACKALLOCATOR_H #include "Allocator.h" class StackAllocator : public Allocator { protected: void* m_start_ptr; std::size_t m_offset; public: StackAllocator(const std::size_t totalSize); virtual ~StackAllocator(); virtual void* Allocate(const std::size_t size, const short alignment = 0); virtual void Free(void* ptr); virtual void Init() override; private: StackAllocator(StackAllocator &stackAllocator); struct AllocationHeader { unsigned short padding; }; }; #endif /* STACKALLOCATOR_H */
Change allocation header member padding type from char to unsigned short
Change allocation header member padding type from char to unsigned short
C
mit
mtrebi/memory-allocators
309368435839be91ebbf874ea00c2d5acb6b9c9e
src/readstat_io.h
src/readstat_io.h
int readstat_open(const char *filename); int readstat_close(int fd); #ifdef _AIX off64_t readstat_lseek(int fildes, off64_t offset, int whence); #else off_t readstat_lseek(int fildes, off_t offset, int whence); #endif readstat_error_t readstat_update_progress(int fd, size_t file_size, readstat_progress_handler progress_handler, void *user_ctx);
int readstat_open(const char *filename); int readstat_close(int fd); #if defined _WIN32 || defined __CYGWIN__ _off64_t readstat_lseek(int fildes, _off64_t offset, int whence); #elif defined _AIX off64_t readstat_lseek(int fildes, off64_t offset, int whence); #else off_t readstat_lseek(int fildes, off_t offset, int whence); #endif readstat_error_t readstat_update_progress(int fd, size_t file_size, readstat_progress_handler progress_handler, void *user_ctx);
Update readstat_lseek header signature on Windows
Update readstat_lseek header signature on Windows
C
mit
ivarref/ReadStat,ivarref/ReadStat,WizardMac/ReadStat,WizardMac/ReadStat
88cf4c93e1fb0a39a2226abe4c869371ef0c6393
ghighlighter/main.c
ghighlighter/main.c
#include <stdlib.h> #include <pwd.h> #include <string.h> #include <gtk/gtk.h> #include "gh-main-window.h" char * data_dir_path () { uid_t uid = getuid (); struct passwd *pw = getpwuid (uid); char *home_dir = pw->pw_dir; char *data_dir = "/.ghighlighter-c"; int length = strlen (home_dir); length = length + strlen (data_dir); char *result = malloc (length + sizeof (char)); strcat (result, home_dir); strcat (result, data_dir); return result; } int main (int argc, char *argv[]) { char *data_dir = data_dir_path (); free (data_dir); GtkWidget *window; gtk_init (&argc, &argv); window = gh_main_window_create (); gtk_widget_show_all (window); gtk_main (); return 0; }
#include <stdlib.h> #include <pwd.h> #include <string.h> #include <sys/stat.h> #include <gtk/gtk.h> #include "gh-main-window.h" char * data_dir_path () { uid_t uid = getuid (); struct passwd *pw = getpwuid (uid); char *home_dir = pw->pw_dir; char *data_dir = "/.ghighlighter-c"; int length = strlen (home_dir); length = length + strlen (data_dir); char *result = malloc (length + sizeof (char)); strcat (result, home_dir); strcat (result, data_dir); return result; } void setup_environment (char *data_dir) { mkdir (data_dir, 0755); } int main (int argc, char *argv[]) { char *data_dir = data_dir_path (); setup_environment (data_dir); free (data_dir); GtkWidget *window; gtk_init (&argc, &argv); window = gh_main_window_create (); gtk_widget_show_all (window); gtk_main (); return 0; }
Create data directory on startup
Create data directory on startup
C
mit
chdorner/ghighlighter-c
d3bc899d9bc4ccc22e4e1cf831e351f7441eed03
Sources/BCObjectModeling.h
Sources/BCObjectModeling.h
// // BCObjectModeling.h // ClearCostMobile // // Created by Seth Kingsley on 2/6/13. // Copyright (c) 2013 Monkey Republic Design, LLC. All rights reserved. // #import <Foundation/Foundation.h> @class RKObjectMapping, RKObjectManager; @protocol BCObjectModeling <NSObject> + (RKObjectMapping *)objectMapping; + (void)registerWithObjectManager:(RKObjectManager *)objectManager; @end
Add a protocol for exposing RestKit object mapping and request information with the model implementations.
Add a protocol for exposing RestKit object mapping and request information with the model implementations.
C
bsd-3-clause
sethk/BushidoCore
b212ab9ea21a093ba8fa9895e723bc76b84cf284
common/alcomplex.h
common/alcomplex.h
#ifndef ALCOMPLEX_H #define ALCOMPLEX_H #include <complex> #include "alspan.h" /** * Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is * FFT and 1 is iFFT (inverse). Fills the buffer with the Discrete Fourier * Transform (DFT) of the time domain data stored in the buffer. The buffer is * an array of complex numbers, and MUST BE power of two. */ void complex_fft(const al::span<std::complex<double>> buffer, const double sign); /** * Calculate the complex helical sequence (discrete-time analytical signal) of * the given input using the discrete Hilbert transform (In-place algorithm). * Fills the buffer with the discrete-time analytical signal stored in the * buffer. The buffer is an array of complex numbers and MUST BE power of two. */ void complex_hilbert(const al::span<std::complex<double>> buffer); #endif /* ALCOMPLEX_H */
#ifndef ALCOMPLEX_H #define ALCOMPLEX_H #include <complex> #include "alspan.h" /** * Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is * FFT and 1 is iFFT (inverse). Fills the buffer with the Discrete Fourier * Transform (DFT) of the time domain data stored in the buffer. The buffer is * an array of complex numbers, and MUST BE power of two. */ void complex_fft(const al::span<std::complex<double>> buffer, const double sign); /** * Calculate the complex helical sequence (discrete-time analytical signal) of * the given input using the discrete Hilbert transform (In-place algorithm). * Fills the buffer with the discrete-time analytical signal stored in the * buffer. The buffer is an array of complex numbers and MUST BE power of two, * and the imaginary components should be cleared to 0. */ void complex_hilbert(const al::span<std::complex<double>> buffer); #endif /* ALCOMPLEX_H */
Add a note about clearing complex_hilbert's imaginary input
Add a note about clearing complex_hilbert's imaginary input
C
lgpl-2.1
aaronmjacobs/openal-soft,aaronmjacobs/openal-soft
29ce3458d8474870805dd1439cf857d19519bfb1
crypto/engine/eng_all.c
crypto/engine/eng_all.c
/* * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include "internal/cryptlib.h" #include "eng_int.h" void ENGINE_load_builtin_engines(void) { /* Some ENGINEs need this */ OPENSSL_cpuid_setup(); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL); } #if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)) \ && !OPENSSL_API_1_1_0 void ENGINE_setup_bsd_cryptodev(void) { } #endif
/* * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include "internal/cryptlib.h" #include "eng_int.h" void ENGINE_load_builtin_engines(void) { OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL); } #if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)) \ && !OPENSSL_API_1_1_0 void ENGINE_setup_bsd_cryptodev(void) { } #endif
Remove superfluous call to OPENSSL_cpuid_setup
Remove superfluous call to OPENSSL_cpuid_setup Signed-off-by: Patrick Steuer <[email protected]> Reviewed-by: Kurt Roeckx <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from https://github.com/openssl/openssl/pull/9417)
C
apache-2.0
openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl
9806f91ecf0c107718ea04bf6d50e4769c278a01
features/FEATURE_BLE/ble/BLERoles.h
features/FEATURE_BLE/ble/BLERoles.h
#ifndef MBED_BLE_ROLES_H__ #define MBED_BLE_ROLES_H__ #ifdef BLE_ROLE_PERIPHERAL #ifndef BLE_ROLE_OBSERVER #error "BLE role 'PERIPHERAL' depends on role 'OBSERVER'" #endif // BLE_ROLE_OBSERVER #endif // BLE_ROLE_PERIPHERAL #ifdef BLE_ROLE_CENTRAL #ifndef BLE_ROLE_BROADCASTER #error "BLE role 'CENTRAL' depends on role 'BROADCASTER'" #endif // BLE_ROLE_BROADCASTER #endif // BLE_ROLE_CENTRAL #ifdef BLE_ROLE_SECURITY #ifndef BLE_ROLE_PERIPHERAL #error "BLE role 'SECURITY' depends on role 'PERIPHERAL'" #endif // BLE_ROLE_PERIPHERAL #endif // BLE_ROLE_SECURITY #ifdef BLE_ROLE_PRIVACY #ifndef BLE_ROLE_SECURITY #error "BLE role 'PRIVACY' depends on role 'SECURITY'" #endif // BLE_ROLE_SECURITY #endif // BLE_ROLE_PRIVACY #ifdef BLE_ROLE_GATT_CLIENT #ifndef BLE_ROLE_PERIPHERAL #error "BLE role 'GATT CLIENT' depends on role 'PERIPHERAL'" #endif // BLE_ROLE_PERIPHERAL #ifndef BLE_ROLE_BROADCASTER #error "BLE role 'GATT CLIENT' depends on role 'BROADCASTER'" #endif // BLE_ROLE_BROADCASTER #endif // BLE_ROLE_GATT_CLIENT #ifdef BLE_ROLE_GATT_SERVER #ifndef BLE_ROLE_SECURITY #error "BLE role 'GATT SERVER' depends on role 'SECURITY'" #endif // BLE_ROLE_SECURITY #endif // BLE_ROLE_GATT_SERVER #endif // MBED_BLE_ROLES_H__
Add preprocessor check to determine enabled roles are valid
feat(ble): Add preprocessor check to determine enabled roles are valid A number of BLE roles depend on each other, checking within the target configuration file for a valid configuration is infeasible. Move the validation to the preprocessor and fail to compile if some required roles are not enabled.
C
apache-2.0
kjbracey-arm/mbed,andcor02/mbed-os,kjbracey-arm/mbed,andcor02/mbed-os,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,andcor02/mbed-os,andcor02/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed,mbedmicro/mbed,kjbracey-arm/mbed,andcor02/mbed-os
9e574ac297f55917d8f00482d3504cd5e1647cdb
thrust/detail/caching_allocator.h
thrust/detail/caching_allocator.h
/* * Copyright 2020 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <thrust/mr/allocator.h> #include <thrust/mr/disjoint_tls_pool.h> #include <thrust/mr/new.h> #include <thrust/memory/detail/device_system_resource.h> namespace thrust { namespace detail { thrust::mr::allocator< char, thrust::mr::disjoint_unsynchronized_pool_resource< thrust::device_memory_resource, thrust::mr::new_delete_resource > > single_device_tls_caching_allocator() { return { &thrust::mr::tls_disjoint_pool( thrust::mr::get_global_resource<thrust::device_memory_resource>(), thrust::mr::get_global_resource<thrust::mr::new_delete_resource>() ) }; } } }
/* * Copyright 2020 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <thrust/mr/allocator.h> #include <thrust/mr/disjoint_tls_pool.h> #include <thrust/mr/new.h> #include <thrust/memory/detail/device_system_resource.h> namespace thrust { namespace detail { inline thrust::mr::allocator< char, thrust::mr::disjoint_unsynchronized_pool_resource< thrust::device_memory_resource, thrust::mr::new_delete_resource > > single_device_tls_caching_allocator() { return { &thrust::mr::tls_disjoint_pool( thrust::mr::get_global_resource<thrust::device_memory_resource>(), thrust::mr::get_global_resource<thrust::mr::new_delete_resource>() ) }; } } }
Add a missing inline to the caching allocator accessor.
Add a missing inline to the caching allocator accessor. Closes #1149. Reviewed-by: David Olsen <[email protected]> Reviewed-by: Bryce Adelstein Lelbach aka wash <[email protected]>
C
apache-2.0
andrewcorrigan/thrust-multi-permutation-iterator,andrewcorrigan/thrust-multi-permutation-iterator,andrewcorrigan/thrust-multi-permutation-iterator,thrust/thrust,thrust/thrust,thrust/thrust,jaredhoberock/thrust,jaredhoberock/thrust,jaredhoberock/thrust,jaredhoberock/thrust,thrust/thrust,thrust/thrust,jaredhoberock/thrust
ae65ed8fe3edd89f84f8a083cb8c4c21d387c43c
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; std::deque<ADDRINT> *dyn_address_queue; Bbv *bbv; UINT64 thread_num; ADDRINT bbv_base; UINT64 bbv_count; ADDRINT bbv_last; BOOL bbv_end; UINT64 blocknum; UINT64 icount; 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; #if defined(TARGET_IA32) uint8_t __pad[29]; #elif defined(TARGET_INTEL64) uint8_t __pad[53]; #endif } __attribute__((packed)) 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; std::deque<ADDRINT> *dyn_address_queue; Bbv *bbv; UINT64 thread_num; ADDRINT bbv_base; UINT64 bbv_count; ADDRINT bbv_last; BOOL bbv_end; UINT64 blocknum; UINT64 icount; 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
Use aligned(LINE_SIZE_BYTES) attribute instead of manually adjusted padding
[sift] Use aligned(LINE_SIZE_BYTES) attribute instead of manually adjusted padding
C
mit
abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper
f73256aa30d789aa13df85fd31ce45581bf029a5
iphone/Classes/TiUIScrollableView.h
iphone/Classes/TiUIScrollableView.h
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ #ifdef USE_TI_UISCROLLABLEVIEW #import "TiUIView.h" @interface TiUIScrollableView : TiUIView<UIScrollViewDelegate> { @private UIScrollView *scrollview; UIPageControl *pageControl; int currentPage; // Duplicate some info, just in case we're not showing the page control BOOL showPageControl; CGFloat pageControlHeight; BOOL handlingPageControlEvent; CGFloat maxScale; CGFloat minScale; // Have to correct for an apple goof; rotation stops scrolling, AND doesn't move to the next page. BOOL rotatedWhileScrolling; // See the code for why we need this... int lastPage; int cacheSize; } -(void)manageRotation; -(UIScrollView*)scrollview; @end #endif
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ #ifdef USE_TI_UISCROLLABLEVIEW #import "TiUIView.h" @interface TiUIScrollableView : TiUIView<UIScrollViewDelegate> { @private UIScrollView *scrollview; UIPageControl *pageControl; int currentPage; // Duplicate some info, just in case we're not showing the page control BOOL showPageControl; CGFloat pageControlHeight; BOOL handlingPageControlEvent; // Have to correct for an apple goof; rotation stops scrolling, AND doesn't move to the next page. BOOL rotatedWhileScrolling; // See the code for why we need this... int lastPage; int cacheSize; } -(void)manageRotation; -(UIScrollView*)scrollview; @end #endif
Include header file changes missed from last checkin
[timob-4738] Include header file changes missed from last checkin
C
apache-2.0
pec1985/titanium_mobile,kopiro/titanium_mobile,shopmium/titanium_mobile,pinnamur/titanium_mobile,peymanmortazavi/titanium_mobile,jhaynie/titanium_mobile,FokkeZB/titanium_mobile,benbahrenburg/titanium_mobile,smit1625/titanium_mobile,shopmium/titanium_mobile,ashcoding/titanium_mobile,indera/titanium_mobile,falkolab/titanium_mobile,falkolab/titanium_mobile,AngelkPetkov/titanium_mobile,prop/titanium_mobile,mano-mykingdom/titanium_mobile,openbaoz/titanium_mobile,pinnamur/titanium_mobile,mano-mykingdom/titanium_mobile,sriks/titanium_mobile,pec1985/titanium_mobile,ashcoding/titanium_mobile,mvitr/titanium_mobile,bhatfield/titanium_mobile,jhaynie/titanium_mobile,mano-mykingdom/titanium_mobile,prop/titanium_mobile,mano-mykingdom/titanium_mobile,KoketsoMabuela92/titanium_mobile,mvitr/titanium_mobile,bhatfield/titanium_mobile,cheekiatng/titanium_mobile,pec1985/titanium_mobile,prop/titanium_mobile,peymanmortazavi/titanium_mobile,csg-coder/titanium_mobile,shopmium/titanium_mobile,prop/titanium_mobile,jvkops/titanium_mobile,arnaudsj/titanium_mobile,kopiro/titanium_mobile,kopiro/titanium_mobile,perdona/titanium_mobile,smit1625/titanium_mobile,formalin14/titanium_mobile,ashcoding/titanium_mobile,peymanmortazavi/titanium_mobile,pinnamur/titanium_mobile,linearhub/titanium_mobile,bhatfield/titanium_mobile,openbaoz/titanium_mobile,kopiro/titanium_mobile,emilyvon/titanium_mobile,emilyvon/titanium_mobile,indera/titanium_mobile,jhaynie/titanium_mobile,formalin14/titanium_mobile,hieupham007/Titanium_Mobile,pec1985/titanium_mobile,taoger/titanium_mobile,perdona/titanium_mobile,KoketsoMabuela92/titanium_mobile,csg-coder/titanium_mobile,AngelkPetkov/titanium_mobile,FokkeZB/titanium_mobile,rblalock/titanium_mobile,peymanmortazavi/titanium_mobile,cheekiatng/titanium_mobile,csg-coder/titanium_mobile,FokkeZB/titanium_mobile,openbaoz/titanium_mobile,arnaudsj/titanium_mobile,jvkops/titanium_mobile,arnaudsj/titanium_mobile,linearhub/titanium_mobile,sriks/titanium_mobile,cheekiatng/titanium_mobile,jhaynie/titanium_mobile,bright-sparks/titanium_mobile,indera/titanium_mobile,ashcoding/titanium_mobile,sriks/titanium_mobile,bright-sparks/titanium_mobile,smit1625/titanium_mobile,arnaudsj/titanium_mobile,indera/titanium_mobile,sriks/titanium_mobile,mvitr/titanium_mobile,peymanmortazavi/titanium_mobile,cheekiatng/titanium_mobile,emilyvon/titanium_mobile,pinnamur/titanium_mobile,emilyvon/titanium_mobile,benbahrenburg/titanium_mobile,csg-coder/titanium_mobile,shopmium/titanium_mobile,mvitr/titanium_mobile,formalin14/titanium_mobile,shopmium/titanium_mobile,emilyvon/titanium_mobile,mvitr/titanium_mobile,AngelkPetkov/titanium_mobile,linearhub/titanium_mobile,mvitr/titanium_mobile,peymanmortazavi/titanium_mobile,ashcoding/titanium_mobile,hieupham007/Titanium_Mobile,pec1985/titanium_mobile,FokkeZB/titanium_mobile,csg-coder/titanium_mobile,sriks/titanium_mobile,KangaCoders/titanium_mobile,indera/titanium_mobile,KangaCoders/titanium_mobile,benbahrenburg/titanium_mobile,bright-sparks/titanium_mobile,perdona/titanium_mobile,collinprice/titanium_mobile,prop/titanium_mobile,jvkops/titanium_mobile,hieupham007/Titanium_Mobile,pec1985/titanium_mobile,kopiro/titanium_mobile,bhatfield/titanium_mobile,falkolab/titanium_mobile,sriks/titanium_mobile,kopiro/titanium_mobile,openbaoz/titanium_mobile,FokkeZB/titanium_mobile,bhatfield/titanium_mobile,openbaoz/titanium_mobile,jvkops/titanium_mobile,pec1985/titanium_mobile,taoger/titanium_mobile,jhaynie/titanium_mobile,bright-sparks/titanium_mobile,mano-mykingdom/titanium_mobile,bhatfield/titanium_mobile,perdona/titanium_mobile,emilyvon/titanium_mobile,pec1985/titanium_mobile,shopmium/titanium_mobile,bright-sparks/titanium_mobile,shopmium/titanium_mobile,bright-sparks/titanium_mobile,falkolab/titanium_mobile,mvitr/titanium_mobile,emilyvon/titanium_mobile,KoketsoMabuela92/titanium_mobile,collinprice/titanium_mobile,benbahrenburg/titanium_mobile,peymanmortazavi/titanium_mobile,pinnamur/titanium_mobile,benbahrenburg/titanium_mobile,bhatfield/titanium_mobile,AngelkPetkov/titanium_mobile,AngelkPetkov/titanium_mobile,KoketsoMabuela92/titanium_mobile,kopiro/titanium_mobile,jvkops/titanium_mobile,linearhub/titanium_mobile,KangaCoders/titanium_mobile,taoger/titanium_mobile,pinnamur/titanium_mobile,prop/titanium_mobile,smit1625/titanium_mobile,bhatfield/titanium_mobile,smit1625/titanium_mobile,hieupham007/Titanium_Mobile,jhaynie/titanium_mobile,mvitr/titanium_mobile,perdona/titanium_mobile,hieupham007/Titanium_Mobile,hieupham007/Titanium_Mobile,taoger/titanium_mobile,AngelkPetkov/titanium_mobile,rblalock/titanium_mobile,benbahrenburg/titanium_mobile,linearhub/titanium_mobile,mano-mykingdom/titanium_mobile,benbahrenburg/titanium_mobile,perdona/titanium_mobile,linearhub/titanium_mobile,indera/titanium_mobile,falkolab/titanium_mobile,hieupham007/Titanium_Mobile,perdona/titanium_mobile,jvkops/titanium_mobile,shopmium/titanium_mobile,linearhub/titanium_mobile,hieupham007/Titanium_Mobile,formalin14/titanium_mobile,rblalock/titanium_mobile,taoger/titanium_mobile,prop/titanium_mobile,bright-sparks/titanium_mobile,jhaynie/titanium_mobile,collinprice/titanium_mobile,openbaoz/titanium_mobile,jhaynie/titanium_mobile,KangaCoders/titanium_mobile,formalin14/titanium_mobile,jvkops/titanium_mobile,KangaCoders/titanium_mobile,KoketsoMabuela92/titanium_mobile,AngelkPetkov/titanium_mobile,FokkeZB/titanium_mobile,cheekiatng/titanium_mobile,rblalock/titanium_mobile,ashcoding/titanium_mobile,bright-sparks/titanium_mobile,falkolab/titanium_mobile,prop/titanium_mobile,taoger/titanium_mobile,FokkeZB/titanium_mobile,ashcoding/titanium_mobile,rblalock/titanium_mobile,mano-mykingdom/titanium_mobile,pinnamur/titanium_mobile,openbaoz/titanium_mobile,pec1985/titanium_mobile,jvkops/titanium_mobile,cheekiatng/titanium_mobile,perdona/titanium_mobile,rblalock/titanium_mobile,falkolab/titanium_mobile,sriks/titanium_mobile,pinnamur/titanium_mobile,arnaudsj/titanium_mobile,indera/titanium_mobile,formalin14/titanium_mobile,collinprice/titanium_mobile,linearhub/titanium_mobile,smit1625/titanium_mobile,cheekiatng/titanium_mobile,KoketsoMabuela92/titanium_mobile,openbaoz/titanium_mobile,pinnamur/titanium_mobile,emilyvon/titanium_mobile,peymanmortazavi/titanium_mobile,benbahrenburg/titanium_mobile,KoketsoMabuela92/titanium_mobile,rblalock/titanium_mobile,smit1625/titanium_mobile,collinprice/titanium_mobile,ashcoding/titanium_mobile,indera/titanium_mobile,sriks/titanium_mobile,collinprice/titanium_mobile,taoger/titanium_mobile,rblalock/titanium_mobile,collinprice/titanium_mobile,formalin14/titanium_mobile,collinprice/titanium_mobile,AngelkPetkov/titanium_mobile,csg-coder/titanium_mobile,KangaCoders/titanium_mobile,falkolab/titanium_mobile,KangaCoders/titanium_mobile,smit1625/titanium_mobile,FokkeZB/titanium_mobile,KoketsoMabuela92/titanium_mobile,KangaCoders/titanium_mobile,taoger/titanium_mobile,kopiro/titanium_mobile,csg-coder/titanium_mobile,csg-coder/titanium_mobile,cheekiatng/titanium_mobile,arnaudsj/titanium_mobile,formalin14/titanium_mobile,mano-mykingdom/titanium_mobile
d618aca68b33ef2e20249c74399de627c6c60424
chapter27/chapter27_ex13.c
chapter27/chapter27_ex13.c
/* Chapter 27, exercise 13: define an input operation that reads an arbitrarily long sequence of whitespace-terminated characters into a zero-terminated array of chars */ #include<stdlib.h> #include<string.h> #include<stdio.h> #include<ctype.h> char* get_word() { int max = 8; char* word = (char*)malloc(max); int count = 0; int x; while ((x=getchar())!=EOF && isgraph(x)) { if (count == max-1) { /* double capacity */ max += max; word = (char*)realloc(word,max); if (word==0) exit(EXIT_FAILURE); } word[count++] = x; } word[count] = 0; return word; } int main() { while (1) { char* word = get_word(); if (!strcmp(word,"quit")) break; printf("%s\n",word); } }
Add Chapter 27, exercise 13
Add Chapter 27, exercise 13
C
mit
bewuethr/stroustrup_ppp,bewuethr/stroustrup_ppp
66b0664aa1347df44ff7a5a7aa5b35d07df54ea5
fitz/base_memory.c
fitz/base_memory.c
#include "fitz_base.h" void * fz_malloc(int n) { void *p = malloc(n); if (!p) fz_throw("cannot malloc %d bytes", n); return p; } void * fz_realloc(void *p, int n) { void *np = realloc(p, n); if (np == nil) fz_throw("cannot realloc %d bytes", n); return np; } void fz_free(void *p) { free(p); } char * fz_strdup(char *s) { char *ns = strdup(s); if (!ns) fz_throw("cannot strdup %d bytes", strlen(s) + 1); return ns; }
#include "fitz_base.h" void * fz_malloc(int n) { void *p = malloc(n); if (!p) fz_throw("cannot malloc %d bytes", n); return p; } void * fz_realloc(void *p, int n) { void *np = realloc(p, n); if (np == nil) fz_throw("cannot realloc %d bytes", n); return np; } void fz_free(void *p) { free(p); } char * fz_strdup(char *s) { char *ns = strdup(s); if (!ns) fz_throw("cannot strdup %lu bytes", (unsigned long)strlen(s) + 1); return ns; }
Use the correct format specifier for size_t in fz_strdup.
Use the correct format specifier for size_t in fz_strdup. Prior to this patch, if the strdup failed, it would throw an error printing the number of bytes that could not be allocated. However, this was formatted as an int, while the actual argument passed is the return value of strdup itself, which is usually a size_t. This patch formats instead as an unsigned long, and adds a cast to ensure the types match even on platforms where this isn't already the case.
C
agpl-3.0
isavin/humblepdf,clchiou/mupdf,muennich/mupdf,michaelcadilhac/pdfannot,seagullua/MuPDF,tribals/mupdf,lustersir/MuPDF,loungeup/mupdf,nqv/mupdf,PuzzleFlow/mupdf,hjiayz/forkmupdf,robamler/mupdf-nacl,benoit-pierre/mupdf,tophyr/mupdf,xiangxw/mupdf,hackqiang/mupdf,Kalp695/mupdf,MokiMobility/muPDF,zeniko/mupdf,robamler/mupdf-nacl,PuzzleFlow/mupdf,lolo32/mupdf-mirror,PuzzleFlow/mupdf,loungeup/mupdf,FabriceSalvaire/mupdf-cmake,issuestand/mupdf,loungeup/mupdf,ziel/mupdf,MokiMobility/muPDF,seagullua/MuPDF,ziel/mupdf,FabriceSalvaire/mupdf-v1.3,benoit-pierre/mupdf,Kalp695/mupdf,andyhan/mupdf,TamirEvan/mupdf,michaelcadilhac/pdfannot,andyhan/mupdf,asbloomf/mupdf,issuestand/mupdf,hjiayz/forkmupdf,robamler/mupdf-nacl,ziel/mupdf,knielsen/mupdf,FabriceSalvaire/mupdf-cmake,nqv/mupdf,lustersir/MuPDF,nqv/mupdf,wild0/opened_mupdf,derek-watson/mupdf,flipstudio/MuPDF,michaelcadilhac/pdfannot,ccxvii/mupdf,knielsen/mupdf,poor-grad-student/mupdf,derek-watson/mupdf,benoit-pierre/mupdf,muennich/mupdf,PuzzleFlow/mupdf,clchiou/mupdf,github201407/MuPDF,kobolabs/mupdf,samturneruk/mupdf_secure_android,muennich/mupdf,github201407/MuPDF,kobolabs/mupdf,knielsen/mupdf,zeniko/mupdf,zeniko/mupdf,tribals/mupdf,clchiou/mupdf,kobolabs/mupdf,flipstudio/MuPDF,cgogolin/penandpdf,clchiou/mupdf,andyhan/mupdf,poor-grad-student/mupdf,xiangxw/mupdf,ccxvii/mupdf,poor-grad-student/mupdf,ArtifexSoftware/mupdf,ArtifexSoftware/mupdf,seagullua/MuPDF,Kalp695/mupdf,seagullua/MuPDF,ziel/mupdf,issuestand/mupdf,FabriceSalvaire/mupdf-cmake,tophyr/mupdf,Kalp695/mupdf,geetakaur/NewApps,lustersir/MuPDF,isavin/humblepdf,benoit-pierre/mupdf,FabriceSalvaire/mupdf-v1.3,TamirEvan/mupdf,samturneruk/mupdf_secure_android,robamler/mupdf-nacl,PuzzleFlow/mupdf,andyhan/mupdf,Kalp695/mupdf,seagullua/MuPDF,geetakaur/NewApps,wzhsunn/mupdf,clchiou/mupdf,PuzzleFlow/mupdf,fluks/mupdf-x11-bookmarks,tophyr/mupdf,hxx0215/MuPDFMirror,Kalp695/mupdf,knielsen/mupdf,issuestand/mupdf,crow-misia/mupdf,TamirEvan/mupdf,wild0/opened_mupdf,muennich/mupdf,andyhan/mupdf,lustersir/MuPDF,tribals/mupdf,xiangxw/mupdf,crow-misia/mupdf,cgogolin/penandpdf,wild0/opened_mupdf,tophyr/mupdf,samturneruk/mupdf_secure_android,sebras/mupdf,xiangxw/mupdf,lamemate/mupdf,andyhan/mupdf,wild0/opened_mupdf,TamirEvan/mupdf,hackqiang/mupdf,ArtifexSoftware/mupdf,ylixir/mupdf,ziel/mupdf,derek-watson/mupdf,tribals/mupdf,ArtifexSoftware/mupdf,flipstudio/MuPDF,fluks/mupdf-x11-bookmarks,seagullua/MuPDF,knielsen/mupdf,lamemate/mupdf,michaelcadilhac/pdfannot,github201407/MuPDF,github201407/MuPDF,isavin/humblepdf,sebras/mupdf,ccxvii/mupdf,TamirEvan/mupdf,tribals/mupdf,FabriceSalvaire/mupdf-cmake,wzhsunn/mupdf,crow-misia/mupdf,kobolabs/mupdf,fluks/mupdf-x11-bookmarks,flipstudio/MuPDF,kobolabs/mupdf,ziel/mupdf,asbloomf/mupdf,asbloomf/mupdf,Kalp695/mupdf,flipstudio/MuPDF,cgogolin/penandpdf,kobolabs/mupdf,ylixir/mupdf,lolo32/mupdf-mirror,hackqiang/mupdf,geetakaur/NewApps,isavin/humblepdf,wzhsunn/mupdf,lolo32/mupdf-mirror,wild0/opened_mupdf,sebras/mupdf,wzhsunn/mupdf,poor-grad-student/mupdf,hxx0215/MuPDFMirror,geetakaur/NewApps,lolo32/mupdf-mirror,samturneruk/mupdf_secure_android,ylixir/mupdf,geetakaur/NewApps,derek-watson/mupdf,xiangxw/mupdf,derek-watson/mupdf,derek-watson/mupdf,ylixir/mupdf,lamemate/mupdf,lolo32/mupdf-mirror,issuestand/mupdf,isavin/humblepdf,lolo32/mupdf-mirror,hxx0215/MuPDFMirror,ArtifexSoftware/mupdf,lustersir/MuPDF,FabriceSalvaire/mupdf-cmake,tophyr/mupdf,MokiMobility/muPDF,hxx0215/MuPDFMirror,zeniko/mupdf,michaelcadilhac/pdfannot,tophyr/mupdf,loungeup/mupdf,ArtifexSoftware/mupdf,wzhsunn/mupdf,robamler/mupdf-nacl,TamirEvan/mupdf,kobolabs/mupdf,ArtifexSoftware/mupdf,ccxvii/mupdf,github201407/MuPDF,TamirEvan/mupdf,hjiayz/forkmupdf,nqv/mupdf,FabriceSalvaire/mupdf-v1.3,hackqiang/mupdf,fluks/mupdf-x11-bookmarks,fluks/mupdf-x11-bookmarks,loungeup/mupdf,asbloomf/mupdf,michaelcadilhac/pdfannot,ylixir/mupdf,crow-misia/mupdf,cgogolin/penandpdf,hjiayz/forkmupdf,PuzzleFlow/mupdf,isavin/humblepdf,ccxvii/mupdf,sebras/mupdf,loungeup/mupdf,poor-grad-student/mupdf,FabriceSalvaire/mupdf-v1.3,clchiou/mupdf,samturneruk/mupdf_secure_android,hackqiang/mupdf,lamemate/mupdf,ccxvii/mupdf,asbloomf/mupdf,wild0/opened_mupdf,samturneruk/mupdf_secure_android,xiangxw/mupdf,nqv/mupdf,isavin/humblepdf,github201407/MuPDF,MokiMobility/muPDF,tribals/mupdf,knielsen/mupdf,lolo32/mupdf-mirror,wzhsunn/mupdf,muennich/mupdf,FabriceSalvaire/mupdf-v1.3,crow-misia/mupdf,robamler/mupdf-nacl,poor-grad-student/mupdf,sebras/mupdf,benoit-pierre/mupdf,muennich/mupdf,hackqiang/mupdf,hjiayz/forkmupdf,ArtifexSoftware/mupdf,nqv/mupdf,fluks/mupdf-x11-bookmarks,MokiMobility/muPDF,asbloomf/mupdf,ylixir/mupdf,FabriceSalvaire/mupdf-v1.3,sebras/mupdf,hxx0215/MuPDFMirror,flipstudio/MuPDF,crow-misia/mupdf,xiangxw/mupdf,hxx0215/MuPDFMirror,zeniko/mupdf,wild0/opened_mupdf,issuestand/mupdf,lamemate/mupdf,cgogolin/penandpdf,hjiayz/forkmupdf,lustersir/MuPDF,fluks/mupdf-x11-bookmarks,zeniko/mupdf,geetakaur/NewApps,TamirEvan/mupdf,lamemate/mupdf,cgogolin/penandpdf,muennich/mupdf,FabriceSalvaire/mupdf-cmake,benoit-pierre/mupdf,MokiMobility/muPDF
1089397a1e5e33db3dc9e291f4c846c0d0dcf560
webkit/glue/unittest_test_server.h
webkit/glue/unittest_test_server.h
// Copyright (c) 2006-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 WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ #define WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ #include "net/base/load_flags.h" #include "net/test/test_server.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/appcache/appcache_interfaces.h" class UnittestTestServer : public net::TestServer { public: UnittestTestServer() : net::TestServer(net::TestServer::TYPE_HTTP, FilePath(FILE_PATH_LITERAL("webkit/data"))) { } }; #endif // WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ #define WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__ #include "net/base/load_flags.h" #include "net/test/test_server.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/appcache/appcache_interfaces.h" class UnittestTestServer : public net::TestServer { public: UnittestTestServer() : net::TestServer(net::TestServer::TYPE_HTTP, net::TestServer::kLocalhost, FilePath(FILE_PATH_LITERAL("webkit/data"))) { } }; #endif // WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__
Remove usage of a deprecated TestServer constructor.
Remove usage of a deprecated TestServer constructor. Hostname must now be explicitly specified (previously default was 127.0.0.1). See the following CL for further details: http://codereview.chromium.org/9369029/ A follow-up CL will remove the deprecated constructor: http://codereview.chromium.org/9431002/ BUG=114369 TEST=everything still compiles and passes Review URL: http://codereview.chromium.org/9429052 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@123095 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,keishi/chromium,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,dednal/chromium.src,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,rogerwang/chromium,bright-sparks/chromium-spacewalk,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,rogerwang/chromium,junmin-zhu/chromium-rivertrail,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,patrickm/chromium.src,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,robclark/chromium,PeterWangIntel/chromium-crosswalk,robclark/chromium,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,Jonekee/chromium.src,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,chuan9/chromium-crosswalk,rogerwang/chromium,hujiajie/pa-chromium,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,nacl-webkit/chrome_deps,dednal/chromium.src,anirudhSK/chromium,bright-sparks/chromium-spacewalk,patrickm/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,Just-D/chromium-1,keishi/chromium,mohamed--abdel-maksoud/chromium.src,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,robclark/chromium,patrickm/chromium.src,ltilve/chromium,dushu1203/chromium.src,littlstar/chromium.src,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,anirudhSK/chromium,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,Just-D/chromium-1,anirudhSK/chromium,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,chuan9/chromium-crosswalk,Just-D/chromium-1,dushu1203/chromium.src,zcbenz/cefode-chromium,rogerwang/chromium,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,dushu1203/chromium.src,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,keishi/chromium,keishi/chromium,pozdnyakov/chromium-crosswalk,Pluto-tv/chromium-crosswalk,rogerwang/chromium,dushu1203/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,M4sse/chromium.src,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,robclark/chromium,ltilve/chromium,mogoweb/chromium-crosswalk,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,ltilve/chromium,krieger-od/nwjs_chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,hgl888/chromium-crosswalk,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,hujiajie/pa-chromium,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,dednal/chromium.src,markYoungH/chromium.src,hujiajie/pa-chromium,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,M4sse/chromium.src,Chilledheart/chromium,ltilve/chromium,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,M4sse/chromium.src,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,patrickm/chromium.src,mogoweb/chromium-crosswalk,Chilledheart/chromium,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,zcbenz/cefode-chromium,Jonekee/chromium.src,jaruba/chromium.src,keishi/chromium,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,patrickm/chromium.src,jaruba/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,hgl888/chromium-crosswalk,anirudhSK/chromium,ltilve/chromium,ondra-novak/chromium.src,dushu1203/chromium.src,dednal/chromium.src,Just-D/chromium-1,Just-D/chromium-1,Chilledheart/chromium,fujunwei/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk,markYoungH/chromium.src,robclark/chromium,zcbenz/cefode-chromium,axinging/chromium-crosswalk,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,keishi/chromium,chuan9/chromium-crosswalk,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,ChromiumWebApps/chromium,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,ltilve/chromium,zcbenz/cefode-chromium,ondra-novak/chromium.src,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,dednal/chromium.src,robclark/chromium,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,jaruba/chromium.src,keishi/chromium,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,keishi/chromium,ondra-novak/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,rogerwang/chromium,krieger-od/nwjs_chromium.src,patrickm/chromium.src,Chilledheart/chromium,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,rogerwang/chromium,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,nacl-webkit/chrome_deps,patrickm/chromium.src,ltilve/chromium,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,jaruba/chromium.src,M4sse/chromium.src,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,keishi/chromium,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,junmin-zhu/chromium-rivertrail,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,robclark/chromium,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,dednal/chromium.src,robclark/chromium,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,axinging/chromium-crosswalk,ondra-novak/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,patrickm/chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,markYoungH/chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,nacl-webkit/chrome_deps,Chilledheart/chromium,jaruba/chromium.src,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,dednal/chromium.src,dednal/chromium.src,robclark/chromium,rogerwang/chromium,Fireblend/chromium-crosswalk,Chilledheart/chromium,Jonekee/chromium.src,littlstar/chromium.src,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,rogerwang/chromium,littlstar/chromium.src,anirudhSK/chromium,anirudhSK/chromium,junmin-zhu/chromium-rivertrail,robclark/chromium,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,jaruba/chromium.src,axinging/chromium-crosswalk,dushu1203/chromium.src,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,dednal/chromium.src,rogerwang/chromium,keishi/chromium,chuan9/chromium-crosswalk,dednal/chromium.src,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,keishi/chromium,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,ltilve/chromium,Chilledheart/chromium
0b0e8956e4779456338ced864d40de4a57e6679c
HLT/PHOS/AliHLTPHOSModuleCellAverageEnergyDataStruct.h
HLT/PHOS/AliHLTPHOSModuleCellAverageEnergyDataStruct.h
#ifndef ALIHLTPHOSNODULECELLAVERAGEENERGYDATASTRUCT_H #define ALIHLTPHOSNODULECELLAVERAGEENERGYDATASTRUCT_H /*************************************************************************** * Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. * * * * Author: Per Thomas Hille <[email protected]> for the ALICE HLT Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ #include "AliHLTPHOSCommonDefs.h" //#include "AliHLTPHOSValidCellDataStruct.h" struct AliHLTPHOSModuleCellAverageEnergyDataStruct { AliHLTUInt8_t fModuleID; // AliHLTUInt16_t fCnt; // AliHLTUInt16_t fValidData[N_ROWS_MOD*N_COLUMNS_MOD*N_GAINS]; AliHLTPHOSValidCellDataStruct fValidData[N_MODULES*N_ROWS_MOD*N_COLUMNS_MOD*N_GAINS]; Double_t fAverageEnergies[N_ROWS_MOD][N_COLUMNS_MOD][N_GAINS]; }; #endif
Structure to hold average energies for each cell. Should be sendt to OCDB via the shuttle.
Structure to hold average energies for each cell. Should be sendt to OCDB via the shuttle.
C
bsd-3-clause
alisw/AliRoot,shahor02/AliRoot,jgrosseo/AliRoot,miranov25/AliRoot,coppedis/AliRoot,ecalvovi/AliRoot,jgrosseo/AliRoot,mkrzewic/AliRoot,shahor02/AliRoot,coppedis/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,shahor02/AliRoot,ecalvovi/AliRoot,jgrosseo/AliRoot,ALICEHLT/AliRoot,shahor02/AliRoot,alisw/AliRoot,miranov25/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,mkrzewic/AliRoot,coppedis/AliRoot,ecalvovi/AliRoot,jgrosseo/AliRoot,shahor02/AliRoot,ALICEHLT/AliRoot,mkrzewic/AliRoot,mkrzewic/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,mkrzewic/AliRoot,coppedis/AliRoot,alisw/AliRoot,alisw/AliRoot,mkrzewic/AliRoot,coppedis/AliRoot,ecalvovi/AliRoot,jgrosseo/AliRoot,alisw/AliRoot,ecalvovi/AliRoot,shahor02/AliRoot,miranov25/AliRoot,miranov25/AliRoot,jgrosseo/AliRoot,sebaleh/AliRoot,sebaleh/AliRoot,alisw/AliRoot,mkrzewic/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,shahor02/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,alisw/AliRoot,coppedis/AliRoot,jgrosseo/AliRoot,ALICEHLT/AliRoot,coppedis/AliRoot,sebaleh/AliRoot,ALICEHLT/AliRoot,miranov25/AliRoot,ALICEHLT/AliRoot
b535267825875648947e4670043f903ed62b1e0f
BKDeltaCalculator/BKDeltaCalculator.h
BKDeltaCalculator/BKDeltaCalculator.h
// Copyright 2014-present 650 Industries. // Copyright 2014-present Andrew Toulouse. #import <Foundation/Foundation.h> @class BKDelta; typedef BOOL (^delta_calculator_equality_test_t)(id a, id b); const delta_calculator_equality_test_t BKDeltaCalculatorStrictEqualityTest; @interface BKDeltaCalculator : NSObject + (instancetype)defaultCalculator; + (instancetype)deltaCalculatorWithEqualityTest:(delta_calculator_equality_test_t)equalityTest; - (instancetype)initWithEqualityTest:(delta_calculator_equality_test_t)equalityTest; /** Resolve differences between two versions of an array. @param oldArray the array representing the "old" version of the array @param newArray the array representing the "new" version of the array. @return A delta object containing NSIndexSets representing added, moved, removed, and unchanged elements. */ - (BKDelta *)deltaFromOldArray:(NSArray *)oldArray toNewArray:(NSArray *)newArray; @end
// Copyright 2014-present 650 Industries. // Copyright 2014-present Andrew Toulouse. #import <Foundation/Foundation.h> @class BKDelta; typedef BOOL (^delta_calculator_equality_test_t)(id a, id b); extern const delta_calculator_equality_test_t BKDeltaCalculatorStrictEqualityTest; @interface BKDeltaCalculator : NSObject + (instancetype)defaultCalculator; + (instancetype)deltaCalculatorWithEqualityTest:(delta_calculator_equality_test_t)equalityTest; - (instancetype)initWithEqualityTest:(delta_calculator_equality_test_t)equalityTest; /** Resolve differences between two versions of an array. @param oldArray the array representing the "old" version of the array @param newArray the array representing the "new" version of the array. @return A delta object containing NSIndexSets representing added, moved, removed, and unchanged elements. */ - (BKDelta *)deltaFromOldArray:(NSArray *)oldArray toNewArray:(NSArray *)newArray; @end
Add 'extern' declaration to strict equality test block
Add 'extern' declaration to strict equality test block Missed this while updating for Objective-C++ compatibility
C
mit
Basket/BKDeltaCalculator
1735810236c1eed907871cbeb3d0c1d94647328f
aux/version-compatibility-macros.h
aux/version-compatibility-macros.h
// These macros allow writing CPP compatibility hacks in a way that makes their // purpose much clearer than just demanding a specific version of a library. #define APPLICATIVE_MONAD MIN_VERSION_base(4,8,0) #define FOLDABLE_TRAVERSABLE MIN_VERSION_base(4,8,0) #define MONOID_IN_PRELUDE MIN_VERSION_base(4,8,0) #define NATURAL_IN_BASE MIN_VERSION_base(4,8,0) #define SEMIGROUP_IN_BASE MIN_VERSION_base(4,8,0) #define MONAD_FAIL MIN_VERSION_base(4,9,0)
-- These macros allow writing CPP compatibility hacks in a way that makes their -- purpose much clearer than just demanding a specific version of a library. #define APPLICATIVE_MONAD MIN_VERSION_base(4,8,0) #define FOLDABLE_TRAVERSABLE MIN_VERSION_base(4,8,0) #define MONOID_IN_PRELUDE MIN_VERSION_base(4,8,0) #define NATURAL_IN_BASE MIN_VERSION_base(4,8,0) #define SEMIGROUP_IN_BASE MIN_VERSION_base(4,8,0) #define MONAD_FAIL MIN_VERSION_base(4,9,0)
Fix Haddock trying to render C-style comments of macro file
Fix Haddock trying to render C-style comments of macro file
C
bsd-2-clause
quchen/prettyprinter,quchen/prettyprinter
1c63c33fa8255a6c1a00e846a2063f04e06d80a1
Source/Core/Helpers/HCRunloopRunner.h
Source/Core/Helpers/HCRunloopRunner.h
// OCHamcrest by Jon Reid, http://qualitycoding.org/about/ // Copyright 2016 hamcrest.org. See LICENSE.txt #import <Foundation/Foundation.h> /*! * @abstract Runs runloop until fulfilled, or timeout is reached. */ @interface HCRunloopRunner : NSObject - (instancetype)initWithFulfillmentBlock:(BOOL (^)())fulfillmentBlock; - (void)runUntilFulfilledOrTimeout:(CFTimeInterval)timeout; @end
// OCHamcrest by Jon Reid, http://qualitycoding.org/about/ // Copyright 2016 hamcrest.org. See LICENSE.txt #import <Foundation/Foundation.h> /*! * @abstract Runs runloop until fulfilled, or timeout is reached. * @discussion Based on http://bou.io/CTTRunLoopRunUntil.html */ @interface HCRunloopRunner : NSObject - (instancetype)initWithFulfillmentBlock:(BOOL (^)())fulfillmentBlock; - (void)runUntilFulfilledOrTimeout:(CFTimeInterval)timeout; @end
Add documentation link to article on runloop
Add documentation link to article on runloop
C
bsd-2-clause
hamcrest/OCHamcrest,hamcrest/OCHamcrest,hamcrest/OCHamcrest
6ef09bee374434a9912b0c59dbe2b6e370017a5d
src/efivar.c
src/efivar.c
/* * libefivar - library for the manipulation of EFI variables * Copyright 2012 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ #include "efivar.h" int main(void) { return 0; }
/* * libefivar - library for the manipulation of EFI variables * Copyright 2012 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include "efivar.h" int main(void) { efi_guid_t *guid; char *name; int rc; while ((rc = efi_get_next_variable_name(&guid, &name)) > 0) { printf("name: \"%s\"\n", name); } return 0; }
Add some sample code for efi_get_next_variable_name()
Add some sample code for efi_get_next_variable_name() Signed-off-by: Peter Jones <[email protected]>
C
lgpl-2.1
rhinstaller/efivar,rhboot/efivar,rhinstaller/efivar,vathpela/efivar-devel,android-ia/vendor_intel_external_efivar,CyanogenMod/android_vendor_intel_external_efivar,rhboot/efivar
33503e0c9f42eb4c9ae15351d7afe375acb6a12b
src/cltime.c
src/cltime.c
/* * ClusteredPoller * * Created by Jakob Borg. * Copyright 2011 Nym Networks. See LICENSE for terms. */ #include "cltime.h" #include <stddef.h> #include <sys/time.h> curms_t curms(void) { struct timeval now; gettimeofday(&now, NULL); return now.tv_sec * 1000 + now.tv_usec / 1000; }
/* * ClusteredPoller * * Created by Jakob Borg. * Copyright 2011 Nym Networks. See LICENSE for terms. */ #include "cltime.h" #include <stddef.h> #include <sys/time.h> curms_t curms(void) { struct timeval now; gettimeofday(&now, NULL); return (curms_t) now.tv_sec * 1000 + (curms_t) now.tv_usec / 1000; }
Fix for Solaris type conversion.
Fix for Solaris type conversion.
C
bsd-3-clause
calmh/ClusteredPoller,calmh/ClusteredPoller
a8eabb2ec9b1cc1c453e97f6a701db7e121e77d0
arc/arc/Model/FileSystem.h
arc/arc/Model/FileSystem.h
// // FileSystem.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> #import "Folder.h" @interface FileSystem : NSObject { Folder *_rootFolder; // The root folder. } // Returns the root folder of the entire file system. - (Folder*)getRootFolder; // Returns the single FileSystem instance. + (FileSystem*)getInstance; @end
// // FileSystem.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> #import "Folder.h" @interface FileSystem : NSObject { @private Folder *_rootFolder; // The root folder. } // Returns the root folder of the entire file system. - (Folder*)getRootFolder; // Returns the single FileSystem instance. + (FileSystem*)getInstance; @end
Add @private indicator to instance variable.
Add @private indicator to instance variable.
C
mit
BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc
5e9d8dbf60e137345a988b2e3ed1281dae9d4014
extras/test/arduino_compat.h
extras/test/arduino_compat.h
#ifndef _ARDUINO_COMPAT_H #define _ARDUINO_COMPAT_H #include <stdio.h> #include <stdlib.h> //#include <sys/types.h> //#include <sys/stat.h> #include <fcntl.h> #include <ctype.h> #include <string.h> #include <iostream> using namespace std; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; typedef bool boolean; typedef iostream Stream; #endif
#ifndef _ARDUINO_COMPAT_H #define _ARDUINO_COMPAT_H #include <stdio.h> #include <stdlib.h> #include <stdint.h> //#include <sys/types.h> //#include <sys/stat.h> #include <fcntl.h> #include <ctype.h> #include <string.h> #include <iostream> using namespace std; typedef bool boolean; typedef iostream Stream; #endif
Use stdint.h for unsigned integer typedefs
Use stdint.h for unsigned integer typedefs Fixes problem compiling regression tests on 64 bit OS.
C
lgpl-2.1
stevemarple/MicroNMEA,stevemarple/MicroNMEA
310e18df061ca1cead75c35032031363ee0da74d
src/load2mem.c
src/load2mem.c
#include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/stat.h> void usage(char *progname) { printf("usage: %s filename [address]\n", progname); } void prepare_filebuf(char **fb, long size) { *fb = (char*) malloc(size); } int main(int argc, char *argv[]) { int fd; struct stat statbuf; char *filebuf; if (argc <= 1) { usage(argv[0]); exit(1); } if ((fd = open(argv[1], O_RDONLY)) == -1) { perror("Error openinig file"); exit(2); } fstat(fd, &statbuf); if (argc == 3) filebuf = (char*) strtol(argv[2], NULL, 16); else prepare_filebuf(&filebuf, statbuf.st_size); printf("file is %ld bytes long, will load at %p\n", (long) statbuf.st_size, filebuf); if (read(fd, filebuf, statbuf.st_size) == -1) { perror("Error reading file"); exit(3); } }
Add original source from 2014. Split from 9tcfg.
Add original source from 2014. Split from 9tcfg.
C
mit
rkujawa/load2mem
b3196c56d41c2a09090671580a394d0589f70706
mudlib/mud/home/System/sys/touchd.c
mudlib/mud/home/System/sys/touchd.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2012 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths.h> #include <bigstruct/paths.h> #include <status.h> inherit SECOND_AUTO; object queue; static void create() { queue = new_object(BIGSTRUCT_DEQUE_LWO); } void queue_touch(object obj) { if (queue->empty()) { call_out("touch", 0); } queue->push_back(obj); } static void touch() { object obj; obj = queue->get_front(); queue->pop_front(); if (obj) { obj->_F_dummy(); } if (!queue->empty()) { call_out("touch", 0); } }
Add daemon to touch down all touched objects in the background
Add daemon to touch down all touched objects in the background
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
7922c4d5bc2469b00591b9e11199bd8b4c743677
misc/cxx_static_const.c
misc/cxx_static_const.c
/* * C++ 'static const' works differently from C 'static const'. * This example compiles with gcc but not with g++. G++ will * issue errors. */ /* $ g++ -o /tmp/foo cxx_static_const.c -lm cxx_static_const.c:2:26: error: uninitialized const ‘N1’ [-fpermissive] static const struct node N1; ^ cxx_static_const.c:1:21: note: ‘const struct node’ has no user-provided default constructor struct node; struct node { const struct node *other; }; ^ cxx_static_const.c:1:47: note: and the implicitly-defined constructor does not initialize ‘const node* node::other’ struct node; struct node { const struct node *other; }; ^ cxx_static_const.c:3:26: error: uninitialized const ‘N2’ [-fpermissive] static const struct node N2; ^ cxx_static_const.c:1:21: note: ‘const struct node’ has no user-provided default constructor struct node; struct node { const struct node *other; }; ^ cxx_static_const.c:1:47: note: and the implicitly-defined constructor does not initialize ‘const node* node::other’ struct node; struct node { const struct node *other; }; ^ cxx_static_const.c:4:26: error: redefinition of ‘const node N1’ static const struct node N1 = { &N2 }; ^ cxx_static_const.c:2:26: error: ‘const node N1’ previously declared here static const struct node N1; ^ cxx_static_const.c:5:26: error: redefinition of ‘const node N2’ static const struct node N2 = { &N1 }; ^ cxx_static_const.c:3:26: error: ‘const node N2’ previously declared here static const struct node N2; */ struct node; struct node { const struct node *other; }; static const struct node N1; static const struct node N2; static const struct node N1 = { &N2 }; static const struct node N2 = { &N1 }; int main(int argc, char *argv[]) { (void) argc; (void) argv; return 0; }
Add example of C++ 'static const' issue
Add example of C++ 'static const' issue
C
mit
harold-b/duktape,harold-b/duktape,jmptrader/duktape,jmptrader/duktape,svaarala/duktape,markand/duktape,markand/duktape,harold-b/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,jmptrader/duktape,markand/duktape,harold-b/duktape,jmptrader/duktape,jmptrader/duktape,harold-b/duktape,harold-b/duktape,svaarala/duktape,jmptrader/duktape,harold-b/duktape,markand/duktape,harold-b/duktape,jmptrader/duktape,markand/duktape,jmptrader/duktape,svaarala/duktape,harold-b/duktape,markand/duktape,svaarala/duktape,harold-b/duktape,markand/duktape,jmptrader/duktape,markand/duktape,markand/duktape,markand/duktape,svaarala/duktape,jmptrader/duktape,svaarala/duktape
f08636ea3f92e8debb3cfa64777c459a3d584968
good_bad_c_example/evil_pointers.c
good_bad_c_example/evil_pointers.c
#include <stdio.h> main() { char ch0 = 'a'; char ch1 = 'b'; char ch2 = 'c'; char *p = &ch1; printf("%d, %c, %c\n", p, *p, ch1); ++p; printf("%d, %c, %c\n", p, *p, ch1); printf("%d, %d, %d\n", &ch0, &ch1, &ch2); // Prevent the compiler from optimizing away the char constants }
#include <stdio.h> main() { char ch0 = 'e'; char ch1 = 'v'; char ch2 = 'i'; char *p = &ch1; printf("%d, %c, %c\n", p, *p, ch1); ++p; printf("%d, %c, %c\n", p, *p, ch1); printf("%d, %d, %d\n", &ch0, &ch1, &ch2); // Prevent the compiler from optimizing away the char constants }
Make it more ovious we are not incrementing and decrementing chars
Make it more ovious we are not incrementing and decrementing chars
C
bsd-3-clause
rbanffy/c_playground,rbanffy/c_playground,rbanffy/c_playground,rbanffy/c_playground,rbanffy/c_playground,rbanffy/c_playground
4536612477ae234c0de0fffd445a7ca122c608a6
test/CFrontend/2007-06-05-NoInlineAttribute.c
test/CFrontend/2007-06-05-NoInlineAttribute.c
// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep llvm.noinline int bar(int x, int y); __attribute__((noinline)) int bar(int x, int y) { return x + y; } int foo(int a, int b) { return bar(b, a); }
Test case for noinline attribute.
Test case for noinline attribute. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@37479 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap
1e8c5fb9fc80e721747a50936a898cf4abb6b275
chrome/browser/autofill/autofill_dialog.h
chrome/browser/autofill/autofill_dialog.h
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_ #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_ #include <vector> #include "chrome/browser/autofill/autofill_profile.h" // Shows the AutoFill dialog, which allows the user to edit profile information. // |profiles| is a vector of autofill profiles that contains the current profile // information. The dialog fills out the profile fields using this data. Any // changes made to the profile information through the dialog should be // transferred back into |profiles|. void ShowAutoFillDialog(const std::vector<AutoFillProfile>& profiles); #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_
Add the AutoFillDialog header, needed by the cross-platform implementations to implement the autofill dialog.
Add the AutoFillDialog header, needed by the cross-platform implementations to implement the autofill dialog. BUG=none TEST=none Review URL: http://codereview.chromium.org/549014 git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@36030 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
89969c3588667d2322ce2c918a8d050d5df8a3a5
src/condor_includes/condor_getmnt.h
src/condor_includes/condor_getmnt.h
#ifndef _CONDOR_GETMNT_H #define _CONDOR_GETMNT_H #if defined(ULTRIX42) || defined(ULTRIX43) #include <sys/mount.h> #endif #if !defined(OSF1) #include <mntent.h> #endif #if !defined(NMOUNT) #define NMOUNT 256 #endif #if !defined(ULTRIX42) && !defined(ULTRIX43) struct fs_data_req { dev_t dev; char *devname; char *path; }; struct fs_data { struct fs_data_req fd_req; }; #define NOSTAT_MANY 0 #endif #if NMOUNT < 256 #undef NMOUNT #define NMOUNT 256 #endif #endif /* _CONDOR_GETMNT_H */
#ifndef _CONDOR_GETMNT_H #define _CONDOR_GETMNT_H #if defined(ULTRIX42) || defined(ULTRIX43) #include <sys/mount.h> #endif #if !defined(OSF1) && !defined(AIX32) #include <mntent.h> #endif #if defined(AIX32) # include <sys/mntctl.h> # include <sys/vmount.h> # include <sys/sysmacros.h> #endif #if !defined(NMOUNT) #define NMOUNT 256 #endif #if !defined(ULTRIX42) && !defined(ULTRIX43) struct fs_data_req { dev_t dev; char *devname; char *path; }; struct fs_data { struct fs_data_req fd_req; }; #define NOSTAT_MANY 0 #endif #if NMOUNT < 256 #undef NMOUNT #define NMOUNT 256 #endif #endif /* _CONDOR_GETMNT_H */
Add AIX specific include files.
Add AIX specific include files.
C
apache-2.0
djw8605/condor,htcondor/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,djw8605/htcondor,djw8605/condor,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,clalancette/condor-dcloud,djw8605/htcondor,zhangzhehust/htcondor,djw8605/htcondor,zhangzhehust/htcondor,djw8605/condor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,zhangzhehust/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/htcondor,djw8605/condor,neurodebian/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,htcondor/htcondor,htcondor/htcondor,htcondor/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,zhangzhehust/htcondor,djw8605/condor,djw8605/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,clalancette/condor-dcloud,clalancette/condor-dcloud,neurodebian/htcondor,zhangzhehust/htcondor,zhangzhehust/htcondor,djw8605/condor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/htcondor,zhangzhehust/htcondor,djw8605/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,htcondor/htcondor
1bbf2cc0ec79123ea36e6d3979078698c9c3fc8b
Utilities/ParseOGLExt/Tokenizer.h
Utilities/ParseOGLExt/Tokenizer.h
// -*- c++ -*- /*========================================================================= Program: Visualization Toolkit Module: Tokenizer.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ /* * Copyright 2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the * U.S. Government. Redistribution and use in source and binary forms, with * or without modification, are permitted provided that this Notice and any * statement of authorship are reproduced on all copies. */ #include <vtkConfigure.h> #include <string> class Tokenizer { public: Tokenizer(const char *s, const char *delim = " \t\n"); Tokenizer(const vtkstd::string &s, const char *delim = " \t\n"); vtkstd::string GetNextToken(); vtkstd::string GetRemainingString() const; bool HasMoreTokens() const; void Reset(); private: vtkstd::string FullString; vtkstd::string Delim; vtkstd::string::size_type Position; };
// -*- c++ -*- /*========================================================================= Program: Visualization Toolkit Module: Tokenizer.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ /* * Copyright 2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the * U.S. Government. Redistribution and use in source and binary forms, with * or without modification, are permitted provided that this Notice and any * statement of authorship are reproduced on all copies. */ #include <vtkConfigure.h> #include <vtkstd/string> class Tokenizer { public: Tokenizer(const char *s, const char *delim = " \t\n"); Tokenizer(const vtkstd::string &s, const char *delim = " \t\n"); vtkstd::string GetNextToken(); vtkstd::string GetRemainingString() const; bool HasMoreTokens() const; void Reset(); private: vtkstd::string FullString; vtkstd::string Delim; vtkstd::string::size_type Position; };
Use the VTK wrapping of the string class header file.
COMP: Use the VTK wrapping of the string class header file.
C
bsd-3-clause
Wuteyan/VTK,jmerkow/VTK,collects/VTK,SimVascular/VTK,SimVascular/VTK,jeffbaumes/jeffbaumes-vtk,keithroe/vtkoptix,Wuteyan/VTK,berendkleinhaneveld/VTK,arnaudgelas/VTK,spthaolt/VTK,spthaolt/VTK,candy7393/VTK,keithroe/vtkoptix,gram526/VTK,keithroe/vtkoptix,arnaudgelas/VTK,mspark93/VTK,daviddoria/PointGraphsPhase1,johnkit/vtk-dev,biddisco/VTK,sankhesh/VTK,ashray/VTK-EVM,gram526/VTK,hendradarwin/VTK,daviddoria/PointGraphsPhase1,berendkleinhaneveld/VTK,jmerkow/VTK,sankhesh/VTK,hendradarwin/VTK,collects/VTK,berendkleinhaneveld/VTK,jeffbaumes/jeffbaumes-vtk,demarle/VTK,naucoin/VTKSlicerWidgets,sumedhasingla/VTK,spthaolt/VTK,cjh1/VTK,gram526/VTK,jeffbaumes/jeffbaumes-vtk,mspark93/VTK,naucoin/VTKSlicerWidgets,ashray/VTK-EVM,demarle/VTK,biddisco/VTK,mspark93/VTK,sumedhasingla/VTK,candy7393/VTK,naucoin/VTKSlicerWidgets,candy7393/VTK,candy7393/VTK,gram526/VTK,msmolens/VTK,jmerkow/VTK,msmolens/VTK,johnkit/vtk-dev,jeffbaumes/jeffbaumes-vtk,sumedhasingla/VTK,keithroe/vtkoptix,johnkit/vtk-dev,ashray/VTK-EVM,daviddoria/PointGraphsPhase1,biddisco/VTK,collects/VTK,candy7393/VTK,daviddoria/PointGraphsPhase1,msmolens/VTK,demarle/VTK,spthaolt/VTK,Wuteyan/VTK,sgh/vtk,sankhesh/VTK,Wuteyan/VTK,sankhesh/VTK,ashray/VTK-EVM,collects/VTK,Wuteyan/VTK,msmolens/VTK,gram526/VTK,johnkit/vtk-dev,ashray/VTK-EVM,sumedhasingla/VTK,aashish24/VTK-old,aashish24/VTK-old,mspark93/VTK,daviddoria/PointGraphsPhase1,mspark93/VTK,ashray/VTK-EVM,SimVascular/VTK,keithroe/vtkoptix,cjh1/VTK,arnaudgelas/VTK,cjh1/VTK,SimVascular/VTK,mspark93/VTK,berendkleinhaneveld/VTK,hendradarwin/VTK,arnaudgelas/VTK,gram526/VTK,sankhesh/VTK,berendkleinhaneveld/VTK,jeffbaumes/jeffbaumes-vtk,sankhesh/VTK,berendkleinhaneveld/VTK,arnaudgelas/VTK,mspark93/VTK,spthaolt/VTK,ashray/VTK-EVM,demarle/VTK,biddisco/VTK,aashish24/VTK-old,sgh/vtk,biddisco/VTK,jmerkow/VTK,candy7393/VTK,hendradarwin/VTK,mspark93/VTK,sankhesh/VTK,msmolens/VTK,naucoin/VTKSlicerWidgets,daviddoria/PointGraphsPhase1,candy7393/VTK,spthaolt/VTK,demarle/VTK,spthaolt/VTK,jeffbaumes/jeffbaumes-vtk,jmerkow/VTK,sumedhasingla/VTK,demarle/VTK,SimVascular/VTK,SimVascular/VTK,msmolens/VTK,sumedhasingla/VTK,demarle/VTK,SimVascular/VTK,gram526/VTK,arnaudgelas/VTK,sumedhasingla/VTK,aashish24/VTK-old,SimVascular/VTK,keithroe/vtkoptix,hendradarwin/VTK,biddisco/VTK,naucoin/VTKSlicerWidgets,berendkleinhaneveld/VTK,demarle/VTK,sankhesh/VTK,johnkit/vtk-dev,hendradarwin/VTK,Wuteyan/VTK,sgh/vtk,aashish24/VTK-old,sumedhasingla/VTK,keithroe/vtkoptix,jmerkow/VTK,gram526/VTK,johnkit/vtk-dev,msmolens/VTK,collects/VTK,biddisco/VTK,cjh1/VTK,jmerkow/VTK,aashish24/VTK-old,cjh1/VTK,cjh1/VTK,sgh/vtk,johnkit/vtk-dev,collects/VTK,jmerkow/VTK,candy7393/VTK,keithroe/vtkoptix,msmolens/VTK,naucoin/VTKSlicerWidgets,Wuteyan/VTK,sgh/vtk,sgh/vtk,hendradarwin/VTK,ashray/VTK-EVM
50ccd0d378e1ae094f876630770982817baccecc
test/Driver/gcc_forward.c
test/Driver/gcc_forward.c
// Check that we don't try to forward -Xclang or -mlinker-version to GCC. // PR12920 -- Check also we may not forward W_Group options to GCC. // // RUN: %clang -target powerpc-unknown-unknown \ // RUN: %s \ // RUN: -Wall -Wdocumentation \ // RUN: -Xclang foo-bar \ // RUN: -march=x86_64 \ // RUN: -mlinker-version=10 -### 2> %t // RUN: FileCheck < %t %s // // clang-cc1 // CHECK: "-Wall" "-Wdocumentation" // CHECK: "-o" "{{[^"]+}}.o" // // gcc-ld // CHECK: gcc{{[^"]*}}" // CHECK-NOT: "-mlinker-version=10" // CHECK-NOT: "-Xclang" // CHECK-NOT: "foo-bar" // CHECK-NOT: "-Wall" // CHECK-NOT: "-Wdocumentation" // CHECK: -march // CHECK-NOT: "-mlinker-version=10" // CHECK-NOT: "-Xclang" // CHECK-NOT: "foo-bar" // CHECK-NOT: "-Wall" // CHECK-NOT: "-Wdocumentation" // CHECK: "-o" "a.out"
// Check that we don't try to forward -Xclang or -mlinker-version to GCC. // PR12920 -- Check also we may not forward W_Group options to GCC. // // RUN: %clang -target powerpc-unknown-unknown \ // RUN: %s \ // RUN: -Wall -Wdocumentation \ // RUN: -Xclang foo-bar \ // RUN: -march=x86_64 \ // RUN: -mlinker-version=10 -### 2> %t // RUN: FileCheck < %t %s // // clang-cc1 // CHECK: "-Wall" "-Wdocumentation" // CHECK: "-o" "{{[^"]+}}.o" // // gcc-ld // CHECK: gcc{{[^"]*}}" // CHECK-NOT: "-mlinker-version=10" // CHECK-NOT: "-Xclang" // CHECK-NOT: "foo-bar" // CHECK-NOT: "-Wall" // CHECK-NOT: "-Wdocumentation" // CHECK: -march // CHECK-NOT: "-mlinker-version=10" // CHECK-NOT: "-Xclang" // CHECK-NOT: "foo-bar" // CHECK-NOT: "-Wall" // CHECK-NOT: "-Wdocumentation" // CHECK: "-o" "a.out" // Check that we're not forwarding -g options to the assembler // RUN: %clang -g -target x86_64-unknown-linux-gnu -no-integrated-as -c %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-ASM %s // CHECK-ASM: as // CHECK-ASM-NOT: "-g"
Test that we're not forwarding on -g options to the non integrated assembler.
Test that we're not forwarding on -g options to the non integrated assembler. This is adding a test for an old fixed PR to make sure we don't regress. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@257009 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
d3a669ffe7ceca3781ff9452a643286850ad32a9
packages/Python/lldbsuite/test/functionalities/swift-runtime-reporting/abi-v2/library.h
packages/Python/lldbsuite/test/functionalities/swift-runtime-reporting/abi-v2/library.h
// library.h // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // // ----------------------------------------------------------------------------- // From swift's include/swift/Runtime/Debug.h file. struct RuntimeErrorDetails { uintptr_t version; const char *errorType; const char *currentStackDescription; uintptr_t framesToSkip; void *memoryAddress; struct Thread { const char *description; uint64_t threadID; uintptr_t numFrames; void **frames; }; uintptr_t numExtraThreads; Thread *threads; struct FixIt { const char *filename; uintptr_t startLine; uintptr_t startColumn; uintptr_t endLine; uintptr_t endColumn; const char *replacementText; }; struct Note { const char *description; uintptr_t numFixIts; FixIt *fixIts; }; uintptr_t numFixIts; FixIt *fixIts; uintptr_t numNotes; Note *notes; }; enum: uintptr_t { RuntimeErrorFlagNone = 0, RuntimeErrorFlagFatal = 1 << 0 }; extern "C" void _swift_runtime_on_report(uintptr_t flags, const char *message, RuntimeErrorDetails *details);
// library.h // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // // ----------------------------------------------------------------------------- #include <stdint.h> // From swift's include/swift/Runtime/Debug.h file. struct RuntimeErrorDetails { uintptr_t version; const char *errorType; const char *currentStackDescription; uintptr_t framesToSkip; void *memoryAddress; struct Thread { const char *description; uint64_t threadID; uintptr_t numFrames; void **frames; }; uintptr_t numExtraThreads; Thread *threads; struct FixIt { const char *filename; uintptr_t startLine; uintptr_t startColumn; uintptr_t endLine; uintptr_t endColumn; const char *replacementText; }; struct Note { const char *description; uintptr_t numFixIts; FixIt *fixIts; }; uintptr_t numFixIts; FixIt *fixIts; uintptr_t numNotes; Note *notes; }; enum: uintptr_t { RuntimeErrorFlagNone = 0, RuntimeErrorFlagFatal = 1 << 0 }; extern "C" void _swift_runtime_on_report(uintptr_t flags, const char *message, RuntimeErrorDetails *details);
Include the necessary headers to make the swift-runtime-reporting test work.
[testsuite] Include the necessary headers to make the swift-runtime-reporting test work.
C
apache-2.0
apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb
58aa106997fb828a292457b0668e8497fa253f7d
include/KeyPoint.h
include/KeyPoint.h
/* * Modified version of Keypoint.h * Source location: https://github.com/pippy360/transformationInvariantImageSearch/blob/master/fullEndToEndDemo/src/Keypoint.h */ #pragma once #ifndef REVERSE_IMAGE_SEARCH_KEYPOINT_H #define REVERSE_IMAGE_SEARCH_KEYPOINT_H #include <iostream> #include <sstream> using namespace std; class KeyPoint { public: double x_, y_; KeyPoint(double x, double y) { x_ = x; y_ = y; }; /** * Convert a KeyPoint to a string * @return string */ string ToString() { std::ostringstream string_stream_; string_stream_<< "KeyPoint[ " << x_ << ", " << y_ << "]"; return string_stream_.str(); } }; namespace hash { template <> struct hash<KeyPoint> { std::size_t operator()(const KeyPoint &k) const { using std::hash; return ((hash<double>()(k.x_) ^ (hash<double>()(k.y_) << 1)) >> 1); } }; } #endif
/* * Modified version of Keypoint.h * Source location: https://github.com/pippy360/transformationInvariantImageSearch/blob/master/fullEndToEndDemo/src/Keypoint.h */ #pragma once #ifndef REVERSE_IMAGE_SEARCH_KEYPOINT_H #define REVERSE_IMAGE_SEARCH_KEYPOINT_H #include <iostream> #include <sstream> #include <math.h> using namespace std; class KeyPoint { public: double x_, y_; KeyPoint(double x, double y) { x_ = x; y_ = y; }; /** * Convert a KeyPoint to a string * @return string */ string ToString() { std::ostringstream string_stream_; string_stream_<< "KeyPoint[ " << x_ << ", " << y_ << "]"; return string_stream_.str(); } }; namespace std { template <> struct hash<KeyPoint> { std::size_t operator()(const KeyPoint &k) const { using std::hash; return ((hash<double>()(k.x_) ^ (hash<double>()(k.y_) << 1)) >> 1); } }; } #endif
Resolve compilation issue due to missing math.h inclusion
Resolve compilation issue due to missing math.h inclusion
C
mit
rmcqueen/reverse-image-search
a149716b29f626bfb3f3aa15722bac51fc05bac0
src/fake-lock-screen-pattern.h
src/fake-lock-screen-pattern.h
#ifndef _FAKE_LOCK_SCREEN_PATTERN_H_ #define _FAKE_LOCK_SCREEN_PATTERN_H_ #include <gtk/gtk.h> #if !GTK_CHECK_VERSION(3, 0, 0) typedef struct { gdouble red; gdouble green; gdouble blue; gdouble alpha; } GdkRGBA; #endif void flsp_draw_circle(cairo_t *context, gint x, gint y, gint radius, GdkRGBA circle, GdkRGBA border); #endif
#ifndef _FAKE_LOCK_SCREEN_PATTERN_H_ #define _FAKE_LOCK_SCREEN_PATTERN_H_ #include <gtk/gtk.h> #if !GTK_CHECK_VERSION(3, 0, 0) typedef struct { gdouble red; gdouble green; gdouble blue; gdouble alpha; } GdkRGBA; #endif void flsp_draw_circle(cairo_t *context, gint x, gint y, gint radius, GdkRGBA circle, GdkRGBA border); gboolean is_marked(gint x, gint y, gint *marked, void *user_data); #endif
Add prototype to judge marked point
Add prototype to judge marked point
C
mit
kenhys/fake-lock-screen-pattern,kenhys/fake-lock-screen-pattern
a64ce60a9291cc47f1f6298c0c9e3bbdf274350b
tests/hwloc_insert_misc.c
tests/hwloc_insert_misc.c
/* * Copyright © 2009 CNRS * Copyright © 2009-2010 INRIA * Copyright © 2009-2010 Université Bordeaux 1 * See COPYING in top-level directory. */ #include <private/config.h> #include <hwloc.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <assert.h> int main(void) { hwloc_topology_t topology; hwloc_bitmap_t cpuset; hwloc_obj_t obj; hwloc_topology_init(&topology); hwloc_topology_load(topology); hwloc_topology_check(topology); cpuset = hwloc_bitmap_alloc(); hwloc_bitmap_set(cpuset, 0); obj = hwloc_topology_insert_misc_object_by_cpuset(topology, cpuset, "test"); hwloc_topology_insert_misc_object_by_parent(topology, obj, "test2"); hwloc_topology_check(topology); hwloc_topology_destroy(topology); return 0; }
/* * Copyright © 2009 CNRS * Copyright © 2009-2010 INRIA * Copyright © 2009-2010 Université Bordeaux 1 * See COPYING in top-level directory. */ #include <private/config.h> #include <hwloc.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <assert.h> int main(void) { hwloc_topology_t topology; hwloc_bitmap_t cpuset; hwloc_obj_t obj; hwloc_topology_init(&topology); hwloc_topology_load(topology); hwloc_topology_check(topology); cpuset = hwloc_bitmap_alloc(); hwloc_bitmap_set(cpuset, 0); obj = hwloc_topology_insert_misc_object_by_cpuset(topology, cpuset, "test"); hwloc_bitmap_free(cpuset); hwloc_topology_insert_misc_object_by_parent(topology, obj, "test2"); hwloc_topology_check(topology); hwloc_topology_destroy(topology); return 0; }
Fix a memory leak in tests
Fix a memory leak in tests git-svn-id: 14be032f8f42541b1a281b51ae8ea69814daf20e@2903 4b44e086-7f34-40ce-a3bd-00e031736276
C
bsd-3-clause
BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc
4d26f6b0448ad636fb3f00c708b1a442c27c7872
common/uart.h
common/uart.h
#ifndef _UART_H_ #define _UART_H_ #include "mk20dx256.h" void uart_setup(UART_MemMapPtr base, int baud); void uart_putchar(UART_MemMapPtr base, char ch); void uart_putline(UART_MemMapPtr base, char * str); #endif
#ifndef _UART_H_ #define _UART_H_ #include "mk20dx256.h" #include "pins.h" void uart_setup(UART_MemMapPtr base, int baud); void uart_putchar(UART_MemMapPtr base, char ch); void uart_putline(UART_MemMapPtr base, char * str); /* * Convenience function to setup UART0 on pins 0 and 1 with 115200 baud */ inline static void uart0_setup_default() { PIN0_PORT_PCR = PORT_PCR_MUX(3); PIN1_PORT_PCR = PORT_PCR_MUX(3); uart_setup(UART0_BASE_PTR, 115200); } inline static void uart0_putchar(char ch) { uart_putchar(UART0_BASE_PTR, ch); } inline static void uart0_putline(char * str) { uart_putline(UART0_BASE_PTR, str); } #endif
Add convenience functions for UART0
Add convenience functions for UART0
C
apache-2.0
mensi/teensy_bare_metal,mensi/teensy_bare_metal,mensi/teensy_bare_metal
78b639ee5f507bf43f7570d025b82bf4d28f602c
libc/sysdeps/linux/powerpc/bits/msq.h
libc/sysdeps/linux/powerpc/bits/msq.h
/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SYS_MSG_H # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." #endif #include <bits/types.h> /* Define options for message queue functions. */ #define MSG_NOERROR 010000 /* no error if message is too big */ #ifdef __USE_GNU # define MSG_EXCEPT 020000 /* recv any msg except of specified type */ #endif /* Types used in the structure definition. */ typedef unsigned long int msgqnum_t; typedef unsigned long int msglen_t; /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { struct ipc_perm msg_perm; /* structure describing operation permission */ unsigned int __unused1; __time_t msg_stime; /* time of last msgsnd command */ unsigned int __unused2; __time_t msg_rtime; /* time of last msgrcv command */ unsigned int __unused3; __time_t msg_ctime; /* time of last change */ unsigned long __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ __pid_t msg_lspid; /* pid of last msgsnd() */ __pid_t msg_lrpid; /* pid of last msgrcv() */ unsigned long __unused4; unsigned long __unused5; }; #ifdef __USE_MISC # define msg_cbytes __msg_cbytes /* ipcs ctl commands */ # define MSG_STAT 11 # define MSG_INFO 12 /* buffer for msgctl calls IPC_INFO, MSG_INFO */ struct msginfo { int msgpool; int msgmap; int msgmax; int msgmnb; int msgmni; int msgssz; int msgtql; unsigned short int msgseg; }; #endif /* __USE_MISC */
Make powerpc compile. Needs this header...
Make powerpc compile. Needs this header...
C
lgpl-2.1
m-labs/uclibc-lm32,wbx-github/uclibc-ng,kraj/uClibc,gittup/uClibc,groundwater/uClibc,ndmsystems/uClibc,OpenInkpot-archive/iplinux-uclibc,waweber/uclibc-clang,kraj/uclibc-ng,klee/klee-uclibc,ChickenRunjyd/klee-uclibc,skristiansson/uClibc-or1k,kraj/uClibc,waweber/uclibc-clang,foss-xtensa/uClibc,skristiansson/uClibc-or1k,foss-xtensa/uClibc,klee/klee-uclibc,waweber/uclibc-clang,kraj/uclibc-ng,ChickenRunjyd/klee-uclibc,atgreen/uClibc-moxie,brgl/uclibc-ng,ddcc/klee-uclibc-0.9.33.2,klee/klee-uclibc,mephi42/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,ysat0/uClibc,hjl-tools/uClibc,klee/klee-uclibc,mephi42/uClibc,czankel/xtensa-uclibc,skristiansson/uClibc-or1k,kraj/uClibc,kraj/uclibc-ng,foss-xtensa/uClibc,mephi42/uClibc,ffainelli/uClibc,hwoarang/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,atgreen/uClibc-moxie,czankel/xtensa-uclibc,foss-xtensa/uClibc,ddcc/klee-uclibc-0.9.33.2,ddcc/klee-uclibc-0.9.33.2,wbx-github/uclibc-ng,hwoarang/uClibc,brgl/uclibc-ng,skristiansson/uClibc-or1k,ndmsystems/uClibc,hjl-tools/uClibc,hjl-tools/uClibc,czankel/xtensa-uclibc,groundwater/uClibc,groundwater/uClibc,OpenInkpot-archive/iplinux-uclibc,ndmsystems/uClibc,wbx-github/uclibc-ng,m-labs/uclibc-lm32,majek/uclibc-vx32,OpenInkpot-archive/iplinux-uclibc,waweber/uclibc-clang,m-labs/uclibc-lm32,atgreen/uClibc-moxie,hwoarang/uClibc,gittup/uClibc,ddcc/klee-uclibc-0.9.33.2,ffainelli/uClibc,czankel/xtensa-uclibc,majek/uclibc-vx32,brgl/uclibc-ng,OpenInkpot-archive/iplinux-uclibc,atgreen/uClibc-moxie,ysat0/uClibc,gittup/uClibc,kraj/uclibc-ng,ysat0/uClibc,kraj/uClibc,majek/uclibc-vx32,hjl-tools/uClibc,ndmsystems/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,wbx-github/uclibc-ng,ffainelli/uClibc,ChickenRunjyd/klee-uclibc,majek/uclibc-vx32,ysat0/uClibc,groundwater/uClibc,m-labs/uclibc-lm32,gittup/uClibc,brgl/uclibc-ng,ffainelli/uClibc,ffainelli/uClibc,groundwater/uClibc,hwoarang/uClibc,hjl-tools/uClibc,ChickenRunjyd/klee-uclibc,mephi42/uClibc
7124f160555bee9fb154b73893de6e853fe31441
test/Misc/serialized-diags-stable.c
test/Misc/serialized-diags-stable.c
// RUN: rm -f %t // RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1 // RUN: c-index-test -read-diagnostics %t.dia 2>&1 | FileCheck %s // RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s int foo() { // CHECK: serialized-diags-stable.c:[[@LINE+2]]:1: warning: control reaches end of non-void function [-Wreturn-type] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 } // CHECK: serialized-diags-stable.c:[[@LINE+5]]:13: error: redefinition of 'bar' as different kind of symbol [] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 // CHECK-NEXT: +-/Volumes/Lore/llvm-public/clang/test/Misc/serialized-diags-stable.c:[[@LINE+2]]:6: note: previous definition is here [] [] // CHECK-NEXT: Number FIXITs = 0 void bar() {} typedef int bar; // CHECK-LABEL: Number of diagnostics: 2
// RUN: rm -f %t // RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1 // RUN: c-index-test -read-diagnostics %t.dia 2>&1 | FileCheck %s // RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s int foo() { // CHECK: serialized-diags-stable.c:[[@LINE+2]]:1: warning: control reaches end of non-void function [-Wreturn-type] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 } // CHECK: serialized-diags-stable.c:[[@LINE+5]]:13: error: redefinition of 'bar' as different kind of symbol [] [Semantic Issue] // CHECK-NEXT: Number FIXITs = 0 // CHECK-NEXT: +-serialized-diags-stable.c:[[@LINE+2]]:6: note: previous definition is here [] [] // CHECK-NEXT: Number FIXITs = 0 void bar() {} typedef int bar; // CHECK-LABEL: Number of diagnostics: 2
Remove absolute path from r202733.
Remove absolute path from r202733. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@202746 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,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
938b137bf0d12a999ae823e3e33ab5825810cf26
tests/regression/01-cpa/10-posneg.c
tests/regression/01-cpa/10-posneg.c
#include<stdio.h> #include<assert.h> int main() { int i,k,j; if (k == 5) { assert(k == 5); return 0; } assert(k != 5); // simple arithmetic i = k + 1; assert(i != 6); i = k - 1; assert(i != 4); i = k * 2; assert(i != 10); // UNKNOWN! k could be -2147483643; i = k / 2; assert(i != 2); // UNKNOWN! k could be 4 return 0; }
#include<stdio.h> #include<assert.h> int main() { int i,k,j; if (k == 5) { assert(k == 5); return 0; } assert(k != 5); // simple arithmetic i = k + 1; assert(i != 6); i = k - 1; assert(i != 4); i = k * 3; // multiplication with odd numbers is injective assert(i != 15); i = k * 2; // multiplication with even numbers is not-injective assert(i != 10); // UNKNOWN! k could be -2147483643; i = k / 2; assert(i != 2); // UNKNOWN! k could be 4 return 0; }
Add assertion about result of multiplication to test
Add assertion about result of multiplication to test
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
bffdbdfa6d6527f3a4eec98cb64d711fa1d3ac59
insts/jg/VOCODE2/VOCODE2.h
insts/jg/VOCODE2/VOCODE2.h
#include <objlib.h> #define MAXFILTS 30 class VOCODE2 : public Instrument { int skip, numfilts, branch; float amp, aamp, pctleft, noise_amp, hipass_mod_amp; float *in, *amparray, amptabs[2]; SubNoiseL *noise; Butter *modulator_filt[MAXFILTS], *carrier_filt[MAXFILTS], *hipassmod; Balance *balancer[MAXFILTS]; public: VOCODE2(); virtual ~VOCODE2(); int init(float *, int); int run(); };
#include <objlib.h> #define MAXFILTS 200 class VOCODE2 : public Instrument { int skip, numfilts, branch; float amp, aamp, pctleft, noise_amp, hipass_mod_amp; float *in, *amparray, amptabs[2]; SubNoiseL *noise; Butter *modulator_filt[MAXFILTS], *carrier_filt[MAXFILTS], *hipassmod; Balance *balancer[MAXFILTS]; public: VOCODE2(); virtual ~VOCODE2(); int init(float *, int); int run(); };
Raise limit on number of filter bands.
Raise limit on number of filter bands.
C
apache-2.0
RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix
ec7b94e3440ec7203a98e5862c99124a96e2437e
src/lua/helpers/lua_static_member.h
src/lua/helpers/lua_static_member.h
/*ckwg +5 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. */ #ifndef VISTK_LUA_PIPELINE_LUA_STATIC_MEMBER_H #define VISTK_LUA_PIPELINE_LUA_STATIC_MEMBER_H #include "lua_include.h" #include <cstring> /** * \file lua_static_member.h * * \brief Helpers setting static members on objects in Lua. */ #define LUA_STATIC_boolean(var) var #define LUA_STATIC_cfunction(var) &var #define LUA_STATIC_integer(var) var #define LUA_STATIC_literal(var) var #define LUA_STATIC_lstring(var) var, strlen(var) #define LUA_STATIC_number(var) var #define LUA_STATIC_string(var) var.c_str() #define LUA_STATIC_MEMBER(interp, type, var, name) \ do \ { \ lua_push##type(interp, LUA_STATIC_##type(var)); \ lua_setfield(L, -2, name); \ } while (false) #endif // VISTK_LUA_PIPELINE_LUA_STATIC_MEMBER_H
Add macro to set static members on lua classes
Add macro to set static members on lua classes
C
bsd-3-clause
mathstuf/sprokit,Kitware/sprokit,Kitware/sprokit,Kitware/sprokit,linus-sherrill/sprokit,linus-sherrill/sprokit,mathstuf/sprokit,linus-sherrill/sprokit,linus-sherrill/sprokit,mathstuf/sprokit,Kitware/sprokit,mathstuf/sprokit
47300b3e0591f3349e8bb61589adf1b175da3d81
test/Driver/amdgpu-toolchain.c
test/Driver/amdgpu-toolchain.c
// RUN: %clang -### -target amdgcn--amdhsa -x assembler -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=AS_LINK %s // AS_LINK: bin/clang{{.*}} "-cc1as" // AS_LINK: bin/lld{{.*}} "-flavor" "gnu" "-target" "amdgcn--amdhsa"
// RUN: %clang -### -target amdgcn--amdhsa -x assembler -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=AS_LINK %s // AS_LINK: bin/clang{{.*}} "-cc1as" // AS_LINK: lld{{.*}} "-flavor" "gnu" "-target" "amdgcn--amdhsa"
Handle lld not being found in PATH.
Handle lld not being found in PATH. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@248035 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
8b39c208106d5480723805893049ac8212ff39f0
test/Misc/pr32207.c
test/Misc/pr32207.c
// test for r305179 // RUN: %clang_cc1 -emit-llvm -O -mllvm -print-after-all %s -o %t 2>&1 | grep '*** IR Dump After Function Integration/Inlining ***' void foo() {}
Add regression test for r305179.
Add regression test for r305179. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@305213 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang