after
stringlengths
72
2.11k
before
stringlengths
21
1.55k
diff
stringlengths
85
2.31k
instruction
stringlengths
20
1.71k
license
stringclasses
13 values
repos
stringlengths
7
82.6k
commit
stringlengths
40
40
// // MFSideMenuShadow.h // MFSideMenuDemoSearchBar // // Created by Michael Frederick on 5/13/13. // Copyright (c) 2013 Frederick Development. All rights reserved. // #import <Foundation/Foundation.h> @interface MFSideMenuShadow : NSObject @property (nonatomic, assign) BOOL enabled; @property (nonatomic, assign) CGFloat radius; @property (nonatomic, assign) CGFloat opacity; @property (nonatomic, strong) UIColor *color; @property (nonatomic, assign) UIView *shadowedView; + (MFSideMenuShadow *)shadowWithView:(UIView *)shadowedView; + (MFSideMenuShadow *)shadowWithColor:(UIColor *)color radius:(CGFloat)radius opacity:(CGFloat)opacity; - (void)draw; - (void)shadowedViewWillRotate; - (void)shadowedViewDidRotate; @end
// // MFSideMenuShadow.h // MFSideMenuDemoSearchBar // // Created by Michael Frederick on 5/13/13. // Copyright (c) 2013 Frederick Development. All rights reserved. // #import <Foundation/Foundation.h> @interface MFSideMenuShadow : NSObject @property (nonatomic, assign) BOOL enabled; @property (nonatomic, assign) CGFloat radius; @property (nonatomic, assign) CGFloat opacity; @property (nonatomic, strong) UIColor *color; @property (nonatomic, weak) UIView *shadowedView; + (MFSideMenuShadow *)shadowWithView:(UIView *)shadowedView; + (MFSideMenuShadow *)shadowWithColor:(UIColor *)color radius:(CGFloat)radius opacity:(CGFloat)opacity; - (void)draw; - (void)shadowedViewWillRotate; - (void)shadowedViewDidRotate; @end
--- +++ @@ -14,7 +14,7 @@ @property (nonatomic, assign) CGFloat radius; @property (nonatomic, assign) CGFloat opacity; @property (nonatomic, strong) UIColor *color; -@property (nonatomic, weak) UIView *shadowedView; +@property (nonatomic, assign) UIView *shadowedView; + (MFSideMenuShadow *)shadowWithView:(UIView *)shadowedView; + (MFSideMenuShadow *)shadowWithColor:(UIColor *)color radius:(CGFloat)radius opacity:(CGFloat)opacity;
Change weak reference to assign for backwards compatibility
bsd-3-clause
appcom-interactive/MFSideMenu,Magnat12/MFSideMenu,mikefrederick/MFSideMenu,andrespch/MFSideMenu,AxialExchange/MFSideMenu,eleostech/MFSideMenu
d3b29d4bbec8837a655dde42f2b0cdb852b2626d
#include "e.h" #include "e_mod_main.h" #include "e_mod_config.h" #include "e_kbd_int.h" /* local variables */ static E_Kbd_Int *ki = NULL; EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Keyboard" }; EAPI void * e_modapi_init(E_Module *m) { if (!il_kbd_config_init(m)) return NULL; ki = e_kbd_int_new(il_kbd_cfg->mod_dir, il_kbd_cfg->mod_dir, il_kbd_cfg->mod_dir); return m; } EAPI int e_modapi_shutdown(E_Module *m) { if (ki) { e_kbd_int_free(ki); ki = NULL; } il_kbd_config_shutdown(); return 1; } EAPI int e_modapi_save(E_Module *m) { return il_kbd_config_save(); }
#include "e.h" #include "e_mod_main.h" #include "e_mod_config.h" #include "e_kbd_int.h" /* local variables */ static E_Kbd_Int *ki = NULL; EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Keyboard" }; EAPI void * e_modapi_init(E_Module *m) { if (!il_kbd_config_init(m)) return NULL; ki = e_kbd_int_new(mod_dir, mod_dir, mod_dir); return m; } EAPI int e_modapi_shutdown(E_Module *m) { if (ki) { e_kbd_int_free(ki); ki = NULL; } il_kbd_config_shutdown(); return 1; } EAPI int e_modapi_save(E_Module *m) { return il_kbd_config_save(); }
--- +++ @@ -13,7 +13,8 @@ { if (!il_kbd_config_init(m)) return NULL; - ki = e_kbd_int_new(mod_dir, mod_dir, mod_dir); + ki = e_kbd_int_new(il_kbd_cfg->mod_dir, + il_kbd_cfg->mod_dir, il_kbd_cfg->mod_dir); return m; }
Use correct module directory when making keyboard. Previous commit fixed compiler warnings also. SVN revision: 43875
bsd-2-clause
FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,rvandegrift/e,tizenorg/platform.upstream.enlightenment,tasn/enlightenment,tasn/enlightenment,rvandegrift/e,FlorentRevest/Enlightenment
8166b9fe84e0dc3c8877366b58a9286b0258172f
#ifdef USE_INSTANT_OSX #include "hitimes_interval.h" #include <mach/mach.h> #include <mach/mach_time.h> /* All this OSX code is adapted from http://developer.apple.com/library/mac/#qa/qa1398/_index.html */ /* * returns the conversion factor, this value is used to convert * the value from hitimes_get_current_instant() into seconds */ long double hitimes_instant_conversion_factor() { static mach_timebase_info_data_t s_timebase_info; static long double conversion_factor; static uint64_t nano_conversion; /** * If this is the first time we've run, get the timebase. * We can use denom == 0 to indicate that s_timebase_info is * uninitialised because it makes no sense to have a zero * denominator is a fraction. */ if ( s_timebase_info.denom == 0 ) { mach_timebase_info(&s_timebase_info); nano_conversion = s_timebase_info.numer / s_timebase_info.denom; conversion_factor = (long double) (nano_conversion) * (1e9l); } return conversion_factor; } /* * returns the mach absolute time, which has no meaning outside of a conversion * factor. */ hitimes_instant_t hitimes_get_current_instant() { return mach_absolute_time(); } #endif
#ifdef USE_INSTANT_OSX #include "hitimes_interval.h" #include <mach/mach.h> #include <mach/mach_time.h> /* All this OSX code is adapted from http://developer.apple.com/library/mac/#qa/qa1398/_index.html */ /* * returns the conversion factor, this value is used to convert * the value from hitimes_get_current_instant() into seconds */ long double hitimes_instant_conversion_factor() { static mach_timebase_info_data_t s_timebase_info; static long double conversion_factor; /** * If this is the first time we've run, get the timebase. * We can use denom == 0 to indicate that s_timebase_info is * uninitialised because it makes no sense to have a zero * denominator is a fraction. */ if ( s_timebase_info.denom == 0 ) { (void) mach_timebase_info(&s_timebase_info); uint64_t nano_conversion = s_timebase_info.numer / s_timebase_info.denom; conversion_factor = (long double) (nano_conversion) * (1e9l); } return conversion_factor; } /* * returns the mach absolute time, which has no meaning outside of a conversion * factor. */ hitimes_instant_t hitimes_get_current_instant() { return mach_absolute_time(); } #endif
--- +++ @@ -14,6 +14,7 @@ { static mach_timebase_info_data_t s_timebase_info; static long double conversion_factor; + static uint64_t nano_conversion; /** * If this is the first time we've run, get the timebase. @@ -23,9 +24,9 @@ */ if ( s_timebase_info.denom == 0 ) { - (void) mach_timebase_info(&s_timebase_info); - uint64_t nano_conversion = s_timebase_info.numer / s_timebase_info.denom; - conversion_factor = (long double) (nano_conversion) * (1e9l); + mach_timebase_info(&s_timebase_info); + nano_conversion = s_timebase_info.numer / s_timebase_info.denom; + conversion_factor = (long double) (nano_conversion) * (1e9l); } return conversion_factor;
Clean up C Compiler warning about declaration of variables.
isc
copiousfreetime/hitimes,modulexcite/hitimes,modulexcite/hitimes,modulexcite/hitimes
9220eaea6f9afba4cc3bc6a0ff240f3492ff5997
#include "rbuv.h" ID id_call; VALUE mRbuv; VALUE rbuv_version(VALUE self); VALUE rbuv_version_string(VALUE self); void Init_rbuv() { id_call = rb_intern("call"); mRbuv = rb_define_module("Rbuv"); rb_define_singleton_method(mRbuv, "version", rbuv_version, 0); rb_define_singleton_method(mRbuv, "version_string", rbuv_version_string, 0); Init_rbuv_error(); Init_rbuv_handle(); Init_rbuv_loop(); Init_rbuv_timer(); Init_rbuv_stream(); Init_rbuv_tcp(); Init_rbuv_signal(); } VALUE rbuv_version(VALUE self) { return UINT2NUM(uv_version()); } VALUE rbuv_version_string(VALUE self) { return rb_str_new2(uv_version_string()); }
#include "rbuv.h" ID id_call; VALUE mRbuv; void Init_rbuv() { id_call = rb_intern("call"); mRbuv = rb_define_module("Rbuv"); Init_rbuv_error(); Init_rbuv_handle(); Init_rbuv_loop(); Init_rbuv_timer(); Init_rbuv_stream(); Init_rbuv_tcp(); Init_rbuv_signal(); }
--- +++ @@ -4,10 +4,16 @@ VALUE mRbuv; +VALUE rbuv_version(VALUE self); +VALUE rbuv_version_string(VALUE self); + void Init_rbuv() { id_call = rb_intern("call"); mRbuv = rb_define_module("Rbuv"); + rb_define_singleton_method(mRbuv, "version", rbuv_version, 0); + rb_define_singleton_method(mRbuv, "version_string", rbuv_version_string, 0); + Init_rbuv_error(); Init_rbuv_handle(); Init_rbuv_loop(); @@ -16,3 +22,11 @@ Init_rbuv_tcp(); Init_rbuv_signal(); } + +VALUE rbuv_version(VALUE self) { + return UINT2NUM(uv_version()); +} + +VALUE rbuv_version_string(VALUE self) { + return rb_str_new2(uv_version_string()); +}
Add singleton methods to access libuv version
mit
arthurdandrea/rbuv,arthurdandrea/rbuv
ead111a8e26f98570cfdb9b3b849e5fac3ca7e7b
#include "../Interface/Thread.h" #include "../Interface/Mutex.h" class ClientMain; struct SProcess; class ServerPingThread : public IThread { public: ServerPingThread(ClientMain *client_main, const std::string& clientname, size_t status_id, bool with_eta, std::string server_token); void operator()(void); void setStop(bool b); bool isTimeout(void); private: void setPaused(SProcess* proc, bool b); ClientMain *client_main; volatile bool stop; volatile bool is_timeout; bool with_eta; std::string clientname; size_t status_id; std::string server_token; };
#include "../Interface/Thread.h" #include "../Interface/Mutex.h" class ClientMain; struct SProcess; class ServerPingThread : public IThread { public: ServerPingThread(ClientMain *client_main, const std::string& clientname, size_t status_id, bool with_eta, std::string server_token); void operator()(void); void setStop(bool b); bool isTimeout(void); private: void setPaused(SProcess* proc, bool b); ClientMain *client_main; volatile bool stop; volatile bool is_timeout; bool with_eta; const std::string& clientname; size_t status_id; std::string server_token; };
--- +++ @@ -20,7 +20,7 @@ volatile bool stop; volatile bool is_timeout; bool with_eta; - const std::string& clientname; + std::string clientname; size_t status_id; std::string server_token; };
Copy clientname instead of reference
agpl-3.0
uroni/urbackup_backend,uroni/urbackup_backend,uroni/urbackup_backend,uroni/urbackup_backend,uroni/urbackup_backend,uroni/urbackup_backend,uroni/urbackup_backend
f9f554b9710c0f5dfd758071d4a6272c2274add4
/* * Copyright © 2009 CNRS * Copyright © 2009-2010 INRIA. All rights reserved. * Copyright © 2009 Université Bordeaux 1 * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ #include <private/autogen/config.h> #ifdef HWLOC_HAVE_XML #include <hwloc.h> #include <string.h> #include "lstopo.h" void output_xml(hwloc_topology_t topology, const char *filename, int logical __hwloc_attribute_unused, int legend __hwloc_attribute_unused, int verbose_mode __hwloc_attribute_unused) { if (!filename || !strcasecmp(filename, "-.xml")) filename = "-"; if (hwloc_topology_export_xml(topology, filename) < 0) { fprintf(stderr, "Failed to export XML to %s (%s)\n", filename, strerror(errno)); return; } } #endif /* HWLOC_HAVE_XML */
/* * Copyright © 2009 CNRS * Copyright © 2009-2010 INRIA. All rights reserved. * Copyright © 2009 Université Bordeaux 1 * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ #include <private/autogen/config.h> #ifdef HWLOC_HAVE_XML #include <hwloc.h> #include <string.h> #include "lstopo.h" void output_xml(hwloc_topology_t topology, const char *filename, int logical __hwloc_attribute_unused, int legend __hwloc_attribute_unused, int verbose_mode __hwloc_attribute_unused) { if (!filename || !strcasecmp(filename, "-.xml")) filename = "-"; hwloc_topology_export_xml(topology, filename); } #endif /* HWLOC_HAVE_XML */
--- +++ @@ -20,7 +20,10 @@ if (!filename || !strcasecmp(filename, "-.xml")) filename = "-"; - hwloc_topology_export_xml(topology, filename); + if (hwloc_topology_export_xml(topology, filename) < 0) { + fprintf(stderr, "Failed to export XML to %s (%s)\n", filename, strerror(errno)); + return; + } } #endif /* HWLOC_HAVE_XML */
Print an error when lstopo fails to export to XML git-svn-id: 14be032f8f42541b1a281b51ae8ea69814daf20e@3691 4b44e086-7f34-40ce-a3bd-00e031736276
bsd-3-clause
BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc,BlueBrain/hwloc
c9996dfdabcc6e4639240ec90ac3a97912b686ec
/* * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdio.h> #include <usbg/usbg.h> #include "backend.h" #include "udc.h" static int udc_func(void *data) { usbg_udc *u; const char *name; usbg_for_each_udc(u, backend_ctx.libusbg_state) { name = usbg_get_udc_name(u); if (name == NULL) { fprintf(stderr, "Error getting udc name\n"); return -1; } puts(name); } return 0; } struct gt_udc_backend gt_udc_backend_libusbg = { .udc = udc_func, };
/* * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "udc.h" #include <stdlib.h> struct gt_udc_backend gt_udc_backend_libusbg = { .udc = NULL, };
--- +++ @@ -14,10 +14,30 @@ * limitations under the License. */ +#include <stdio.h> +#include <usbg/usbg.h> +#include "backend.h" #include "udc.h" -#include <stdlib.h> + +static int udc_func(void *data) +{ + usbg_udc *u; + const char *name; + + usbg_for_each_udc(u, backend_ctx.libusbg_state) { + name = usbg_get_udc_name(u); + if (name == NULL) { + fprintf(stderr, "Error getting udc name\n"); + return -1; + } + + puts(name); + } + + return 0; +} struct gt_udc_backend gt_udc_backend_libusbg = { - .udc = NULL, + .udc = udc_func, };
udc: Add gadget udc command at libusbg backend Change-Id: If1510069df2e6cd2620c89576ebba80685cb07d7 Signed-off-by: Pawel Szewczyk <1691dcf8dab804b326e5e4b9ab228a1c3b23a2f2@samsung.com>
apache-2.0
kopasiak/gt,kopasiak/gt
96430e414762391ff89b48b6c63c0983ff11365f
#ifndef GPIOLIB_H #define GPIOLIB_H #define FORWARD 1 #define BACKWARD 0 namespace GPIO { int init(); //direction is either FORWARD or BACKWARD. speed can be an integer ranging from 0 to 100. int controlLeft(int direction,int speed); int controlRight(int direction,int speed); int stopLeft(); int stopRight(); int resetCounter(); void getCounter(int *countLeft,int *countRight); //angle is available in the range of -90 to 90. int turnTo(int angle); void delay(int milliseconds); } #endif
#ifndef GPIOLIB_H #define GPIOLIB_H #define FORWARD 1 #define BACKWARD 0 namespace GPIO { int init(); int controlLeft(int direction,int speed); int controlRight(int direction,int speed); int stopLeft(); int stopRight(); int resetCounter(); void getCounter(int *countLeft,int *countRight); int turnTo(int angle); void delay(int milliseconds); } #endif
--- +++ @@ -8,6 +8,7 @@ { int init(); + //direction is either FORWARD or BACKWARD. speed can be an integer ranging from 0 to 100. int controlLeft(int direction,int speed); int controlRight(int direction,int speed); int stopLeft(); @@ -15,6 +16,7 @@ int resetCounter(); void getCounter(int *countLeft,int *countRight); + //angle is available in the range of -90 to 90. int turnTo(int angle); void delay(int milliseconds);
Add some comments in the header file for understanding
mit
miaoxw/EmbeddedSystemNJU2017-Demo
cefe89625e4728d349d8d3db1b9c81268178449d
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// Executes the operation virtual bool run() = 0; protected: TaskId taskId; SerializedTask task; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// The constructor /// \param stask the serialized task the operation need to work with explicit IOperation(SerializedTask& stask); virtual ~IOperation(); /// Executes the operation virtual bool run() = 0; protected: TaskId taskId; SerializedTask task; }; } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATION_H_
--- +++ @@ -11,11 +11,6 @@ /// A pure virtual class of operations to be put into transaction stack class IOperation { public: - /// The constructor - /// \param stask the serialized task the operation need to work with - explicit IOperation(SerializedTask& stask); - virtual ~IOperation(); - /// Executes the operation virtual bool run() = 0; protected:
Remove ctor and dtor of IOperation to make it a pure virtual class
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
a0770fe0570e07eadb02a84fa8f14ea4399805b7
#include <cgreen/slurp.h> #include <stdlib.h> #include <stdio.h> #include <strings.h> static char *read_all(FILE *file, int gulp); char *slurp(const char *file_name, int gulp) { FILE *file = fopen(file_name, "r"); if (file == NULL) { return NULL; } char *content = read_all(file, gulp); fclose(file); return content; } static char *read_all(FILE *file, int gulp) { char *content = (char *)malloc(0); int sblock = (gulp + 1) * sizeof(char); char *block = (char *)malloc(sblock); int len = 0; int add = 0; char *p; for ( ; ; ) { if (fgets(block, sblock, file) == NULL) { break; } len = strlen(block); add += len; p = (char *)realloc(content, add + 1); if (p == NULL) { exit(1); } content = p; strncat(content, block, len); } content[add + 1] = '\0'; free(block); return content; }
#include <cgreen/slurp.h> #include <stdlib.h> #include <stdio.h> static char *read_all(FILE *file, int gulp); char *slurp(const char *file_name, int gulp) { FILE *file = fopen(file_name, "r"); if (file == NULL) { return NULL; } char *content = read_all(file, gulp); fclose(file); return content; } static char *read_all(FILE *file, int gulp) { char *content = (char *)malloc((gulp + 1) * sizeof(char)); char *block = content; for ( ; ; ) { if (fgets(block, gulp + 1, file) == NULL) { break; } block += gulp; content = (char *)realloc(content, (block - content + 1) * sizeof(char)); } return content; }
--- +++ @@ -1,6 +1,7 @@ #include <cgreen/slurp.h> #include <stdlib.h> #include <stdio.h> +#include <strings.h> static char *read_all(FILE *file, int gulp); @@ -15,14 +16,30 @@ } static char *read_all(FILE *file, int gulp) { - char *content = (char *)malloc((gulp + 1) * sizeof(char)); - char *block = content; + char *content = (char *)malloc(0); + int sblock = (gulp + 1) * sizeof(char); + char *block = (char *)malloc(sblock); + int len = 0; + int add = 0; + char *p; for ( ; ; ) { - if (fgets(block, gulp + 1, file) == NULL) { + if (fgets(block, sblock, file) == NULL) { break; } - block += gulp; - content = (char *)realloc(content, (block - content + 1) * sizeof(char)); + + len = strlen(block); + add += len; + + p = (char *)realloc(content, add + 1); + if (p == NULL) { + exit(1); + } + content = p; + + strncat(content, block, len); } + content[add + 1] = '\0'; + free(block); return content; } +
Fix read_all and return content without segment fault
lgpl-2.1
ykaliuta/cgreen-old,ykaliuta/cgreen-old,ykaliuta/cgreen-old,ykaliuta/cgreen-old,ykaliuta/cgreen-old
c66bc667f912f6144223b6d259061942221a6469
#include <kernel/panic.h> #include <elf.h> #include <macros.h> #include <stdio.h> #include <types.h> #define MAX_STACK_FRAME 10000 /* * Walk up the stack and print the locations of each stack frame base. */ void bt(void) { u32 *ebp, *eip; unsigned int sf = 0; /* Start form the current stack base */ asm volatile("mov %%ebp, %0" : "=r" (ebp)); /* Continue until you reach a zeroed stack base pointer. The initial ebp * value is zeroed at boot, but note that this could be corrupted in the * case of serious memory corruption. To protect against this, we keep * track of the frame number and break if it exceeds a reasonable * maximum value. */ while (ebp) { eip = ebp + 1; printf("#%d [0x%x] %s\n", sf, *eip, symbol_from_elf(&kelf, *eip)); ebp = (u32*)*ebp; sf++; /* break if exceeded maximum */ if (sf > MAX_STACK_FRAME) break; } }
#include <kernel/panic.h> #include <macros.h> #include <stdio.h> #include <types.h> #define MAX_STACK_FRAME 10000 /* * Walk up the stack and print the locations of each stack frame base. */ void bt(void) { u32 *ebp, *eip; unsigned int sf = 0; /* Start form the current stack base */ asm volatile("mov %%ebp, %0" : "=r" (ebp)); /* Continue until you reach a zeroed stack base pointer. The initial ebp * value is zeroed at boot, but note that this could be corrupted in the * case of serious memory corruption. To protect against this, we keep * track of the frame number and break if it exceeds a reasonable * maximum value. */ while (ebp) { eip = ebp + 1; printf("#%d [0x%x]\n", sf, *eip); ebp = (u32*)*ebp; sf++; /* break if exceeded maximum */ if (sf > MAX_STACK_FRAME) break; } }
--- +++ @@ -1,5 +1,6 @@ #include <kernel/panic.h> +#include <elf.h> #include <macros.h> #include <stdio.h> #include <types.h> @@ -23,7 +24,8 @@ * maximum value. */ while (ebp) { eip = ebp + 1; - printf("#%d [0x%x]\n", sf, *eip); + printf("#%d [0x%x] %s\n", + sf, *eip, symbol_from_elf(&kelf, *eip)); ebp = (u32*)*ebp; sf++;
arch/x86: Print symbol names in backtrace This transforms: #0 [0x1018C7] #1 [0x101636] #2 [0x100231] into: #0 [0x1018C7] panic #1 [0x101636] k_main #2 [0x100231] start
mit
ChrisCummins/euclid,ChrisCummins/euclid,ChrisCummins/euclid
44acf7ff36b39e2af95bb8db453189b70b39d39a
// // Atomic.h // Atomic // // Created by Adlai Holler on 12/5/15. // Copyright © 2015 Adlai Holler. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for Atomic. FOUNDATION_EXPORT double AtomicVersionNumber; //! Project version string for Atomic. FOUNDATION_EXPORT const unsigned char AtomicVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <Atomic/PublicHeader.h>
// // Atomic.h // Atomic // // Created by Adlai Holler on 12/5/15. // Copyright © 2015 Adlai Holler. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for Atomic. FOUNDATION_EXPORT double AtomicVersionNumber; //! Project version string for Atomic. FOUNDATION_EXPORT const unsigned char AtomicVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <Atomic/PublicHeader.h>
--- +++ @@ -6,7 +6,7 @@ // Copyright © 2015 Adlai Holler. All rights reserved. // -#import <UIKit/UIKit.h> +#import <Foundation/Foundation.h> //! Project version number for Atomic. FOUNDATION_EXPORT double AtomicVersionNumber;
Remove silly import of UIKit
mit
Adlai-Holler/Atomic,Adlai-Holler/Atomic
6446caf75a12bccdfc9b1af81586a1340b968db4
/* mbed Microcontroller Library * Copyright (c) 2017 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if DEVICE_ITM #include "hal/itm_api.h" #include "cmsis.h" #include "am_bsp.h" #include <stdbool.h> /* SWO frequency: 1000 kHz */ #ifndef AM_BSP_GPIO_ITM_SWO #define AM_GPIO_ITM_SWO 22 const am_hal_gpio_pincfg_t g_AM_GPIO_ITM_SWO = { .uFuncSel = AM_HAL_PIN_22_SWO, .eDriveStrength = AM_HAL_GPIO_PIN_DRIVESTRENGTH_2MA }; #endif void itm_init(void) { #ifdef AM_BSP_GPIO_ITM_SWO am_bsp_itm_printf_enable(); #else am_bsp_itm_printf_enable(AM_GPIO_ITM_SWO,g_AM_GPIO_ITM_SWO); #endif } #endif
/* mbed Microcontroller Library * Copyright (c) 2017 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if DEVICE_ITM #include "hal/itm_api.h" #include "cmsis.h" #include "am_bsp.h" #include <stdbool.h> /* SWO frequency: 1000 kHz */ // As SWO has to be accessible everywhere, including ISRs, we can't easily // communicate the dependency on clocks etc. to other components - so this // function checks that things appear to be set up, and if not re-configures // everything void itm_init(void) { am_bsp_itm_printf_enable(); } #endif
--- +++ @@ -25,13 +25,24 @@ /* SWO frequency: 1000 kHz */ -// As SWO has to be accessible everywhere, including ISRs, we can't easily -// communicate the dependency on clocks etc. to other components - so this -// function checks that things appear to be set up, and if not re-configures -// everything +#ifndef AM_BSP_GPIO_ITM_SWO +#define AM_GPIO_ITM_SWO 22 + +const am_hal_gpio_pincfg_t g_AM_GPIO_ITM_SWO = +{ + .uFuncSel = AM_HAL_PIN_22_SWO, + .eDriveStrength = AM_HAL_GPIO_PIN_DRIVESTRENGTH_2MA +}; +#endif + + void itm_init(void) { + #ifdef AM_BSP_GPIO_ITM_SWO am_bsp_itm_printf_enable(); + #else + am_bsp_itm_printf_enable(AM_GPIO_ITM_SWO,g_AM_GPIO_ITM_SWO); + #endif } #endif
Add default SWO pin number and config if not defined in Ambiq target
apache-2.0
mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed
7a108087ed96c0d91b65b967f9c524a7c64116fa
/** * An efficient c++ simulation demo * * @author Skylar Kelty <skylarkelty@gmail.com> */ #pragma once #include "src/common.h" /** * A linked list */ template <typename T> class LinkedList { friend class Engine; private: LLNode<T> *head; LLNode<T> *tail; protected: void append(LLNode<T> *node); public: LinkedList(); ~LinkedList(); /** * Get the first element of the list */ inline LLNode<T> *first() { return this->head; } /** * Get the last element of the list */ inline LLNode<T> *last() { return this->tail; } /** * Get the length of the list */ inline int length() { return this->head->length(); } };
/** * An efficient c++ simulation demo * * @author Skylar Kelty <skylarkelty@gmail.com> */ #pragma once #include "src/common.h" /** * A linked list */ template <typename T> class LinkedList { private: LLNode<T> *head; LLNode<T> *tail; public: LinkedList(); ~LinkedList(); void append(LLNode<T> *node); /** * Get the first element of the list */ inline LLNode<T> *first() { return this->head; } /** * Get the last element of the list */ inline LLNode<T> *last() { return this->tail; } /** * Get the length of the list */ inline int length() { return this->head->length(); } };
--- +++ @@ -13,15 +13,18 @@ */ template <typename T> class LinkedList { +friend class Engine; + private: LLNode<T> *head; LLNode<T> *tail; +protected: + void append(LLNode<T> *node); + public: LinkedList(); ~LinkedList(); - - void append(LLNode<T> *node); /** * Get the first element of the list
Enforce actor addition through Engine
apache-2.0
SkylarKelty/Simulation
6c0a304f881440303b1fe1af781b2cf1ddccc3ef
typedef struct { int cluster; /* Condor Cluster # */ int proc; /* Condor Proc # */ int job_class; /* STANDARD, VANILLA, PVM, PIPE, ... */ uid_t uid; /* Execute job under this UID */ gid_t gid; /* Execute job under this pid */ pid_t virt_pid; /* PVM virt pid of this process */ int soft_kill_sig; /* Use this signal for a soft kill */ char *a_out_name; /* Where to get executable file */ char *cmd; /* Command name given by the user */ char *args; /* Command arguments given by the user */ char *env; /* Environment variables */ char *iwd; /* Initial working directory */ BOOLEAN ckpt_wanted; /* Whether user wants checkpointing */ BOOLEAN is_restart; /* Whether this run is a restart */ BOOLEAN coredump_limit_exists; /* Whether user wants to limit core size */ int coredump_limit; /* Limit in bytes */ } STARTUP_INFO; /* Should eliminate starter knowing the a.out name. Should go to shadow for instructions on how to fetch the executable - e.g. local file with name <name> or get it from TCP port <x> on machine <y>. */
typedef struct { int cluster; /* Condor Cluster # */ int proc; /* Condor Proc # */ int job_class; /* STANDARD, VANILLA, PVM, PIPE, ... */ uid_t uid; /* Execute job under this UID */ gid_t gid; /* Execute job under this pid */ pid_t virt_pid; /* PVM virt pid of this process */ int soft_kill_sig; /* Use this signal for a soft kill */ char *a_out_name; /* Where to get executable file */ char *cmd; /* Command name given by the user */ char *args; /* Command arguments given by the user */ char *env; /* Environment variables */ char *iwd; /* Initial working directory */ BOOLEAN ckpt_wanted; /* Whether user wants checkpointing */ BOOLEAN is_restart; /* Whether this run is a restart */ BOOLEAN coredump_limit_exists; /* Whether user wants to limit core size */ int coredump_limit; /* Limit in bytes */ } STARTUP_INFO;
--- +++ @@ -16,3 +16,9 @@ BOOLEAN coredump_limit_exists; /* Whether user wants to limit core size */ int coredump_limit; /* Limit in bytes */ } STARTUP_INFO; + +/* +Should eliminate starter knowing the a.out name. Should go to +shadow for instructions on how to fetch the executable - e.g. local file +with name <name> or get it from TCP port <x> on machine <y>. +*/
Add comment saying that even though the a.out file name is here, it really shouldn't be.
apache-2.0
neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,djw8605/condor,zhangzhehust/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,htcondor/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,djw8605/condor,neurodebian/htcondor,htcondor/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,mambelli/osg-bosco-marco,djw8605/condor,zhangzhehust/htcondor,htcondor/htcondor,djw8605/condor,neurodebian/htcondor,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,htcondor/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/condor,bbockelm/condor-network-accounting,djw8605/htcondor,clalancette/condor-dcloud,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,zhangzhehust/htcondor,djw8605/condor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,zhangzhehust/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,djw8605/htcondor,djw8605/condor,mambelli/osg-bosco-marco
40732a47d7d7e570a5124a6acf64665a0566dee9
$OpenBSD: patch-Modules__ssl_c,v 1.2 2018/03/17 22:30:04 sthen Exp $ XXX maybe the second hunk can go away now we have auto-init, I'm not sure exactly what python's lock protects Index: Modules/_ssl.c --- Modules/_ssl.c.orig +++ Modules/_ssl.c @@ -99,7 +99,8 @@ struct py_ssl_library_code { /* Include generated data (error codes) */ #include "_ssl_data.h" -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && \ + (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) # define OPENSSL_VERSION_1_1 1 #endif @@ -133,6 +134,9 @@ struct py_ssl_library_code { /* OpenSSL 1.1.0+ */ #ifndef OPENSSL_NO_SSL2 #define OPENSSL_NO_SSL2 +#endif +#if defined(LIBRESSL_VERSION_NUMBER) && defined(WITH_THREAD) +#define HAVE_OPENSSL_CRYPTO_LOCK #endif #else /* OpenSSL < 1.1.0 */ #if defined(WITH_THREAD)
--- Modules/_ssl.c.orig +++ Modules/_ssl.c @@ -99,7 +99,8 @@ struct py_ssl_library_code { /* Include generated data (error codes) */ #include "_ssl_data.h" -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && \ + (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) # define OPENSSL_VERSION_1_1 1 #endif @@ -133,6 +134,9 @@ struct py_ssl_library_code { /* OpenSSL 1.1.0+ */ #ifndef OPENSSL_NO_SSL2 #define OPENSSL_NO_SSL2 +#endif +#if defined(LIBRESSL_VERSION_NUMBER) && defined(WITH_THREAD) +#define HAVE_OPENSSL_CRYPTO_LOCK #endif #else /* OpenSSL < 1.1.0 */ #if defined(WITH_THREAD)
--- +++ @@ -1,17 +1,23 @@ +$OpenBSD: patch-Modules__ssl_c,v 1.2 2018/03/17 22:30:04 sthen Exp $ + +XXX maybe the second hunk can go away now we have auto-init, I'm not sure +exactly what python's lock protects + +Index: Modules/_ssl.c --- Modules/_ssl.c.orig +++ Modules/_ssl.c @@ -99,7 +99,8 @@ struct py_ssl_library_code { -/* Include generated data (error codes) */ -#include "_ssl_data.h" - + /* Include generated data (error codes) */ + #include "_ssl_data.h" + -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && \ + (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) # define OPENSSL_VERSION_1_1 1 #endif - + @@ -133,6 +134,9 @@ struct py_ssl_library_code { -/* OpenSSL 1.1.0+ */ + /* OpenSSL 1.1.0+ */ #ifndef OPENSSL_NO_SSL2 #define OPENSSL_NO_SSL2 +#endif
Fix libressl patch python 3.6
mit
nrosier/bunbun,nrosier/bunbun,nrosier/bunbun,nrosier/bunbun
de6438d1b0800bbc285201962356476fe816c2a1
#include "Enesim.h" int main(int argc, char **argv) { Enesim_Renderer *r; Enesim_Surface *s; Enesim_Log *error = NULL; enesim_init(); r = enesim_renderer_rectangle_new(); enesim_renderer_shape_fill_color_set(r, 0xffffffff); /* we dont set any property to force the error */ s = enesim_surface_new(ENESIM_FORMAT_ARGB8888, 320, 240); if (!enesim_renderer_draw(r, s, ENESIM_ROP_FILL, NULL, 0, 0, &error)) { enesim_log_dump(error); enesim_log_unref(error); } enesim_shutdown(); return 0; }
#include "Enesim.h" int main(int argc, char **argv) { Enesim_Renderer *r; Enesim_Surface *s; Enesim_Log *error = NULL; enesim_init(); r = enesim_renderer_rectangle_new(); enesim_renderer_shape_fill_color_set(r, 0xffffffff); /* we dont set any property to force the error */ s = enesim_surface_new(ENESIM_FORMAT_ARGB8888, 320, 240); if (!enesim_renderer_draw(r, s, ENESIM_ROP_FILL, NULL, 0, 0, &error)) { enesim_log_dump(error); enesim_log_delete(error); } enesim_shutdown(); return 0; }
--- +++ @@ -16,7 +16,7 @@ if (!enesim_renderer_draw(r, s, ENESIM_ROP_FILL, NULL, 0, 0, &error)) { enesim_log_dump(error); - enesim_log_delete(error); + enesim_log_unref(error); } enesim_shutdown();
Use the new log API
lgpl-2.1
turran/enesim,turran/enesim,turran/enesim,turran/enesim
4ca8b01f499f2c3a72191e6eb89a7790cf8af7ef
#define OBSCURE(X) X #define DECORATION typedef int T; void OBSCURE(func)(int x) { OBSCURE(T) DECORATION value; } #include "a.h" // RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s // CHECK-1: macro definition=OBSCURE // RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s // CHECK-2: macro definition=DECORATION // RUN: c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s // CHECK-3: macro instantiation=OBSCURE:1:9 // RUN: c-index-test -cursor-at=%s:6:6 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-4 %s // CHECK-4: macro instantiation=OBSCURE:1:9 // RUN: c-index-test -cursor-at=%s:6:19 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-5 %s // CHECK-5: macro instantiation=DECORATION:2:9 // RUN: c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s // CHECK-6: inclusion directive=a.h
#define OBSCURE(X) X #define DECORATION typedef int T; void OBSCURE(func)(int x) { OBSCURE(T) DECORATION value; } // RUN: c-index-test -cursor-at=%s:1:11 %s | FileCheck -check-prefix=CHECK-1 %s // CHECK-1: macro definition=OBSCURE // RUN: c-index-test -cursor-at=%s:2:14 %s | FileCheck -check-prefix=CHECK-2 %s // CHECK-2: macro definition=DECORATION // RUN: c-index-test -cursor-at=%s:5:7 %s | FileCheck -check-prefix=CHECK-3 %s // CHECK-3: macro instantiation=OBSCURE:1:9 // RUN: c-index-test -cursor-at=%s:6:6 %s | FileCheck -check-prefix=CHECK-4 %s // CHECK-4: macro instantiation=OBSCURE:1:9 // RUN: c-index-test -cursor-at=%s:6:19 %s | FileCheck -check-prefix=CHECK-5 %s // CHECK-5: macro instantiation=DECORATION:2:9
--- +++ @@ -6,13 +6,17 @@ OBSCURE(T) DECORATION value; } -// RUN: c-index-test -cursor-at=%s:1:11 %s | FileCheck -check-prefix=CHECK-1 %s +#include "a.h" + +// RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s // CHECK-1: macro definition=OBSCURE -// RUN: c-index-test -cursor-at=%s:2:14 %s | FileCheck -check-prefix=CHECK-2 %s +// RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s // CHECK-2: macro definition=DECORATION -// RUN: c-index-test -cursor-at=%s:5:7 %s | FileCheck -check-prefix=CHECK-3 %s +// RUN: c-index-test -cursor-at=%s:5:7 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-3 %s // CHECK-3: macro instantiation=OBSCURE:1:9 -// RUN: c-index-test -cursor-at=%s:6:6 %s | FileCheck -check-prefix=CHECK-4 %s +// RUN: c-index-test -cursor-at=%s:6:6 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-4 %s // CHECK-4: macro instantiation=OBSCURE:1:9 -// RUN: c-index-test -cursor-at=%s:6:19 %s | FileCheck -check-prefix=CHECK-5 %s +// RUN: c-index-test -cursor-at=%s:6:19 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-5 %s // CHECK-5: macro instantiation=DECORATION:2:9 +// RUN: c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s +// CHECK-6: inclusion directive=a.h
Update clang_getCursor() test to check searches on include directives git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@117063 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
d93fae659ca26558c62dd654e24293be024408af
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import <Parse/Parse.h> #import <Bolts/Bolts.h> #import <AWSiOSSDKv2/AWSCore.h> #import <AWSiOSSDKv2/S3.h> #import <AWSiOSSDKv2/DynamoDB.h> #import <AWSiOSSDKv2/SQS.h> #import <AWSiOSSDKv2/SNS.h>
// // Use this file to import your target's public headers that you would like to expose to Swift. //
--- +++ @@ -2,3 +2,10 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // +#import <Parse/Parse.h> +#import <Bolts/Bolts.h> +#import <AWSiOSSDKv2/AWSCore.h> +#import <AWSiOSSDKv2/S3.h> +#import <AWSiOSSDKv2/DynamoDB.h> +#import <AWSiOSSDKv2/SQS.h> +#import <AWSiOSSDKv2/SNS.h>
Add imports to Bridging Header.
mit
dlrifkin/Perspective-1.0,thedanpan/Perspective
5c02865845248547ea33362877291f5b70c876c4
// project-specific definitions for otaa sensor //#define CFG_eu868 1 #define CFG_us915 1 //#define CFG_au921 1 //#define CFG_as923 1 //#define CFG_in866 1 #define CFG_sx1276_radio 1 //#define LMIC_USE_INTERRUPTS
// project-specific definitions for otaa sensor //#define CFG_eu868 1 //#define CFG_us915 1 //#define CFG_au921 1 #define CFG_as923 1 #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP //#define CFG_in866 1 #define CFG_sx1276_radio 1 //#define LMIC_USE_INTERRUPTS #define LMIC_DEBUG_LEVEL 2 #define LMIC_DEBUG_PRINTF_FN lmic_printf
--- +++ @@ -1,11 +1,8 @@ // project-specific definitions for otaa sensor //#define CFG_eu868 1 -//#define CFG_us915 1 +#define CFG_us915 1 //#define CFG_au921 1 -#define CFG_as923 1 -#define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP +//#define CFG_as923 1 //#define CFG_in866 1 #define CFG_sx1276_radio 1 //#define LMIC_USE_INTERRUPTS -#define LMIC_DEBUG_LEVEL 2 -#define LMIC_DEBUG_PRINTF_FN lmic_printf
Set project_config back to defaults
mit
mcci-catena/arduino-lmic,mcci-catena/arduino-lmic,mcci-catena/arduino-lmic
faf3bc1eabc938b3ed9fa898b08ed8a9c47fb77e
/* * Copyright © 2009 CNRS * Copyright © 2009-2010 INRIA. All rights reserved. * Copyright © 2009 Université Bordeaux 1 * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ #include <private/autogen/config.h> #ifdef HWLOC_HAVE_XML #include <hwloc.h> #include <string.h> #include "lstopo.h" void output_xml(hwloc_topology_t topology, const char *filename, int logical __hwloc_attribute_unused, int legend __hwloc_attribute_unused, int verbose_mode __hwloc_attribute_unused) { if (!filename || !strcasecmp(filename, "-.xml")) filename = "-"; if (hwloc_topology_export_xml(topology, filename) < 0) { fprintf(stderr, "Failed to export XML to %s (%s)\n", filename, strerror(errno)); return; } } #endif /* HWLOC_HAVE_XML */
/* * Copyright © 2009 CNRS * Copyright © 2009-2010 INRIA. All rights reserved. * Copyright © 2009 Université Bordeaux 1 * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ #include <private/autogen/config.h> #ifdef HWLOC_HAVE_XML #include <hwloc.h> #include <string.h> #include "lstopo.h" void output_xml(hwloc_topology_t topology, const char *filename, int logical __hwloc_attribute_unused, int legend __hwloc_attribute_unused, int verbose_mode __hwloc_attribute_unused) { if (!filename || !strcasecmp(filename, "-.xml")) filename = "-"; hwloc_topology_export_xml(topology, filename); } #endif /* HWLOC_HAVE_XML */
--- +++ @@ -20,7 +20,10 @@ if (!filename || !strcasecmp(filename, "-.xml")) filename = "-"; - hwloc_topology_export_xml(topology, filename); + if (hwloc_topology_export_xml(topology, filename) < 0) { + fprintf(stderr, "Failed to export XML to %s (%s)\n", filename, strerror(errno)); + return; + } } #endif /* HWLOC_HAVE_XML */
Print an error when lstopo fails to export to X... Print an error when lstopo fails to export to XML This commit was SVN r3691.
bsd-3-clause
ggouaillardet/hwloc,shekkbuilder/hwloc,shekkbuilder/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc,ggouaillardet/hwloc,ggouaillardet/hwloc,shekkbuilder/hwloc
83dd74f6a0bf69102f807cfb9a904fce2b185594
#include <string.h> #include "ruby.h" #include "rubyspec.h" #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_RB_PROC_NEW VALUE concat_func(VALUE args) { int i; char buffer[500] = {0}; if (TYPE(val) != T_ARRAY) return Qnil; for(i = 0; i < RARRAY_LEN(args); ++i) { VALUE v = RARRAY_PTR(args)[i]; strcat(buffer, StringValuePtr(v)); strcat(buffer, "_"); } buffer[strlen(buffer) - 1] = 0; return rb_str_new2(buffer); } VALUE sp_underline_concat_proc(VALUE self) { return rb_proc_new(concat_func, Qnil); } #endif void Init_proc_spec() { VALUE cls; cls = rb_define_class("CApiProcSpecs", rb_cObject); #ifdef HAVE_RB_PROC_NEW rb_define_method(cls, "underline_concat_proc", sp_underline_concat_proc, 0); #endif } #ifdef __cplusplus } #endif
#include <string.h> #include "ruby.h" #include "rubyspec.h" #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_RB_PROC_NEW VALUE concat_func(VALUE args) { int i; char buffer[500] = {0}; if (TYPE(args) != T_ARRAY) return Qnil; for(i = 0; i < RARRAY_LEN(args); ++i) { VALUE v = RARRAY_PTR(args)[i]; strcat(buffer, StringValuePtr(v)); strcat(buffer, "_"); } buffer[strlen(buffer) - 1] = 0; return rb_str_new2(buffer); } VALUE sp_underline_concat_proc(VALUE self) { return rb_proc_new(concat_func, Qnil); } #endif void Init_proc_spec() { VALUE cls; cls = rb_define_class("CApiProcSpecs", rb_cObject); #ifdef HAVE_RB_PROC_NEW rb_define_method(cls, "underline_concat_proc", sp_underline_concat_proc, 0); #endif } #ifdef __cplusplus } #endif
--- +++ @@ -11,7 +11,7 @@ VALUE concat_func(VALUE args) { int i; char buffer[500] = {0}; - if (TYPE(args) != T_ARRAY) return Qnil; + if (TYPE(val) != T_ARRAY) return Qnil; for(i = 0; i < RARRAY_LEN(args); ++i) { VALUE v = RARRAY_PTR(args)[i]; strcat(buffer, StringValuePtr(v));
Revert "Fix typo in the commit a5312c77." This reverts commit 401825d6045ab8e3bd1514404e7c326a045a92ae. See the following revert for an explanation.
mit
godfat/rubyspec,chesterbr/rubyspec,kachick/rubyspec,iainbeeston/rubyspec,yous/rubyspec,sferik/rubyspec,flavio/rubyspec,markburns/rubyspec,scooter-dangle/rubyspec,benlovell/rubyspec,lucaspinto/rubyspec,ruby/rubyspec,Zoxc/rubyspec,metadave/rubyspec,saturnflyer/rubyspec,eregon/rubyspec,alex/rubyspec,Aesthetikx/rubyspec,JuanitoFatas/rubyspec,roshats/rubyspec,MagLev/rubyspec,freerange/rubyspec,no6v/rubyspec,xaviershay/rubyspec,chesterbr/rubyspec,terceiro/rubyspec,jannishuebl/rubyspec,lucaspinto/rubyspec,flavio/rubyspec,timfel/rubyspec,rdp/rubyspec,sgarciac/spec,josedonizetti/rubyspec,nevir/rubyspec,sferik/rubyspec,neomadara/rubyspec,marcandre/rubyspec,roshats/rubyspec,rkh/rubyspec,qmx/rubyspec,nevir/rubyspec,agrimm/rubyspec,DawidJanczak/rubyspec,Zoxc/rubyspec,tinco/rubyspec,benburkert/rubyspec,kidaa/rubyspec,wied03/rubyspec,saturnflyer/rubyspec,DawidJanczak/rubyspec,jstepien/rubyspec,terceiro/rubyspec,ruby/spec,wied03/rubyspec,bomatson/rubyspec,sgarciac/spec,eregon/rubyspec,MagLev/rubyspec,nobu/rubyspec,mrkn/rubyspec,griff/rubyspec,askl56/rubyspec,BanzaiMan/rubyspec,shirosaki/rubyspec,iliabylich/rubyspec,atambo/rubyspec,sgarciac/spec,yb66/rubyspec,mbj/rubyspec,DavidEGrayson/rubyspec,iliabylich/rubyspec,amarshall/rubyspec,bl4ckdu5t/rubyspec,JuanitoFatas/rubyspec,iainbeeston/rubyspec,neomadara/rubyspec,mrkn/rubyspec,ruby/spec,kidaa/rubyspec,ericmeyer/rubyspec,yaauie/rubyspec,alexch/rubyspec,DavidEGrayson/rubyspec,no6v/rubyspec,timfel/rubyspec,askl56/rubyspec,alindeman/rubyspec,julik/rubyspec,rdp/rubyspec,yb66/rubyspec,kachick/rubyspec,julik/rubyspec,ruby/rubyspec,xaviershay/rubyspec,jannishuebl/rubyspec,freerange/rubyspec,bomatson/rubyspec,marcandre/rubyspec,teleological/rubyspec,tinco/rubyspec,atambo/rubyspec,BanzaiMan/rubyspec,amarshall/rubyspec,benlovell/rubyspec,alexch/rubyspec,bjeanes/rubyspec,nobu/rubyspec,nobu/rubyspec,kachick/rubyspec,rkh/rubyspec,yaauie/rubyspec,griff/rubyspec,alindeman/rubyspec,jvshahid/rubyspec,oggy/rubyspec,ruby/spec,Aesthetikx/rubyspec,alex/rubyspec,jvshahid/rubyspec,josedonizetti/rubyspec,enricosada/rubyspec,godfat/rubyspec,wied03/rubyspec,benburkert/rubyspec,bjeanes/rubyspec,mbj/rubyspec,qmx/rubyspec,agrimm/rubyspec,markburns/rubyspec,scooter-dangle/rubyspec,ericmeyer/rubyspec,oggy/rubyspec,yous/rubyspec,bl4ckdu5t/rubyspec,shirosaki/rubyspec,metadave/rubyspec,eregon/rubyspec,jstepien/rubyspec,enricosada/rubyspec,teleological/rubyspec
404504635570833ffec7857cfa28e055b276b521
struct PureClangType { int x; int y; }; #ifndef SWIFT_CLASS_EXTRA # define SWIFT_CLASS_EXTRA #endif #ifndef SWIFT_CLASS # define SWIFT_CLASS(SWIFT_NAME) SWIFT_CLASS_EXTRA #endif SWIFT_CLASS("SwiftClass") __attribute__((objc_root_class)) @interface SwiftClass @end @interface SwiftClass (Category) - (void)categoryMethod:(struct PureClangType)arg; @end SWIFT_CLASS("BOGUS") @interface BogusClass @end
struct PureClangType { int x; int y; }; #ifndef SWIFT_CLASS_EXTRA # define SWIFT_CLASS_EXTRA #endif #ifndef SWIFT_CLASS(SWIFT_NAME) # define SWIFT_CLASS(SWIFT_NAME) SWIFT_CLASS_EXTRA #endif SWIFT_CLASS("SwiftClass") __attribute__((objc_root_class)) @interface SwiftClass @end @interface SwiftClass (Category) - (void)categoryMethod:(struct PureClangType)arg; @end SWIFT_CLASS("BOGUS") @interface BogusClass @end
--- +++ @@ -7,7 +7,7 @@ # define SWIFT_CLASS_EXTRA #endif -#ifndef SWIFT_CLASS(SWIFT_NAME) +#ifndef SWIFT_CLASS # define SWIFT_CLASS(SWIFT_NAME) SWIFT_CLASS_EXTRA #endif
Remove useless tokens at the end of a preprocessor directive Swift SVN r24386
apache-2.0
austinzheng/swift,slavapestov/swift,devincoughlin/swift,khizkhiz/swift,parkera/swift,Ivacker/swift,huonw/swift,JGiola/swift,khizkhiz/swift,dduan/swift,brentdax/swift,kperryua/swift,harlanhaskins/swift,emilstahl/swift,hughbe/swift,uasys/swift,codestergit/swift,felix91gr/swift,huonw/swift,adrfer/swift,shajrawi/swift,KrishMunot/swift,tardieu/swift,tardieu/swift,russbishop/swift,parkera/swift,dduan/swift,danielmartin/swift,rudkx/swift,nathawes/swift,airspeedswift/swift,sschiau/swift,frootloops/swift,JaSpa/swift,swiftix/swift.old,alblue/swift,sdulal/swift,apple/swift,calebd/swift,jopamer/swift,therealbnut/swift,shajrawi/swift,sdulal/swift,SwiftAndroid/swift,ken0nek/swift,ken0nek/swift,ahoppen/swift,gribozavr/swift,apple/swift,lorentey/swift,KrishMunot/swift,johnno1962d/swift,swiftix/swift.old,mightydeveloper/swift,kusl/swift,jopamer/swift,Ivacker/swift,cbrentharris/swift,austinzheng/swift,natecook1000/swift,gottesmm/swift,hooman/swift,brentdax/swift,swiftix/swift,CodaFi/swift,benlangmuir/swift,kentya6/swift,gregomni/swift,deyton/swift,xwu/swift,atrick/swift,jtbandes/swift,harlanhaskins/swift,alblue/swift,Jnosh/swift,deyton/swift,gmilos/swift,arvedviehweger/swift,benlangmuir/swift,zisko/swift,brentdax/swift,xedin/swift,mightydeveloper/swift,practicalswift/swift,arvedviehweger/swift,natecook1000/swift,alblue/swift,jtbandes/swift,emilstahl/swift,djwbrown/swift,practicalswift/swift,huonw/swift,danielmartin/swift,alblue/swift,LeoShimonaka/swift,tjw/swift,adrfer/swift,manavgabhawala/swift,ben-ng/swift,airspeedswift/swift,xedin/swift,lorentey/swift,slavapestov/swift,kentya6/swift,allevato/swift,aschwaighofer/swift,tinysun212/swift-windows,bitjammer/swift,ahoppen/swift,airspeedswift/swift,austinzheng/swift,brentdax/swift,MukeshKumarS/Swift,parkera/swift,Ivacker/swift,gottesmm/swift,glessard/swift,emilstahl/swift,devincoughlin/swift,alblue/swift,mightydeveloper/swift,kentya6/swift,swiftix/swift,tinysun212/swift-windows,hughbe/swift,benlangmuir/swift,LeoShimonaka/swift,johnno1962d/swift,kperryua/swift,adrfer/swift,tinysun212/swift-windows,jckarter/swift,kstaring/swift,kusl/swift,xwu/swift,allevato/swift,practicalswift/swift,dduan/swift,amraboelela/swift,gmilos/swift,shajrawi/swift,natecook1000/swift,zisko/swift,arvedviehweger/swift,gribozavr/swift,gregomni/swift,JGiola/swift,SwiftAndroid/swift,gmilos/swift,LeoShimonaka/swift,roambotics/swift,kperryua/swift,kentya6/swift,jckarter/swift,deyton/swift,manavgabhawala/swift,return/swift,ahoppen/swift,djwbrown/swift,khizkhiz/swift,tardieu/swift,felix91gr/swift,OscarSwanros/swift,rudkx/swift,JaSpa/swift,slavapestov/swift,kusl/swift,kstaring/swift,adrfer/swift,Jnosh/swift,gribozavr/swift,swiftix/swift.old,MukeshKumarS/Swift,kstaring/swift,ben-ng/swift,felix91gr/swift,JGiola/swift,xwu/swift,aschwaighofer/swift,zisko/swift,milseman/swift,alblue/swift,ken0nek/swift,JaSpa/swift,xwu/swift,aschwaighofer/swift,frootloops/swift,sschiau/swift,IngmarStein/swift,airspeedswift/swift,russbishop/swift,slavapestov/swift,JGiola/swift,natecook1000/swift,Ivacker/swift,gregomni/swift,devincoughlin/swift,jtbandes/swift,modocache/swift,danielmartin/swift,xwu/swift,LeoShimonaka/swift,therealbnut/swift,CodaFi/swift,JaSpa/swift,kperryua/swift,slavapestov/swift,danielmartin/swift,MukeshKumarS/Swift,uasys/swift,glessard/swift,allevato/swift,ken0nek/swift,djwbrown/swift,jckarter/swift,cbrentharris/swift,jtbandes/swift,khizkhiz/swift,jopamer/swift,benlangmuir/swift,austinzheng/swift,nathawes/swift,aschwaighofer/swift,hooman/swift,tkremenek/swift,apple/swift,gmilos/swift,kstaring/swift,kperryua/swift,tkremenek/swift,nathawes/swift,johnno1962d/swift,calebd/swift,tjw/swift,roambotics/swift,ahoppen/swift,russbishop/swift,alblue/swift,IngmarStein/swift,KrishMunot/swift,roambotics/swift,stephentyrone/swift,dduan/swift,gottesmm/swift,hooman/swift,xwu/swift,kusl/swift,amraboelela/swift,mightydeveloper/swift,milseman/swift,arvedviehweger/swift,practicalswift/swift,SwiftAndroid/swift,tinysun212/swift-windows,jopamer/swift,ben-ng/swift,zisko/swift,milseman/swift,devincoughlin/swift,modocache/swift,harlanhaskins/swift,kusl/swift,milseman/swift,mightydeveloper/swift,shahmishal/swift,ben-ng/swift,aschwaighofer/swift,khizkhiz/swift,zisko/swift,kperryua/swift,MukeshKumarS/Swift,sdulal/swift,emilstahl/swift,harlanhaskins/swift,parkera/swift,ahoppen/swift,khizkhiz/swift,gregomni/swift,practicalswift/swift,roambotics/swift,cbrentharris/swift,amraboelela/swift,russbishop/swift,tjw/swift,sschiau/swift,hughbe/swift,jmgc/swift,gmilos/swift,swiftix/swift,arvedviehweger/swift,jmgc/swift,emilstahl/swift,roambotics/swift,shahmishal/swift,jmgc/swift,swiftix/swift,Ivacker/swift,Ivacker/swift,lorentey/swift,harlanhaskins/swift,tardieu/swift,apple/swift,shahmishal/swift,emilstahl/swift,practicalswift/swift,lorentey/swift,return/swift,gregomni/swift,bitjammer/swift,atrick/swift,SwiftAndroid/swift,harlanhaskins/swift,KrishMunot/swift,shajrawi/swift,MukeshKumarS/Swift,kentya6/swift,bitjammer/swift,OscarSwanros/swift,gribozavr/swift,atrick/swift,uasys/swift,adrfer/swift,milseman/swift,karwa/swift,nathawes/swift,MukeshKumarS/Swift,stephentyrone/swift,parkera/swift,shajrawi/swift,adrfer/swift,jopamer/swift,Jnosh/swift,tardieu/swift,apple/swift,stephentyrone/swift,therealbnut/swift,gribozavr/swift,nathawes/swift,shahmishal/swift,jckarter/swift,sschiau/swift,kstaring/swift,swiftix/swift,amraboelela/swift,ken0nek/swift,deyton/swift,therealbnut/swift,xwu/swift,hooman/swift,xedin/swift,therealbnut/swift,frootloops/swift,zisko/swift,practicalswift/swift,cbrentharris/swift,LeoShimonaka/swift,lorentey/swift,codestergit/swift,CodaFi/swift,aschwaighofer/swift,deyton/swift,modocache/swift,nathawes/swift,harlanhaskins/swift,modocache/swift,rudkx/swift,tkremenek/swift,tinysun212/swift-windows,ken0nek/swift,hughbe/swift,felix91gr/swift,apple/swift,cbrentharris/swift,deyton/swift,CodaFi/swift,OscarSwanros/swift,OscarSwanros/swift,tkremenek/swift,SwiftAndroid/swift,codestergit/swift,slavapestov/swift,xedin/swift,shahmishal/swift,jmgc/swift,karwa/swift,glessard/swift,jopamer/swift,manavgabhawala/swift,swiftix/swift.old,sdulal/swift,deyton/swift,swiftix/swift.old,sdulal/swift,Jnosh/swift,atrick/swift,dduan/swift,codestergit/swift,tkremenek/swift,hooman/swift,bitjammer/swift,uasys/swift,djwbrown/swift,SwiftAndroid/swift,bitjammer/swift,felix91gr/swift,stephentyrone/swift,tkremenek/swift,gottesmm/swift,jmgc/swift,ben-ng/swift,tinysun212/swift-windows,Jnosh/swift,bitjammer/swift,allevato/swift,dduan/swift,jmgc/swift,CodaFi/swift,austinzheng/swift,return/swift,return/swift,MukeshKumarS/Swift,stephentyrone/swift,OscarSwanros/swift,cbrentharris/swift,calebd/swift,shahmishal/swift,codestergit/swift,ken0nek/swift,hughbe/swift,devincoughlin/swift,roambotics/swift,sschiau/swift,gottesmm/swift,jckarter/swift,karwa/swift,LeoShimonaka/swift,kstaring/swift,djwbrown/swift,KrishMunot/swift,cbrentharris/swift,modocache/swift,airspeedswift/swift,emilstahl/swift,benlangmuir/swift,sschiau/swift,IngmarStein/swift,gottesmm/swift,jtbandes/swift,arvedviehweger/swift,airspeedswift/swift,parkera/swift,sdulal/swift,atrick/swift,swiftix/swift.old,djwbrown/swift,austinzheng/swift,huonw/swift,cbrentharris/swift,kperryua/swift,brentdax/swift,stephentyrone/swift,manavgabhawala/swift,karwa/swift,danielmartin/swift,mightydeveloper/swift,devincoughlin/swift,johnno1962d/swift,milseman/swift,ahoppen/swift,russbishop/swift,glessard/swift,jckarter/swift,stephentyrone/swift,tinysun212/swift-windows,airspeedswift/swift,swiftix/swift,return/swift,JGiola/swift,modocache/swift,jtbandes/swift,IngmarStein/swift,IngmarStein/swift,jckarter/swift,karwa/swift,bitjammer/swift,OscarSwanros/swift,danielmartin/swift,russbishop/swift,hooman/swift,karwa/swift,arvedviehweger/swift,johnno1962d/swift,gottesmm/swift,manavgabhawala/swift,glessard/swift,danielmartin/swift,frootloops/swift,tjw/swift,rudkx/swift,ben-ng/swift,parkera/swift,kusl/swift,frootloops/swift,rudkx/swift,kentya6/swift,allevato/swift,aschwaighofer/swift,codestergit/swift,johnno1962d/swift,SwiftAndroid/swift,karwa/swift,atrick/swift,shahmishal/swift,JaSpa/swift,milseman/swift,frootloops/swift,calebd/swift,kstaring/swift,gmilos/swift,kusl/swift,swiftix/swift.old,austinzheng/swift,uasys/swift,OscarSwanros/swift,xedin/swift,huonw/swift,adrfer/swift,johnno1962d/swift,sschiau/swift,gribozavr/swift,hooman/swift,swiftix/swift,jtbandes/swift,khizkhiz/swift,slavapestov/swift,calebd/swift,IngmarStein/swift,dduan/swift,frootloops/swift,sdulal/swift,djwbrown/swift,russbishop/swift,therealbnut/swift,Jnosh/swift,Jnosh/swift,kentya6/swift,JaSpa/swift,calebd/swift,gregomni/swift,codestergit/swift,devincoughlin/swift,xedin/swift,JaSpa/swift,KrishMunot/swift,shajrawi/swift,dreamsxin/swift,return/swift,shajrawi/swift,tardieu/swift,return/swift,rudkx/swift,swiftix/swift.old,uasys/swift,devincoughlin/swift,kusl/swift,glessard/swift,tardieu/swift,amraboelela/swift,felix91gr/swift,karwa/swift,jmgc/swift,gribozavr/swift,modocache/swift,hughbe/swift,brentdax/swift,sdulal/swift,parkera/swift,lorentey/swift,gribozavr/swift,KrishMunot/swift,natecook1000/swift,tjw/swift,nathawes/swift,huonw/swift,xedin/swift,allevato/swift,Ivacker/swift,shahmishal/swift,JGiola/swift,shajrawi/swift,zisko/swift,gmilos/swift,lorentey/swift,mightydeveloper/swift,uasys/swift,practicalswift/swift,natecook1000/swift,felix91gr/swift,calebd/swift,tjw/swift,hughbe/swift,dreamsxin/swift,allevato/swift,lorentey/swift,manavgabhawala/swift,brentdax/swift,amraboelela/swift,LeoShimonaka/swift,huonw/swift,LeoShimonaka/swift,jopamer/swift,tkremenek/swift,CodaFi/swift,therealbnut/swift,amraboelela/swift,emilstahl/swift,tjw/swift,sschiau/swift,kentya6/swift,CodaFi/swift,benlangmuir/swift,ben-ng/swift,IngmarStein/swift,xedin/swift,natecook1000/swift,mightydeveloper/swift,manavgabhawala/swift,Ivacker/swift
41de829555f2a17fddd0acae5307bb169be40897
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import <Foundation/Foundation.h> #define KW_VERSION 0.5 // Blocks being unavailable cripples the usability of Kiwi, but is supported // because they are not available on anything less than a device running 3.2. #if defined(__BLOCKS__) #ifndef KW_BLOCKS_ENABLED #define KW_BLOCKS_ENABLED 1 #endif // #ifndef KW_BLOCKS_ENABLED #endif // #if defined(__BLOCKS__) // As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or // forwardInvocation: boundary in the simulator will terminate the app instead // of being caught in @catch blocks from the caller side of the -invoke. Kiwi // tries to handle this by storing the first exception that it would have // otherwise thrown in a nasty global that callers can look for and handle. // (Buggy termination is less desirable than global variables). // // Obviously, this can only handles cases where Kiwi itself would have raised // an exception. #if TARGET_IPHONE_SIMULATOR #define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1 #endif // #if TARGET_IPHONE_SIMULATOR
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import <Foundation/Foundation.h> #define KW_VERSION 0.5 // Blocks being unavailable cripples the usability of Kiwi, but is supported // because they are not available on anything less than a device running 3.2. #if defined(__BLOCKS__) #define KW_BLOCKS_ENABLED 1 #endif // #if defined(__BLOCKS__) // As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or // forwardInvocation: boundary in the simulator will terminate the app instead // of being caught in @catch blocks from the caller side of the -invoke. Kiwi // tries to handle this by storing the first exception that it would have // otherwise thrown in a nasty global that callers can look for and handle. // (Buggy termination is less desirable than global variables). // // Obviously, this can only handles cases where Kiwi itself would have raised // an exception. #if TARGET_IPHONE_SIMULATOR #define KW_TARGET_HAS_INVOCATION_EXCEPTION_BUG 1 #endif // #if TARGET_IPHONE_SIMULATOR
--- +++ @@ -11,7 +11,9 @@ // Blocks being unavailable cripples the usability of Kiwi, but is supported // because they are not available on anything less than a device running 3.2. #if defined(__BLOCKS__) - #define KW_BLOCKS_ENABLED 1 + #ifndef KW_BLOCKS_ENABLED + #define KW_BLOCKS_ENABLED 1 + #endif // #ifndef KW_BLOCKS_ENABLED #endif // #if defined(__BLOCKS__) // As of iPhone SDK 4 GM, exceptions thrown across an NSInvocation -invoke or
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level
bsd-3-clause
LiuShulong/Kiwi,samkrishna/Kiwi,carezone/Kiwi,howandhao/Kiwi,ecaselles/Kiwi,allending/Kiwi,TaemoonCho/Kiwi,howandhao/Kiwi,indiegogo/Kiwi,PaulTaykalo/Kiwi,JoistApp/Kiwi,samkrishna/Kiwi,indiegogo/Kiwi,carezone/Kiwi,LiuShulong/Kiwi,unisontech/Kiwi,ashfurrow/Kiwi,weslindsay/Kiwi,iosRookie/Kiwi,depop/Kiwi,TaemoonCho/Kiwi,howandhao/Kiwi,ashfurrow/Kiwi,cookov/Kiwi,tangwei6423471/Kiwi,ecaselles/Kiwi,allending/Kiwi,weslindsay/Kiwi,emodeqidao/Kiwi,alloy/Kiwi,weslindsay/Kiwi,tangwei6423471/Kiwi,PaulTaykalo/Kiwi,PaulTaykalo/Kiwi,TaemoonCho/Kiwi,TaemoonCho/Kiwi,tcirwin/Kiwi,emodeqidao/Kiwi,tangwei6423471/Kiwi,carezone/Kiwi,tonyarnold/Kiwi,depop/Kiwi,iosRookie/Kiwi,unisontech/Kiwi,hyperoslo/Tusen,cookov/Kiwi,indiegogo/Kiwi,weslindsay/Kiwi,cookov/Kiwi,cookov/Kiwi,carezone/Kiwi,tonyarnold/Kiwi,unisontech/Kiwi,depop/Kiwi,allending/Kiwi,JoistApp/Kiwi,hyperoslo/Tusen,samkrishna/Kiwi,samkrishna/Kiwi,ashfurrow/Kiwi,alloy/Kiwi,iosRookie/Kiwi,ecaselles/Kiwi,howandhao/Kiwi,unisontech/Kiwi,emodeqidao/Kiwi,iosRookie/Kiwi,JoistApp/Kiwi,LiuShulong/Kiwi,alloy/Kiwi,emodeqidao/Kiwi,hyperoslo/Tusen,indiegogo/Kiwi,JoistApp/Kiwi,LiuShulong/Kiwi,tcirwin/Kiwi,tonyarnold/Kiwi,tcirwin/Kiwi,tangwei6423471/Kiwi,allending/Kiwi,ecaselles/Kiwi,PaulTaykalo/Kiwi,tcirwin/Kiwi,depop/Kiwi,tonyarnold/Kiwi,hyperoslo/Tusen
399869422abf30a0f635596263fd315ea9bde266
/* * Copyright 2011-2016 Blender Foundation * * 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 __UTIL_VERSION_H__ #define __UTIL_VERSION_H__ /* Cycles version number */ CCL_NAMESPACE_BEGIN #define CYCLES_VERSION_MAJOR 1 #define CYCLES_VERSION_MINOR 13 #define CYCLES_VERSION_PATCH 0 #define CYCLES_MAKE_VERSION_STRING2(a, b, c) #a "." #b "." #c #define CYCLES_MAKE_VERSION_STRING(a, b, c) CYCLES_MAKE_VERSION_STRING2(a, b, c) #define CYCLES_VERSION_STRING \ CYCLES_MAKE_VERSION_STRING(CYCLES_VERSION_MAJOR, CYCLES_VERSION_MINOR, CYCLES_VERSION_PATCH) CCL_NAMESPACE_END #endif /* __UTIL_VERSION_H__ */
/* * Copyright 2011-2016 Blender Foundation * * 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 __UTIL_VERSION_H__ #define __UTIL_VERSION_H__ /* Cycles version number */ CCL_NAMESPACE_BEGIN #define CYCLES_VERSION_MAJOR 1 #define CYCLES_VERSION_MINOR 12 #define CYCLES_VERSION_PATCH 0 #define CYCLES_MAKE_VERSION_STRING2(a, b, c) #a "." #b "." #c #define CYCLES_MAKE_VERSION_STRING(a, b, c) CYCLES_MAKE_VERSION_STRING2(a, b, c) #define CYCLES_VERSION_STRING \ CYCLES_MAKE_VERSION_STRING(CYCLES_VERSION_MAJOR, CYCLES_VERSION_MINOR, CYCLES_VERSION_PATCH) CCL_NAMESPACE_END #endif /* __UTIL_VERSION_H__ */
--- +++ @@ -22,7 +22,7 @@ CCL_NAMESPACE_BEGIN #define CYCLES_VERSION_MAJOR 1 -#define CYCLES_VERSION_MINOR 12 +#define CYCLES_VERSION_MINOR 13 #define CYCLES_VERSION_PATCH 0 #define CYCLES_MAKE_VERSION_STRING2(a, b, c) #a "." #b "." #c
Bump version to 1.13, matching blender 2.90 release cycle
apache-2.0
tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird,tangent-opensource/coreBlackbird
4720a44172fff28774ded70c15f1df66a43b8b44
// // CDZIssueSyncEngine.h // thingshub // // Created by Chris Dzombak on 1/13/14. // Copyright (c) 2014 Chris Dzombak. All rights reserved. // #import <ReactiveCocoa/ReactiveCocoa.h> @class OCTClient; @class CDZThingsHubConfiguration; @protocol CDZIssueSyncDelegate; @interface CDZIssueSyncEngine : NSObject /// Designated initializer - (instancetype)initWithDelegate:(id<CDZIssueSyncDelegate>)delegate configuration:(CDZThingsHubConfiguration *)config authenticatedClient:(OCTClient *)client; /// Returns a signal which will asynchronously return strings as status updates, /// and either complete or error after the sync operation. - (RACSignal *)sync; @end
// // CDZIssueSyncEngine.h // thingshub // // Created by Chris Dzombak on 1/13/14. // Copyright (c) 2014 Chris Dzombak. All rights reserved. // #import <ReactiveCocoa/ReactiveCocoa.h> @class OCTClient; @class CDZThingsHubConfiguration; @protocol CDZIssueSyncDelegate; @interface CDZIssueSyncEngine : NSObject /// Designated initializer - (instancetype)initWithDelegate:(id<CDZIssueSyncDelegate>)delegate configuration:(CDZThingsHubConfiguration *)config authenticatedClient:(OCTClient *)client; /// Returns a signal which will either complete or error after the sync operation. - (RACSignal *)sync; @end
--- +++ @@ -19,7 +19,8 @@ configuration:(CDZThingsHubConfiguration *)config authenticatedClient:(OCTClient *)client; -/// Returns a signal which will either complete or error after the sync operation. +/// Returns a signal which will asynchronously return strings as status updates, +/// and either complete or error after the sync operation. - (RACSignal *)sync; @end
Update sync method docs in IssueSyncEngine
mit
cdzombak/thingshub,cdzombak/thingshub,cdzombak/thingshub
e0c1a00bbff90dffccc5d5aab9142b076b72a821
// // SRDebug.h // Sensorama // // Created by Wojciech Adam Koszek (h) on 09/04/2016. // Copyright © 2016 Wojciech Adam Koszek. All rights reserved. // #ifndef SRDebug_h #define SRDebug_h #define SRPROBE0() do { \ NSLog(@"%s", __func__); \ } while (0) #define SRPROBE1(x1) do { \ NSLog(@"%s %s=%@", __func__, #x1, (x1)); \ } while (0) #define SRPROBE2(x1, x2) do { \ NSLog(@"%s %s=%@ %s=%@", __func__, #x1, (x1), #x2, (x2)); \ } while (0) #define SRPROBE3(x1, x2, x3) do { \ NSLog(@"%s %s=%@ %s=%@ %s=%@", __func__, #x1, (x1), #x2, (x2), #x3, (x3)); \ } while (0) #define SRDEBUG if (1) NSLog #endif /* SRDebug_h */
// // SRDebug.h // Sensorama // // Created by Wojciech Adam Koszek (h) on 09/04/2016. // Copyright © 2016 Wojciech Adam Koszek. All rights reserved. // #ifndef SRDebug_h #define SRDebug_h #define SRPROBE0() do { \ NSLog(@"%s", __func__); \ } while (0) #define SRPROBE1(x1) do { \ NSLog(@"%s %s=%@", __func__, #x1, (x1)); \ } while (0) #define SRPROBE2(x1, x2) do { \ NSLog(@"%s %s=%@ %s=%@", __func__, #x1, (x1), #x2, (x2)); \ } while (0) #define SRDEBUG if (1) NSLog #endif /* SRDebug_h */
--- +++ @@ -21,6 +21,10 @@ NSLog(@"%s %s=%@ %s=%@", __func__, #x1, (x1), #x2, (x2)); \ } while (0) +#define SRPROBE3(x1, x2, x3) do { \ + NSLog(@"%s %s=%@ %s=%@ %s=%@", __func__, #x1, (x1), #x2, (x2), #x3, (x3)); \ +} while (0) + #define SRDEBUG if (1) NSLog #endif /* SRDebug_h */
Add 1 more macro for debugging 3 things.
bsd-2-clause
wkoszek/sensorama-ios,wkoszek/sensorama-ios,wkoszek/sensorama-ios,wkoszek/sensorama-ios
3f274880fb1720b82e449a9b4d86ec0dab336d7c
// // HLError.h // HLSpriteKit // // Created by Karl Voskuil on 6/6/14. // Copyright (c) 2014 Hilo Games. All rights reserved. // #import <Foundation/Foundation.h> /** The error level for logging non-critical errors using `HLError()`. */ typedef NS_ENUM(NSInteger, HLErrorLevel) { /** Errors. */ HLLevelError, /** Warnings. */ HLLevelWarning, /** Information. */ HLLevelInfo, }; /** Logs a non-critical error. */ static inline void HLError(HLErrorLevel level, NSString *message) { // TODO: This is a placeholder for a better mechanism for non-critical error logging, // e.g. CocoaLumberjack. NSString *levelLabel; switch (level) { case HLLevelInfo: levelLabel = @"INFO"; break; case HLLevelWarning: levelLabel = @"WARNING"; break; case HLLevelError: levelLabel = @"ERROR"; break; } NSLog(@"%@: %@", levelLabel, message); }
// // HLError.h // HLSpriteKit // // Created by Karl Voskuil on 6/6/14. // Copyright (c) 2014 Hilo Games. All rights reserved. // #import <Foundation/Foundation.h> /** The error level for logging non-critical errors using `HLError()`. */ typedef NS_ENUM(NSInteger, HLErrorLevel) { /** Errors. */ HLLevelError, /** Warnings. */ HLLevelWarning, /** Information. */ HLLevelInfo, }; /** Logs a non-critical error. */ static void HLError(HLErrorLevel level, NSString *message) { // TODO: This is a placeholder for a better mechanism for non-critical error logging, // e.g. CocoaLumberjack. NSString *levelLabel; switch (level) { case HLLevelInfo: levelLabel = @"INFO"; break; case HLLevelWarning: levelLabel = @"WARNING"; break; case HLLevelError: levelLabel = @"ERROR"; break; } NSLog(@"%@: %@", levelLabel, message); }
--- +++ @@ -29,7 +29,7 @@ /** Logs a non-critical error. */ -static void +static inline void HLError(HLErrorLevel level, NSString *message) { // TODO: This is a placeholder for a better mechanism for non-critical error logging,
Fix compiler warning for unused function.
mit
hilogames/HLSpriteKit,hilogames/HLSpriteKit
668205545defd3dea025c55c57f7a5da6ce0408a
#define _XOPEN_SOURCE 700 #include <stdio.h> #include <signal.h> #include <unistd.h> #include <assert.h> #include <stdlib.h> #include <setjmp.h> jmp_buf try; void handler(int sig) { static int i = 0; printf("stack overflow %d\n", i); longjmp(try, ++i); assert(0); } unsigned recurse(unsigned x) { return recurse(x)+1; } int main() { char* stack; stack = malloc(sizeof(stack) * SIGSTKSZ); stack_t ss = { .ss_size = SIGSTKSZ, .ss_sp = stack, }; struct sigaction sa = { .sa_handler = handler, .sa_flags = SA_ONSTACK }; sigaltstack(&ss, 0); sigfillset(&sa.sa_mask); sigaction(SIGALRM, &sa, 0); raise(SIGALRM); return 0; if (setjmp(try) < 3) { recurse(0); } else { printf("caught exception!\n"); } return 0; }
#define _XOPEN_SOURCE 700 #include <stdio.h> #include <signal.h> #include <unistd.h> #include <assert.h> #include <stdlib.h> #include <setjmp.h> jmp_buf try; void handler(int sig) { static int i = 0; printf("stack overflow %d\n", i); longjmp(try, ++i); assert(0); } unsigned recurse(unsigned x) { return recurse(x)+1; } int main() { char* stack; stack = malloc(sizeof(stack) * SIGSTKSZ); stack_t ss = { .ss_size = SIGSTKSZ, .ss_sp = stack, }; struct sigaction sa = { .sa_handler = handler, .sa_flags = SA_ONSTACK }; sigaltstack(&ss, 0); sigfillset(&sa.sa_mask); sigaction(SIGSEGV, &sa, 0); if (setjmp(try) < 3) { recurse(0); } else { printf("caught exception!\n"); } return 0; }
--- +++ @@ -35,7 +35,10 @@ sigaltstack(&ss, 0); sigfillset(&sa.sa_mask); - sigaction(SIGSEGV, &sa, 0); + sigaction(SIGALRM, &sa, 0); + + raise(SIGALRM); + return 0; if (setjmp(try) < 3) { recurse(0);
Switch to SIGLARM, to allow seamless gdb usage
apache-2.0
danluu/setjmp-longjmp-ucontext-snippets,danluu/setjmp-longjmp-ucontext-snippets
bc552606f319023f360417c596f5b6da4c91fdd2
#include <stdlib.h> #include <stdio.h> #include <string.h> void runStep(struct stack_node node, struct stack_node *top) { switch( node.data.type ) { case T_INT: push(node, top); break; case T_SBRTN: push(node, top); break; case T_char 1: switch( nonde.data.numval ) { case '+': int x = pop(top); int y = pop(top); push(x + y); break; case '_': push(0); case '-': int x = pop(top); int y = pop(top); push(x - y); break; case '*': int x = pop(top); int y = pop(top); push(x * y); break; case '/': int x = pop(top); int y = pop(top); push(x / y); break; case '=': int x = pop(top); int y = pop(top); if(x == y) push(-1); else push(0); break; case '<': int x = pop(top); int y = pop(top); if(x < y) push(-1); else push(0); break; case '~': int x = pop(top); int y = pop(top); if(x == y): push(0); else push(-1); } } } struct stack_node pop(struct stack_node *top) { struct stack_node pop = *top; *top = *(pop.cdr); return pop; } void push(struct stack_node node, struct stack_node *top) { node.cdr = top; *top = node; }
#include <stdlib.h> #include <stdio.h> #include <string.h> void runStep(struct stack_node node, struct stack_node *top) { switch( node.data.type ) { case 0: struct stack_node push; push.cdr = top; push.data = node.data; *top = push; break; } }
--- +++ @@ -4,11 +4,69 @@ void runStep(struct stack_node node, struct stack_node *top) { switch( node.data.type ) { - case 0: - struct stack_node push; - push.cdr = top; - push.data = node.data; - *top = push; + case T_INT: push(node, top); break; + case T_SBRTN: + push(node, top); + break; + case T_char 1: + switch( nonde.data.numval ) { + case '+': + int x = pop(top); + int y = pop(top); + push(x + y); + break; + case '_': + push(0); + case '-': + int x = pop(top); + int y = pop(top); + push(x - y); + break; + case '*': + int x = pop(top); + int y = pop(top); + push(x * y); + break; + case '/': + int x = pop(top); + int y = pop(top); + push(x / y); + break; + case '=': + int x = pop(top); + int y = pop(top); + if(x == y) + push(-1); + else + push(0); + break; + case '<': + int x = pop(top); + int y = pop(top); + if(x < y) + push(-1); + else + push(0); + break; + case '~': + int x = pop(top); + int y = pop(top); + if(x == y): + push(0); + else + push(-1); + } } } + +struct stack_node pop(struct stack_node *top) { + struct stack_node pop = *top; + *top = *(pop.cdr); + return pop; +} + +void push(struct stack_node node, struct stack_node *top) { + node.cdr = top; + *top = node; +}
Implement interpretation of basic arithmetic and comparatory functions.
mit
aacoppa/final,aacoppa/final
6bb6c383a5acfcd734a4453d4f7f20caa727c744
#pragma once // These numbers and strings need to be manually updated for a new version. // Do this version number update as the very last commit for the new release version. #define PROGRAM_VERSION_MAJOR 2 #define PROGRAM_VERSION_MINOR 0 #define PROGRAM_VERSION_MAINTENANCE 1 #define PROGRAM_VERSION_STRING "2.0.1b SDL mod by Krejza9" #define PROGRAM_BUILT_STRING __DATE__ " - " __TIME__ #define RESOURCE_VERSION_STRING "2,0,1\0" #define RESOURCE_VERSION PROGRAM_VERSION_MAJOR,PROGRAM_VERSION_MINOR,PROGRAM_VERSION_MAINTENANCE
#pragma once // These numbers and strings need to be manually updated for a new version. // Do this version number update as the very last commit for the new release version. #define PROGRAM_VERSION_MAJOR 2 #define PROGRAM_VERSION_MINOR 0 #define PROGRAM_VERSION_MAINTENANCE 1 #define PROGRAM_VERSION_STRING "2.0.1a" #define PROGRAM_BUILT_STRING __DATE__ " - " __TIME__ #define RESOURCE_VERSION_STRING "2,0,1\0" #define RESOURCE_VERSION PROGRAM_VERSION_MAJOR,PROGRAM_VERSION_MINOR,PROGRAM_VERSION_MAINTENANCE
--- +++ @@ -5,7 +5,7 @@ #define PROGRAM_VERSION_MAJOR 2 #define PROGRAM_VERSION_MINOR 0 #define PROGRAM_VERSION_MAINTENANCE 1 -#define PROGRAM_VERSION_STRING "2.0.1a" +#define PROGRAM_VERSION_STRING "2.0.1b SDL mod by Krejza9" #define PROGRAM_BUILT_STRING __DATE__ " - " __TIME__
Update version to 2.0.1b SDL mod by Krejza9.
mit
Krejza9/EmulationStation-sdlmixer,Krejza9/EmulationStation-sdlmixer,Krejza9/EmulationStation-sdlmixer
2b7d5dd221477e233f77c8c729ee34f61600cfca
/* * m_name.c -- return a message number as a string * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include <limits.h> #include <h/mh.h> #define STR(s) #s #define SIZE(n) (sizeof STR(n)) /* Includes NUL. */ char * m_name (int num) { static char name[SIZE(INT_MAX)]; if (num <= 0) return "?"; snprintf(name, sizeof name, "%d", num); return name; }
/* * m_name.c -- return a message number as a string * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include <limits.h> #include <h/mh.h> #define STR(s) #s #define SIZE(n) (sizeof STR(n)) /* Includes NUL. */ char * m_name (int num) { static char name[SIZE(INT_MAX)]; if (num <= 0) return "?"; sprintf(name, "%d", num); return name; }
--- +++ @@ -21,7 +21,7 @@ if (num <= 0) return "?"; - sprintf(name, "%d", num); + snprintf(name, sizeof name, "%d", num); return name; }
Use the imperfect snprintf(3) instead of sprintf(3).
bsd-3-clause
mcr/nmh,mcr/nmh
348d46bd97e8fb2432685d931210b72827060b5d
#pragma once #include <stddef.h> // size_t definition #include <tasm/bytes.h> #include <tasm/private/execute.h> #include <tasm/private/byte_string.h> #include <tasm/private/foldable.h> #include <tasm/private/label.h> #include <tasm/private/state.h> namespace tasm { /** Convert an Asm program into machine code. */ template <typename program> using assemble = typename details::call< program, state::pass2state<typename details::call<program, state::pass1state>::first>>::second; /** Assembly function wrapper. */ template <typename R, typename P> struct AsmProgram { using program = P; template <typename... Args> R operator()(Args... args) { return reinterpret_cast<R(*)(std::decay_t<Args>...)>(const_cast<char*>(P::data))(args...); } }; /** Block of assembly code. */ template <typename x, typename... xs> constexpr auto block(x, xs...) { return execute::seq<x, xs...>{}; } /** Create a top level assembly function. */ template <typename R, typename x, typename... xs> constexpr auto Asm(x, xs...) { return AsmProgram<R, assemble<execute::seq<x, xs...>>>(); } } // tasm
#pragma once #include <stddef.h> // size_t definition #include <tasm/bytes.h> #include <tasm/private/execute.h> #include <tasm/private/byte_string.h> #include <tasm/private/foldable.h> #include <tasm/private/label.h> #include <tasm/private/state.h> namespace tasm { /** Convert an Asm program into machine code. */ template <typename program> using assemble = typename details::call< program, state::pass2state<typename details::call<program, state::pass1state>::first>>::second; /** Assembly function wrapper. */ template <typename R, typename P> struct AsmProgram { using program = P; template <typename... Args> R operator()(Args... args) { return ((R(*)(std::decay_t<Args>...))P::data)(args...); } }; /** Block of assembly code. */ template <typename x, typename... xs> constexpr auto block(x, xs...) { return execute::seq<x, xs...>{}; } /** Create a top level assembly function. */ template <typename R, typename x, typename... xs> constexpr auto Asm(x, xs...) { return AsmProgram<R, assemble<execute::seq<x, xs...>>>(); } } // tasm
--- +++ @@ -27,7 +27,7 @@ template <typename... Args> R operator()(Args... args) { - return ((R(*)(std::decay_t<Args>...))P::data)(args...); + return reinterpret_cast<R(*)(std::decay_t<Args>...)>(const_cast<char*>(P::data))(args...); } };
Fix remaining cast alignment warnings through the magic of casting
mit
mattbierner/Template-Assembly,mattbierner/Template-Assembly,izissise/Template-Assembly,izissise/Template-Assembly
64bd95f2799cdcaa44d58e2e1d3650477c2bd793
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; int chute; printf("Qual é o seu chute? "); scanf("%d", &chute); printf("Seu chute foi %d\n", chute); int acertou = chute == numerosecreto; if(acertou) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); } else { int maior = chute > numerosecreto; if(maior) { printf("Seu chute foi maior que o número secreto\n"); } else { printf("Seu chute foi menor que o número secreto\n"); } printf("Você errou!\n"); printf("Mas não desanime, tente de novo!\n"); } }
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; int chute; printf("Qual é o seu chute? "); scanf("%d", &chute); printf("Seu chute foi %d\n", chute); if(chute == numerosecreto) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); } else { if(chute > numerosecreto) { printf("Seu chute foi maior que o número secreto\n"); } if(chute < numerosecreto) { printf("Seu chute foi menor que o número secreto\n"); } printf("Você errou!\n"); printf("Mas não desanime, tente de novo!\n"); } }
--- +++ @@ -15,16 +15,18 @@ scanf("%d", &chute); printf("Seu chute foi %d\n", chute); - if(chute == numerosecreto) { + int acertou = chute == numerosecreto; + + if(acertou) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); - } - else { - if(chute > numerosecreto) { + } else { + + int maior = chute > numerosecreto; + + if(maior) { printf("Seu chute foi maior que o número secreto\n"); - } - - if(chute < numerosecreto) { + } else { printf("Seu chute foi menor que o número secreto\n"); }
Update files, Alura, Introdução a C, Aula 2.3
mit
fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs
176b88ed92daa22bd561e61a53f5a7a4866ca81e
#ifdef E_TYPEDEFS #else # ifndef E_SMART_RANDR_H # define E_SMART_RANDR_H Evas_Object *e_smart_randr_add(Evas *evas); void e_smart_randr_layout_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); void e_smart_randr_current_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); void e_smart_randr_monitors_create(Evas_Object *obj); void e_smart_randr_monitor_add(Evas_Object *obj, Evas_Object *mon); void e_smart_randr_monitor_del(Evas_Object *obj, Evas_Object *mon); Eina_List *e_smart_randr_monitors_get(Evas_Object *obj); Eina_Bool e_smart_randr_changed_get(Evas_Object *obj); void e_smart_randr_changes_apply(Evas_Object *obj); # endif #endif
#ifdef E_TYPEDEFS #else # ifndef E_SMART_RANDR_H # define E_SMART_RANDR_H Evas_Object *e_smart_randr_add(Evas *evas); void e_smart_randr_layout_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h); void e_smart_randr_current_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h); void e_smart_randr_monitors_create(Evas_Object *obj); void e_smart_randr_monitor_add(Evas_Object *obj, Evas_Object *mon); void e_smart_randr_monitor_del(Evas_Object *obj, Evas_Object *mon); Eina_List *e_smart_randr_monitors_get(Evas_Object *obj); Eina_Bool e_smart_randr_changed_get(Evas_Object *obj); void e_smart_randr_changes_apply(Evas_Object *obj, Ecore_X_Window root); # endif #endif
--- +++ @@ -11,7 +11,7 @@ void e_smart_randr_monitor_del(Evas_Object *obj, Evas_Object *mon); Eina_List *e_smart_randr_monitors_get(Evas_Object *obj); Eina_Bool e_smart_randr_changed_get(Evas_Object *obj); -void e_smart_randr_changes_apply(Evas_Object *obj, Ecore_X_Window root); +void e_smart_randr_changes_apply(Evas_Object *obj); # endif #endif
Remove root window as a function paramater (not used anymore). Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 81262
bsd-2-clause
FlorentRevest/Enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment,tasn/enlightenment,tasn/enlightenment,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,rvandegrift/e,rvandegrift/e,tizenorg/platform.upstream.enlightenment,tizenorg/platform.upstream.enlightenment,rvandegrift/e
1d6ea657a965cbe59fa1b669d01422f3b8cbb193
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATIONS_ERASE_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATIONS_ERASE_OPERATION_H_ #include "../operation.h" namespace You { namespace DataStore { namespace Internal { class EraseOperation : public IOperation { public: explicit EraseOperation(TaskId); bool run(); }; } // namespace Internal } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATIONS_ERASE_OPERATION_H_
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATIONS_ERASE_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATIONS_ERASE_OPERATION_H_ #include "../operation.h" namespace You { namespace DataStore { namespace Internal { class EraseOperation : public IOperation { public: EraseOperation(TaskId); bool run(); }; } // namespace Internal } // namespace DataStore } // namespace You #endif // YOU_DATASTORE_INTERNAL_OPERATIONS_ERASE_OPERATION_H_
--- +++ @@ -9,7 +9,7 @@ namespace Internal { class EraseOperation : public IOperation { public: - EraseOperation(TaskId); + explicit EraseOperation(TaskId); bool run(); }; } // namespace Internal
Add explicit modifier to EraseOperation ctor
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
0dac68d485c739947ea064b63dd4312ffc42a96c
/* * Copyright 2008 The Native Client 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 SERVICE_RUNTIME_NACL_SYSCALL_H__ #define SERVICE_RUNTIME_NACL_SYSCALL_H__ extern int NaClSyscallSeg(); #endif
/* * Copyright 2008 The Native Client 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 SERVICE_RUNTIME_NACL_SYSCALL_H__ #define SERVICE_RUNTIME_NACL_SYSCALL_H__ #if !NACL_MACOSX || defined(NACL_STANDALONE) extern int NaClSyscallSeg(); #else // This declaration is used only on Mac OSX for Chrome build extern int NaClSyscallSeg() __attribute__((weak_import)); #endif #endif
--- +++ @@ -8,10 +8,6 @@ #ifndef SERVICE_RUNTIME_NACL_SYSCALL_H__ #define SERVICE_RUNTIME_NACL_SYSCALL_H__ -#if !NACL_MACOSX || defined(NACL_STANDALONE) extern int NaClSyscallSeg(); -#else -// This declaration is used only on Mac OSX for Chrome build -extern int NaClSyscallSeg() __attribute__((weak_import)); + #endif -#endif
Tidy: Remove unused special case for Mac OS X The special case was dead code anyway because it tested the wrong preprocessor symbol (NACL_MACOSX instead of NACL_OSX). Review URL: http://codereview.chromium.org/1051001 git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@1792 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
bsd-3-clause
sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,nacl-webkit/native_client,nacl-webkit/native_client,nacl-webkit/native_client,nacl-webkit/native_client
eaea595bb0310b19f41d1b2eece7fbe4d5dbf14e
#ifdef _WIN32 #include <windows.h> #else #include <unistd.h> #include <fcntl.h> #include <sys/fcntl.h> #endif #include <stdio.h> #include <string> using namespace std; inline string copyFile(const string &filename, const string &ext) { string newname = string(tempnam(NULL, NULL)) + ext; string oldname = string("data/") + filename + ext; #ifdef _WIN32 CopyFile(oldname.c_str(), newname.c_str(), FALSE); SetFileAttributes(newname.c_str(), GetFileAttributes(newname.c_str()) & ~FILE_ATTRIBUTE_READONLY); #else char buffer[4096]; int bytes; int inf = open(oldname.c_str(), O_RDONLY); int outf = open(newname.c_str(), O_CREAT | O_EXCL | O_RDWR, S_IRUSR | S_IWUSR); while((bytes = read(inf, buffer, sizeof(buffer))) > 0) write(outf, buffer, bytes); close(outf); close(inf); #endif return newname; } inline void deleteFile(const string &filename) { remove(filename.c_str()); } class ScopedFileCopy { public: ScopedFileCopy(const string &filename, const string &ext) { m_filename = copyFile(filename, ext); } ~ScopedFileCopy() { deleteFile(m_filename); } string fileName() { return m_filename; } private: string m_filename; };
#include <string> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/fcntl.h> using namespace std; inline string copyFile(const string &filename, const string &ext) { string newname = string(tempnam(NULL, NULL)) + ext; string oldname = string("data/") + filename + ext; char buffer[4096]; int bytes; int inf = open(oldname.c_str(), O_RDONLY); int outf = open(newname.c_str(), O_CREAT | O_EXCL | O_RDWR, S_IRUSR | S_IWUSR); while((bytes = read(inf, buffer, sizeof(buffer))) > 0) write(outf, buffer, bytes); close(outf); close(inf); return newname; } inline void deleteFile(const string &filename) { remove(filename.c_str()); } class ScopedFileCopy { public: ScopedFileCopy(const string &filename, const string &ext) { m_filename = copyFile(filename, ext); } ~ScopedFileCopy() { deleteFile(m_filename); } string fileName() { return m_filename; } private: string m_filename; };
--- +++ @@ -1,8 +1,12 @@ -#include <string> -#include <stdio.h> +#ifdef _WIN32 +#include <windows.h> +#else #include <unistd.h> #include <fcntl.h> #include <sys/fcntl.h> +#endif +#include <stdio.h> +#include <string> using namespace std; @@ -10,6 +14,10 @@ { string newname = string(tempnam(NULL, NULL)) + ext; string oldname = string("data/") + filename + ext; +#ifdef _WIN32 + CopyFile(oldname.c_str(), newname.c_str(), FALSE); + SetFileAttributes(newname.c_str(), GetFileAttributes(newname.c_str()) & ~FILE_ATTRIBUTE_READONLY); +#else char buffer[4096]; int bytes; int inf = open(oldname.c_str(), O_RDONLY); @@ -18,6 +26,7 @@ write(outf, buffer, bytes); close(outf); close(inf); +#endif return newname; }
Fix compilation fo the test runner on Windows Patch by Stephen Hewitt git-svn-id: 7928e23e4d58c5ca14aa7b47c53aeff82ee1dd0c@1078612 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
lgpl-2.1
dlz1123/taglib,black78/taglib,taglib/taglib,davispuh/taglib,pbhd/taglib,videolabs/taglib,videolabs/taglib,TsudaKageyu/taglib,taglib/taglib,MaxLeb/taglib,pbhd/taglib,Distrotech/taglib,pbhd/taglib,crystax/cosp-android-taglib,dlz1123/taglib,crystax/cosp-android-taglib,davispuh/taglib,Distrotech/taglib,dlz1123/taglib,TsudaKageyu/taglib,i80and/taglib,i80and/taglib,TsudaKageyu/taglib,taglib/taglib,i80and/taglib,Distrotech/taglib,videolabs/taglib,MaxLeb/taglib,MaxLeb/taglib,black78/taglib,davispuh/taglib,black78/taglib
0d16255d093a3292abaf0b07e21ddebc956e7ca3
#include <sys/types.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include "iobuf.h" unsigned iobuf_bufsize = 8192; #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif int iobuf_init(iobuf* io, int fd, unsigned bufsize, char* buffer, unsigned flags) { memset(io, 0, sizeof *io); if (!bufsize) bufsize = iobuf_bufsize; if (!buffer) { if ((buffer = mmap(0, bufsize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0)) != 0) flags |= IOBUF_NEEDSMUNMAP; else { if ((buffer = malloc(bufsize)) == 0) return 0; flags |= IOBUF_NEEDSFREE; } } io->fd = fd; io->buffer = buffer; io->bufsize = bufsize; io->flags = flags; return 1; }
#include <stdlib.h> #include <string.h> #include <sys/mman.h> #include "iobuf.h" unsigned iobuf_bufsize = 8192; int iobuf_init(iobuf* io, int fd, unsigned bufsize, char* buffer, unsigned flags) { memset(io, 0, sizeof *io); if (!bufsize) bufsize = iobuf_bufsize; if (!buffer) { if ((buffer = mmap(0, bufsize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0)) != 0) flags |= IOBUF_NEEDSMUNMAP; else { if ((buffer = malloc(bufsize)) == 0) return 0; flags |= IOBUF_NEEDSFREE; } } io->fd = fd; io->buffer = buffer; io->bufsize = bufsize; io->flags = flags; return 1; }
--- +++ @@ -1,9 +1,14 @@ +#include <sys/types.h> #include <stdlib.h> #include <string.h> #include <sys/mman.h> #include "iobuf.h" unsigned iobuf_bufsize = 8192; + +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif int iobuf_init(iobuf* io, int fd, unsigned bufsize, char* buffer, unsigned flags) {
Use MAP_ANON if MAP_ANONYMOUS is not defined.
lgpl-2.1
bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs
c804b5c55d42fcdc645dd81014d6bef253bd9f39
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include "sw/device/lib/testing/test_status.h" #include "sw/device/lib/arch/device.h" #include "sw/device/lib/base/log.h" #include "sw/device/lib/base/mmio.h" #include "sw/device/lib/runtime/hart.h" /** * Address of the memory location to write the test status. For DV use only. */ static const uintptr_t kSwDvTestStatusAddr = 0x1000fff8; void test_status_set(test_status_t test_status) { if (kDeviceType == kDeviceSimDV) { mmio_region_t sw_dv_test_status_addr = mmio_region_from_addr(kSwDvTestStatusAddr); mmio_region_write32(sw_dv_test_status_addr, 0x0, (uint32_t)test_status); } switch (test_status) { case kTestStatusPassed: { LOG_INFO("PASS!"); abort(); break; } case kTestStatusFailed: { LOG_INFO("FAIL!"); abort(); break; } default: { // Do nothing. break; } } }
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include "sw/device/lib/testing/test_status.h" #include "sw/device/lib/arch/device.h" #include "sw/device/lib/base/log.h" #include "sw/device/lib/base/mmio.h" #include "sw/device/lib/runtime/hart.h" /** * Address of the memory location to write the test status. For DV use only. */ static const uintptr_t kSwDvTestStatusAddr = 0x1000fff8; void test_status_set(test_status_t test_status) { if (kDeviceType == kDeviceSimDV) { mmio_region_t sw_dv_test_status_addr = mmio_region_from_addr(kSwDvTestStatusAddr); mmio_region_write32(sw_dv_test_status_addr, 0x0, (uint32_t)test_status); } switch (test_status) { case kTestStatusPassed: { LOG_INFO("PASS"); abort(); break; } case kTestStatusFailed: { LOG_INFO("FAIL"); abort(); break; } default: { // Do nothing. break; } } }
--- +++ @@ -23,12 +23,12 @@ switch (test_status) { case kTestStatusPassed: { - LOG_INFO("PASS"); + LOG_INFO("PASS!"); abort(); break; } case kTestStatusFailed: { - LOG_INFO("FAIL"); + LOG_INFO("FAIL!"); abort(); break; }
[sw] Fix PASS!, FAIL! signatures for CI Signed-off-by: Srikrishna Iyer <2803d640feace36379942447842f26c7747b4dc3@google.com>
apache-2.0
lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan
79408a202316fa24af2d6caf8c129dcd6f97f87e
#include <irq.h> #include <uart.h> void (*pl190_isr_vectors[IRQ_COUNT])(void) = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, uart0_irq_handler, 0, 0, 0 }; void irq_enable() { __asm__ __volatile__ ( "mrs r0, cpsr\n" "bic r0, r0, #0x80\n" "msr cpsr, r0\n" ); } void irq_disable() { __asm__ __volatile__ ( "mrs r0, cpsr\n" "orr r0, #0xc0\n" "msr cpsr, r0\n" ); } void handler_swi() { uart0_send("In SWI!\n"); irq_enable(); } void handler_irq() { unsigned int reg_irq_status = *((volatile unsigned int *) PIC_IRQ_STATUS); int irq_n = 0; while (reg_irq_status >>= 1) irq_n++; pl190_isr_vectors[irq_n](); }
#include <irq.h> void irq_enable() { __asm__ __volatile__ ( "mrs r0, cpsr\n" "bic r0, r0, #0x80\n" "msr cpsr, r0\n" ); } void irq_disable() { __asm__ __volatile__ ( "mrs r0, cpsr\n" "orr r0, #0xc0\n" "msr cpsr, r0\n" ); } void handler_swi() { uart0_send("In SWI!\n"); irq_enable(); } void handler_irq() { volatile unsigned int *reg = (unsigned int *) PIC_IRQ_STATUS; switch (*reg) { case PIC_UART0_BIT: uart0_irq_handler(); break; } #if 0 __asm__ __volatile__ ( "mrs r0, cpsr\n" "bic r0, r0, #0x1F\n" "orr r0, r0, #0x12\n" // enter SVC mode "msr cpsr, r0\n" "subs pc, lr, #4\n" ); #endif }
--- +++ @@ -1,4 +1,13 @@ #include <irq.h> +#include <uart.h> + +void (*pl190_isr_vectors[IRQ_COUNT])(void) = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + uart0_irq_handler, + 0, 0, 0 +}; + void irq_enable() { @@ -26,21 +35,12 @@ void handler_irq() { - volatile unsigned int *reg = (unsigned int *) PIC_IRQ_STATUS; + unsigned int reg_irq_status = *((volatile unsigned int *) PIC_IRQ_STATUS); + int irq_n = 0; - switch (*reg) { - case PIC_UART0_BIT: - uart0_irq_handler(); - break; + while (reg_irq_status >>= 1) + irq_n++; - } -#if 0 - __asm__ __volatile__ ( - "mrs r0, cpsr\n" - "bic r0, r0, #0x1F\n" - "orr r0, r0, #0x12\n" // enter SVC mode - "msr cpsr, r0\n" - "subs pc, lr, #4\n" - ); -#endif + pl190_isr_vectors[irq_n](); + }
Remove conditional branch in IRQ handler
mit
waynecw/cwos,waynecw/cwos
195e54d55c0b03e68ab46914d3d5e9f985395331
// Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved. // Please see the AUTHORS file for details. Use of this source code is governed // by a BSD license that can be found in the LICENSE file. #ifndef SCALLOC_COMMON_H_ #define SCALLOC_COMMON_H_ #include <stddef.h> // size_t #include "config.h" #define UNLIKELY(x) __builtin_expect((x), 0) #define LIKELY(x) __builtin_expect((x), 1) #define cache_aligned __attribute__((aligned(64))) #define always_inline inline __attribute__((always_inline)) #define no_inline __attribute__((noinline)) const size_t kSystemPageSize = PAGE_SIZE; const size_t kMinAlignment = 16; const size_t kMaxSmallSize = 512; const size_t kNumClasses = kMaxSmallSize / kMinAlignment; // Prohibit reordering of instructions by the compiler. inline void CompilerBarrier() { __asm__ __volatile__("" : : : "memory"); } // Full memory fence on x86-64 inline void MemoryBarrier() { __asm__ __volatile__("mfence" : : : "memory"); } always_inline size_t PadSize(size_t size, size_t multiple) { return (size + multiple - 1) / multiple * multiple; } #endif // SCALLOC_COMMON_H_
// Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved. // Please see the AUTHORS file for details. Use of this source code is governed // by a BSD license that can be found in the LICENSE file. #ifndef SCALLOC_COMMON_H_ #define SCALLOC_COMMON_H_ #include <stddef.h> // size_t #include "config.h" #define UNLIKELY(x) __builtin_expect((x), 0) #define LIKELY(x) __builtin_expect((x), 1) #define cache_aligned __attribute__((aligned(64))) #define always_inline inline __attribute__((always_inline)) #define no_inline __attribute__((noinline)) const size_t kSystemPageSize = PAGE_SIZE; // Prohibit reordering of instructions by the compiler. inline void CompilerBarrier() { __asm__ __volatile__("" : : : "memory"); } // Full memory fence on x86-64 inline void MemoryBarrier() { __asm__ __volatile__("mfence" : : : "memory"); } always_inline size_t PadSize(size_t size, size_t multiple) { return (size + multiple - 1) / multiple * multiple; } #endif // SCALLOC_COMMON_H_
--- +++ @@ -19,6 +19,12 @@ const size_t kSystemPageSize = PAGE_SIZE; +const size_t kMinAlignment = 16; + +const size_t kMaxSmallSize = 512; + +const size_t kNumClasses = kMaxSmallSize / kMinAlignment; + // Prohibit reordering of instructions by the compiler. inline void CompilerBarrier() { __asm__ __volatile__("" : : : "memory");
Add some allocator constants like minimum alignment or maximum small size. Signed-off-by: Michael Lippautz <0d543840881a2c189b4f7636b15eebd6a8f60ace@gmail.com>
bsd-2-clause
cksystemsgroup/scalloc,cksystemsgroup/scalloc,cksystemsgroup/scalloc
2060f21af2c0e469250ab8c30370739b24b18e9e
#include <avr/io.h> #include <avr/interrupt.h> #include "deps/rcswitch/rcswitch.h" #include "deps/softuart/softuart.h" #include "packet.h" #define PIN_RC PB2 int main(void) { // initialize serial softuart_init(); // enable interrupts sei(); // enable the rc switch rcswitch_enable(PIN_RC); while (1) { // if there is some data waiting for us if (softuart_kbhit()) { // parse the data struct Packet packet; binary_to_packet(&packet, softuart_getchar()); // handle the packet if (packet.status) { rcswitch_switch_on(packet.group + 1, packet.plug + 1); } else { rcswitch_switch_off(packet.group + 1, packet.plug + 1); } } } return 0; }
#include <avr/io.h> #include <util/delay.h> #include <avr/interrupt.h> #include "deps/util.h" #include "deps/rcswitch/rcswitch.h" #define PIN_RC PB2 #include "deps/softuart/softuart.h" #include "packet.h" int main(void) { // initialize serial softuart_init(); // enable interrupts sei(); // enable the rc switch rcswitch_enable(PIN_RC); while (1) { // if there is some data waiting for us if (softuart_kbhit()) { // parse the data struct Packet packet; binary_to_packet(&packet, softuart_getchar()); // handle the packet if (packet.status) { rcswitch_switch_on(packet.group + 1, packet.plug + 1); } else { rcswitch_switch_off(packet.group + 1, packet.plug + 1); } } } return 0; }
--- +++ @@ -1,14 +1,11 @@ #include <avr/io.h> -#include <util/delay.h> #include <avr/interrupt.h> -#include "deps/util.h" #include "deps/rcswitch/rcswitch.h" +#include "deps/softuart/softuart.h" +#include "packet.h" #define PIN_RC PB2 - -#include "deps/softuart/softuart.h" -#include "packet.h" int main(void) { // initialize serial
Remove unused includes and move rc pin definition
agpl-3.0
jackwilsdon/lightcontrol,jackwilsdon/lightcontrol
de50503cc4ef90f8e0eaa9786303bcc287284e33
#ifndef __DEBUG_H__ #define __DEBUG_H__ // Not using extern, define your own static dbflags in each file // extern unsigned int dbflags; /* * Bit flags for DEBUG() */ #define DB_IO 0x001 #define DB_TIMER 0x002 #define DB_USER_INPUT 0x004 #define DB_TRAIN_CTRL 0x008 // #define DB_THREADS 0x010 // #define DB_VM 0x020 // #define DB_EXEC 0x040 // #define DB_VFS 0x080 // #define DB_SFS 0x100 // #define DB_NET 0x200 // #define DB_NETFS 0x400 // #define DB_KMALLOC 0x800 #if 0 #define DEBUG(d, fmt, ...) (((dbflags) & (d)) ? plprintf(COM2, fmt, __VA_ARGS__) : 0) #else #define DEBUG(d, fmt, args...) (((dbflags) & (d)) ? plprintf(COM2, fmt, ##args) : 0) #endif #endif // __DEBUG_H__
#ifndef __DEBUG_H__ #define __DEBUG_H__ // Not using extern, define your own static dbflags in each file // extern unsigned int dbflags; /* * Bit flags for DEBUG() */ #define DB_PLIO 0x001 #define DB_TIMER 0x002 #define DB_USER_INPUT 0x004 #define DB_TRAIN_CTRL 0x008 // #define DB_THREADS 0x010 // #define DB_VM 0x020 // #define DB_EXEC 0x040 // #define DB_VFS 0x080 // #define DB_SFS 0x100 // #define DB_NET 0x200 // #define DB_NETFS 0x400 // #define DB_KMALLOC 0x800 #if 0 #define DEBUG(d, fmt, ...) (((dbflags) & (d)) ? plprintf(COM2, fmt, __VA_ARGS__) : 0) #else #define DEBUG(d, fmt, args...) (((dbflags) & (d)) ? plprintf(COM2, fmt, ##args) : 0) #endif #endif // __DEBUG_H__
--- +++ @@ -7,7 +7,7 @@ /* * Bit flags for DEBUG() */ -#define DB_PLIO 0x001 +#define DB_IO 0x001 #define DB_TIMER 0x002 #define DB_USER_INPUT 0x004 #define DB_TRAIN_CTRL 0x008
Rename DB_PLIO to DB_IO, indicate general IO Debugging
mit
gregwym/PollingTrainControlPanel,gregwym/PollingTrainControlPanel,gregwym/PollingTrainControlPanel
f8fec98ebb2a755583d53edf7c6326e55d5264ab
/* * Open Chinese Convert * * Copyright 2010 BYVoid <byvoid1@gmail.com> * * 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 __OPENCC_CONVERT_H_ #define __OPENCC_CONVERT_H_ #include "opencc_utils.h" #define SEGMENT_BUFF_SIZE 1048576 #ifdef __cplusplus extern "C" { #endif wchar_t * words_segmention(wchar_t * dest, const wchar_t * text); wchar_t * simp_to_trad(wchar_t * dest, const wchar_t * text); #ifdef __cplusplus }; #endif #endif /* __OPENCC_CONVERT_H_ */
/* * Open Chinese Convert * * Copyright 2010 BYVoid <byvoid1@gmail.com> * * 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 __OPENCC_CONVERT_H_ #define __OPENCC_CONVERT_H_ #include "opencc_utils.h" #define SEGMENT_BUFF_SIZE 1048576 wchar_t * words_segmention(wchar_t * dest, const wchar_t * text); wchar_t * simp_to_trad(wchar_t * dest, const wchar_t * text); #endif /* __OPENCC_CONVERT_H_ */
--- +++ @@ -23,7 +23,15 @@ #define SEGMENT_BUFF_SIZE 1048576 +#ifdef __cplusplus +extern "C" { +#endif + wchar_t * words_segmention(wchar_t * dest, const wchar_t * text); wchar_t * simp_to_trad(wchar_t * dest, const wchar_t * text); +#ifdef __cplusplus +}; +#endif + #endif /* __OPENCC_CONVERT_H_ */
Check cplusplus in header files.
apache-2.0
BYVoid/OpenCC,capturePointer/OpenCC,wisperwinter/OpenCC,BYVoid/OpenCC,mxgit1090/OpenCC,j717273419/OpenCC,BYVoid/OpenCC,Arthur2e5/OpenCC,xuecai/OpenCC,chongwf/OpenCC,mxgit1090/OpenCC,PeterCxy/OpenCC,capturePointer/OpenCC,chongwf/OpenCC,xuecai/OpenCC,chongwf/OpenCC,BYVoid/OpenCC,capturePointer/OpenCC,Arthur2e5/OpenCC,mxgit1090/OpenCC,wisperwinter/OpenCC,PeterCxy/OpenCC,wisperwinter/OpenCC,xuecai/OpenCC,Arthur2e5/OpenCC,j717273419/OpenCC,BYVoid/OpenCC,jakwings/OpenCC,j717273419/OpenCC,BYVoid/OpenCC,jakwings/OpenCC,jakwings/OpenCC,mxgit1090/OpenCC,PeterCxy/OpenCC
6d58640be1e9d8bf8408864f293b75c1d48da06b
#ifndef _ASM_X86_BUG_H #define _ASM_X86_BUG_H #ifdef CONFIG_BUG #define HAVE_ARCH_BUG #ifdef CONFIG_DEBUG_BUGVERBOSE #ifdef CONFIG_X86_32 # define __BUG_C0 "2:\t.long 1b, %c0\n" #else # define __BUG_C0 "2:\t.long 1b - 2b, %c0 - 2b\n" #endif #define BUG() \ do { \ asm volatile("1:\tud2\n" \ ".pushsection __bug_table,\"a\"\n" \ __BUG_C0 \ "\t.word %c1, 0\n" \ "\t.org 2b+%c2\n" \ ".popsection" \ : : "i" (__FILE__), "i" (__LINE__), \ "i" (sizeof(struct bug_entry))); \ unreachable(); \ } while (0) #else #define BUG() \ do { \ asm volatile("ud2"); \ unreachable(); \ } while (0) #endif #endif /* !CONFIG_BUG */ #include <asm-generic/bug.h> #endif /* _ASM_X86_BUG_H */
#ifndef _ASM_X86_BUG_H #define _ASM_X86_BUG_H #ifdef CONFIG_BUG #define HAVE_ARCH_BUG #ifdef CONFIG_DEBUG_BUGVERBOSE #ifdef CONFIG_X86_32 # define __BUG_C0 "2:\t.long 1b, %c0\n" #else # define __BUG_C0 "2:\t.long 1b - 2b, %c0 - 2b\n" #endif #define BUG() \ do { \ asm volatile("1:\tud2\n" \ ".pushsection __bug_table,\"a\"\n" \ __BUG_C0 \ "\t.word %c1, 0\n" \ "\t.org 2b+%c2\n" \ ".popsection" \ : : "i" (__FILE__), "i" (__LINE__), \ "i" (sizeof(struct bug_entry))); \ for (;;) ; \ } while (0) #else #define BUG() \ do { \ asm volatile("ud2"); \ for (;;) ; \ } while (0) #endif #endif /* !CONFIG_BUG */ #include <asm-generic/bug.h> #endif /* _ASM_X86_BUG_H */
--- +++ @@ -22,14 +22,14 @@ ".popsection" \ : : "i" (__FILE__), "i" (__LINE__), \ "i" (sizeof(struct bug_entry))); \ - for (;;) ; \ + unreachable(); \ } while (0) #else #define BUG() \ do { \ asm volatile("ud2"); \ - for (;;) ; \ + unreachable(); \ } while (0) #endif
x86: Convert BUG() to use unreachable() Use the new unreachable() macro instead of for(;;);. When allyesconfig is built with a GCC-4.5 snapshot on i686 the size of the text segment is reduced by 3987 bytes (from 6827019 to 6823032). Signed-off-by: David Daney <0662de36cfb0706ed279bff52abef14720945acc@caviumnetworks.com> Acked-by: "H. Peter Anvin" <8a453bad9912ffe59bc0f0b8abe03df9be19379e@zytor.com> CC: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de> CC: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@redhat.com> CC: 500d1ad82b2a9e532e251e94d31de3f8a5cf4174@kernel.org Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
a5fc5eba4dfcc284e6adcd7fdcd5b43182230d2b
#ifndef SCC_SYMBOL_HEADER #define SCC_SYMBOL_HEADER #include "syntax.h" typedef struct Symbol { int level; char *name; union { // used in semantic analysis Syntax * declaration; // used in intermediate code generation char *var_name; // used in target code generation int address; }; } Symbol; Symbol * symbol_new(); void symbol_delete(Symbol * symbol); #endif
#ifndef SCC_SYMBOL_HEADER #define SCC_SYMBOL_HEADER #include "syntax.h" typedef struct Symbol { int level; char *name; // used in semantic analysis Syntax * declaration; // used in intermediate code generation char *var_name; } Symbol; Symbol * symbol_new(); void symbol_delete(Symbol * symbol); #endif
--- +++ @@ -8,11 +8,18 @@ int level; char *name; - // used in semantic analysis - Syntax * declaration; + union + { + // used in semantic analysis + Syntax * declaration; - // used in intermediate code generation - char *var_name; + // used in intermediate code generation + char *var_name; + + // used in target code generation + int address; + }; + } Symbol; Symbol * symbol_new();
Add a member for target code generation.
mit
RyanWangGit/scc
03e4a15a06dc49f066d3ead31abec4fb28ac4704
#pragma once // #define private public // for tests #include "common.h" // associations of units #define IVCO VCO #define IVCF VCF #define IVCA VCA #define IEG EG #define ILFO LFO #define ISlewRateLimiter SlewRateLimiter #define IVoice Voice #define ISynthCore SynthCore #include "vco.h" #include "vcf.h" #include "vca.h" #include "eg.h" #include "lfo.h" #include "slew-rate-limiter.h" #include "voice.h" #include "synth-core.h" template <uint8_t T> class Synth { public: INLINE static void initialize() { ISynthCore<0>::initialize(); } INLINE static void receive_midi_byte(uint8_t b) { ISynthCore<0>::receive_midi_byte(b); } INLINE static int8_t clock() { return ISynthCore<0>::clock(); } };
#pragma once // #define private public // for tests #include "common.h" // associations of units #define IVCO VCO #define IVCF VCF #define IVCA VCA #define IEG EG #define ILFO LFO #define ISlewRateLimiter SlewRateLimiter #define IVoice Voice #define ISynthCore SynthCore #include "vco.h" #include "vcf.h" #include "vca.h" #include "eg.h" #include "lfo.h" #include "slew-rate-limiter.h" #include "voice.h" #include "synth-core.h" template <uint8_t T> class Synth { public: INLINE static void initialize() { ISynthCore<0>::initialize(); } INLINE static void receive_midi_byte(uint8_t b) { return ISynthCore<0>::receive_midi_byte(b); } INLINE static int8_t clock() { return ISynthCore<0>::clock(); } };
--- +++ @@ -31,7 +31,7 @@ } INLINE static void receive_midi_byte(uint8_t b) { - return ISynthCore<0>::receive_midi_byte(b); + ISynthCore<0>::receive_midi_byte(b); } INLINE static int8_t clock() {
Fix a type of return value
cc0-1.0
risgk/digital-synth-vra8-m,risgk/digital-synth-vra8-m,risgk/digital-synth-vra8-m,risgk/digital-synth-vra8-m
7f57422d19d088d4bb8d96ed202c27383ae760cb
#ifndef _CECP_FEATURES_H #define _CECP_FEATURES_H #include <stdio.h> /* Features of the Chess Engine Communication Protocol supported by this program */ const char *cecp_features[] = { "done=0", "usermove=1", "time=0", "draw=0", "sigint=0", "analyze=0", "variants=\"normal\"", "colors=0", "name=0", "nps=0", "debug=1", "smp=1", "done=1", 0 }; #endif
#ifndef _CECP_FEATURES_H #define _CECP_FEATURES_H #include <stdio.h> /* Features of the Chess Engine Communication Protocol supported by this program */ const char *cecp_features[] = { "done=0", "usermove=1", "time=0", "draw=0", "sigint=0", "analyze=0", "variants=\"\"", "name=0", "nps=0", "debug=1", "smp=1", "done=1", 0 }; #endif
--- +++ @@ -12,7 +12,8 @@ "draw=0", "sigint=0", "analyze=0", - "variants=\"\"", + "variants=\"normal\"", + "colors=0", "name=0", "nps=0", "debug=1",
Support variant 'normal' and don't expect xboard to send colors
mit
gustafullberg/drosophila,gustafullberg/drosophila,gustafullberg/drosophila
166d113686fd20cd8e0bf6e5b4f2ac92e24765a4
/* * License: BSD-style license * Copyright: Radek Podgorny <radek@podgorny.cz>, * Bernd Schubert <bernd-schubert@gmx.de> */ #ifndef UNIONFS_H #define UNIONFS_H #define PATHLEN_MAX 1024 #define HIDETAG "_HIDDEN~" #define METANAME ".unionfs" #define METADIR (METANAME "/") // string concetanation! // fuse meta files, we might want to hide those #define FUSE_META_FILE ".fuse_hidden" #define FUSE_META_LENGTH 12 // file access protection mask #define S_PROT_MASK (S_ISUID| S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) typedef struct { char *path; int path_len; // strlen(path) int fd; // used to prevent accidental umounts of path unsigned char rw; // the writable flag } branch_entry_t; #endif
/* * License: BSD-style license * Copyright: Radek Podgorny <radek@podgorny.cz>, * Bernd Schubert <bernd-schubert@gmx.de> */ #ifndef UNIONFS_H #define UNIONFS_H #define PATHLEN_MAX 1024 #define HIDETAG "_HIDDEN~" #define METANAME ".unionfs-fuse" #define METADIR (METANAME "/") // string concetanation! // fuse meta files, we might want to hide those #define FUSE_META_FILE ".fuse_hidden" #define FUSE_META_LENGTH 12 // file access protection mask #define S_PROT_MASK (S_ISUID| S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) typedef struct { char *path; int path_len; // strlen(path) int fd; // used to prevent accidental umounts of path unsigned char rw; // the writable flag } branch_entry_t; #endif
--- +++ @@ -10,7 +10,7 @@ #define PATHLEN_MAX 1024 #define HIDETAG "_HIDDEN~" -#define METANAME ".unionfs-fuse" +#define METANAME ".unionfs" #define METADIR (METANAME "/") // string concetanation! // fuse meta files, we might want to hide those
Revert to old pre-1.0 meta directory Unionfs changed its meta directory from .unionfs to .unionfs-fuse with the unionfs -> unionfs-fuse rename. The rename later got reverted everywhere but the meta directory, so now unionfs doesn't find the whiteout files from older releases. Revert back to the pre-1.0 behaviour to fix this. Signed-off-by: Peter Korsgaard <4b8373d016f277527198385ba72fda0feb5da015@korsgaard.com>
bsd-3-clause
evnu/unionfs-fuse,evnu/unionfs-fuse,yogoloth/unionfs-fuse,yogoloth/unionfs-fuse,yogoloth/unionfs-fuse,evnu/unionfs-fuse
93c2f9bd8b058b28016e6db2421e5b38eac0606c
#include <stdio.h> /* print Fahrenheit-Celsius table for fahr = 0, 20, ..., 300 */ // int main(void) // { // float fahr, celsius; // int lower, upper, step; // lower = 0; // lower limit of temperature table // upper = 300; // upper limit // step = 20; // step size // printf("Fahrenheit-Celsius Table\n\n"); // fahr = lower; // while (fahr <= upper) { // celsius = (5.0/9.0) * (fahr-32.0); // printf("%3.0f %6.1f\n", fahr, celsius); // fahr = fahr + step; // } // } int main(void) { for(int fahr = 0; fahr <= 300; fahr = fahr + 20) { printf("%3d %6.1f\n", fahr, (5.0/9.0) * (fahr-32)); } }
#include <stdio.h> /* print Fahrenheit-Celsius table for fahr = 0, 20, ..., 300 */ int main(void) { float fahr, celsius; int lower, upper, step; lower = 0; // lower limit of temperature table upper = 300; // upper limit step = 20; // step size printf("Fahrenheit-Celsius Table\n\n"); fahr = lower; while (fahr <= upper) { celsius = (5.0/9.0) * (fahr-32.0); printf("%3.0f %6.1f\n", fahr, celsius); fahr = fahr + step; } }
--- +++ @@ -4,21 +4,29 @@ for fahr = 0, 20, ..., 300 */ +// int main(void) +// { +// float fahr, celsius; +// int lower, upper, step; + +// lower = 0; // lower limit of temperature table +// upper = 300; // upper limit +// step = 20; // step size + +// printf("Fahrenheit-Celsius Table\n\n"); + +// fahr = lower; +// while (fahr <= upper) { +// celsius = (5.0/9.0) * (fahr-32.0); +// printf("%3.0f %6.1f\n", fahr, celsius); +// fahr = fahr + step; +// } +// } + int main(void) { - float fahr, celsius; - int lower, upper, step; - - lower = 0; // lower limit of temperature table - upper = 300; // upper limit - step = 20; // step size - - printf("Fahrenheit-Celsius Table\n\n"); - - fahr = lower; - while (fahr <= upper) { - celsius = (5.0/9.0) * (fahr-32.0); - printf("%3.0f %6.1f\n", fahr, celsius); - fahr = fahr + step; + for(int fahr = 0; fahr <= 300; fahr = fahr + 20) + { + printf("%3d %6.1f\n", fahr, (5.0/9.0) * (fahr-32)); } }
Implement temperature program with a for loop
mit
Kunal57/C_Problems,Kunal57/C_Problems
4373f87d58c5761ff0a9199741f0d8de4aa2b7a3
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * 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. */ /** * Header file containing strided array type definitions. */ #ifndef STDLIB_STRIDED_TYPEDEFS_H #define STDLIB_STRIDED_TYPEDEFS_H // Note: keep in alphabetical order... #include "strided_binary_typedefs.h" #include "strided_nullary_typedefs.h" #include "strided_quaternary_typedefs.h" #include "strided_quinary_typedefs.h" #include "strided_ternary_typedefs.h" #include "strided_unary_typedefs.h" #endif // !STDLIB_STRIDED_TYPEDEFS_H
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * 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. */ /** * Header file containing strided array type definitions. */ #ifndef STDLIB_STRIDED_TYPEDEFS_H #define STDLIB_STRIDED_TYPEDEFS_H #include "strided_nullary_typedefs.h" #include "strided_unary_typedefs.h" #include "strided_binary_typedefs.h" #include "strided_ternary_typedefs.h" #include "strided_quaternary_typedefs.h" #include "strided_quinary_typedefs.h" #endif // !STDLIB_STRIDED_TYPEDEFS_H
--- +++ @@ -22,11 +22,12 @@ #ifndef STDLIB_STRIDED_TYPEDEFS_H #define STDLIB_STRIDED_TYPEDEFS_H +// Note: keep in alphabetical order... +#include "strided_binary_typedefs.h" #include "strided_nullary_typedefs.h" -#include "strided_unary_typedefs.h" -#include "strided_binary_typedefs.h" -#include "strided_ternary_typedefs.h" #include "strided_quaternary_typedefs.h" #include "strided_quinary_typedefs.h" +#include "strided_ternary_typedefs.h" +#include "strided_unary_typedefs.h" #endif // !STDLIB_STRIDED_TYPEDEFS_H
Sort includes in alphabetical order
apache-2.0
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
02a90edb5163e2f6cc07573812b10a0c35ac9e1a
// RUN: clang-cc -Eonly %s -DOPT_O2 -O2 -verify && #ifdef OPT_O2 #ifndef __OPTIMIZE__ #error "__OPTIMIZE__ not defined" #endif #ifdef __OPTIMIZE_SIZE #error "__OPTIMIZE_SIZE__ defined" #endif #endif // RUN: clang-cc -Eonly %s -DOPT_O0 -O0 -verify && #ifdef OPT_O0 #ifdef __OPTIMIZE__ #error "__OPTIMIZE__ defined" #endif #ifdef __OPTIMIZE_SIZE #error "__OPTIMIZE_SIZE__ defined" #endif #endif // RUN: clang-cc -Eonly %s -DOPT_OS -Os -verify #ifdef OPT_OS #ifndef __OPTIMIZE__ #error "__OPTIMIZE__ not defined" #endif #ifndef __OPTIMIZE_SIZE #error "__OPTIMIZE_SIZE__ not defined" #endif #endif
// RUN: clang-cc -Eonly optimize.c -DOPT_O2 -O2 -verify && #ifdef OPT_O2 #ifndef __OPTIMIZE__ #error "__OPTIMIZE__ not defined" #endif #ifdef __OPTIMIZE_SIZE #error "__OPTIMIZE_SIZE__ defined" #endif #endif // RUN: clang-cc -Eonly optimize.c -DOPT_O0 -O0 -verify && #ifdef OPT_O0 #ifdef __OPTIMIZE__ #error "__OPTIMIZE__ defined" #endif #ifdef __OPTIMIZE_SIZE #error "__OPTIMIZE_SIZE__ defined" #endif #endif // RUN: clang-cc -Eonly optimize.c -DOPT_OS -Os -verify #ifdef OPT_OS #ifndef __OPTIMIZE__ #error "__OPTIMIZE__ not defined" #endif #ifndef __OPTIMIZE_SIZE #error "__OPTIMIZE_SIZE__ not defined" #endif #endif
--- +++ @@ -1,4 +1,4 @@ -// RUN: clang-cc -Eonly optimize.c -DOPT_O2 -O2 -verify && +// RUN: clang-cc -Eonly %s -DOPT_O2 -O2 -verify && #ifdef OPT_O2 #ifndef __OPTIMIZE__ #error "__OPTIMIZE__ not defined" @@ -8,7 +8,7 @@ #endif #endif -// RUN: clang-cc -Eonly optimize.c -DOPT_O0 -O0 -verify && +// RUN: clang-cc -Eonly %s -DOPT_O0 -O0 -verify && #ifdef OPT_O0 #ifdef __OPTIMIZE__ #error "__OPTIMIZE__ defined" @@ -18,7 +18,7 @@ #endif #endif -// RUN: clang-cc -Eonly optimize.c -DOPT_OS -Os -verify +// RUN: clang-cc -Eonly %s -DOPT_OS -Os -verify #ifdef OPT_OS #ifndef __OPTIMIZE__ #error "__OPTIMIZE__ not defined"
Use %s in test, not hard coded name. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@68521 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang
82fc0cb7883747942326d6d6ca1333b27bd647f0
/*! * @brief Template C++-header file * * This is a template C++-header file * @author <+AUTHOR+> * @date <+DATE+> * @file <+FILE+> * @version 0.1 */ #ifndef <+FILE_CAPITAL+>_H #define <+FILE_CAPITAL+>_H #include <iostream> /*! * @brief Template class */ class <+FILE_PASCAL+> { private: public: <+FILEBASE+>() { <+CURSOR+> } template<typename CharT, typename Traits> friend std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os, const CoutTest& this_); template<typename CharT, typename Traits> friend std::basic_istream<CharT, Traits>& operator>>(std::basic_istream<CharT, Traits>& is, CoutTest& this_); }; // class <+FILE_PASCAL+> template<typename CharT, typename Traits> std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os, const CoutTest& this_) { return os; } template<typename CharT, typename Traits> std::basic_istream<CharT, Traits>& operator>>(std::basic_istream<CharT, Traits>& is, CoutTest& this_) { return is; } #endif // <+FILE_CAPITAL+>_H
/*! * @brief Template C++-header file * * This is a template C++-header file * @author <+AUTHOR+> * @date <+DATE+> * @file <+FILE+> * @version 0.1 */ #ifndef <+FILE_CAPITAL+>_H #define <+FILE_CAPITAL+>_H /*! * @brief Template class */ class <+FILEBASE+> { private: public: <+FILEBASE+>() { <+CURSOR+> } }; // class <+FILEBASE+> #endif // <+FILE_CAPITAL+>_H
--- +++ @@ -10,18 +10,46 @@ #ifndef <+FILE_CAPITAL+>_H #define <+FILE_CAPITAL+>_H +#include <iostream> + /*! * @brief Template class */ -class <+FILEBASE+> +class <+FILE_PASCAL+> { private: public: <+FILEBASE+>() { <+CURSOR+> } -}; // class <+FILEBASE+> + + template<typename CharT, typename Traits> + friend std::basic_ostream<CharT, Traits>& + operator<<(std::basic_ostream<CharT, Traits>& os, const CoutTest& this_); + + template<typename CharT, typename Traits> + friend std::basic_istream<CharT, Traits>& + operator>>(std::basic_istream<CharT, Traits>& is, CoutTest& this_); +}; // class <+FILE_PASCAL+> + + +template<typename CharT, typename Traits> +std::basic_ostream<CharT, Traits>& +operator<<(std::basic_ostream<CharT, Traits>& os, const CoutTest& this_) +{ + + return os; +} + + +template<typename CharT, typename Traits> +std::basic_istream<CharT, Traits>& +operator>>(std::basic_istream<CharT, Traits>& is, CoutTest& this_) +{ + + return is; +} #endif // <+FILE_CAPITAL+>_H
Enable to treat with std::cout and std::cin
mit
koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate,koturn/kotemplate
425aa9921544bd60bd26f2429a41deb2e156bd34
#ifndef PYLOGGER_H #define PYLOGGER_H #include "Python.h" #include <string> #include "cantera/base/logger.h" namespace Cantera { /// Logger for Python. /// @ingroup textlogs class Py_Logger : public Logger { public: Py_Logger() { PyRun_SimpleString("import sys"); } virtual ~Py_Logger() {} virtual void write(const std::string& s) { std::string ss = "sys.stdout.write(\"\"\""; ss += s; ss += "\"\"\")"; PyRun_SimpleString(ss.c_str()); PyRun_SimpleString("sys.stdout.flush()"); } virtual void error(const std::string& msg) { std::string err = "raise Exception(\"\"\""+msg+"\"\"\")"; PyRun_SimpleString(err.c_str()); } }; } #endif
#ifndef PYLOGGER_H #define PYLOGGER_H #include "Python.h" #include <string> #include "cantera/base/logger.h" namespace Cantera { /// Logger for Python. /// @ingroup textlogs class Py_Logger : public Logger { public: Py_Logger() { PyRun_SimpleString("import sys"); } virtual ~Py_Logger() {} virtual void write(const std::string& s) { std::string ss = "sys.stdout.write(\"\"\""; ss += s; ss += "\"\"\")"; PyRun_SimpleString(ss.c_str()); PyRun_SimpleString("sys.stdout.flush()"); } virtual void error(const std::string& msg) { std::string err = "raise \""+msg+"\""; PyRun_SimpleString((char*)err.c_str()); } }; } #endif
--- +++ @@ -27,8 +27,8 @@ } virtual void error(const std::string& msg) { - std::string err = "raise \""+msg+"\""; - PyRun_SimpleString((char*)err.c_str()); + std::string err = "raise Exception(\"\"\""+msg+"\"\"\")"; + PyRun_SimpleString(err.c_str()); } }; }
Fix Py_Logger to raise instances of Exception instead of strings Raising string exceptions was removed in Python 2.6
bsd-3-clause
imitrichev/cantera,Heathckliff/cantera,Heathckliff/cantera,imitrichev/cantera,imitrichev/cantera,imitrichev/cantera,imitrichev/cantera,Heathckliff/cantera,imitrichev/cantera,Heathckliff/cantera,Heathckliff/cantera,Heathckliff/cantera
0da6fb4d36a340b36f6153c66bcd432982abf1dd
#include <stdio.h> #include <assert.h> #include "api.h" #include "lib/math.c" #include "lib/test.c" static jack_state_t* state; static intptr_t jack_fib(intptr_t n) { jack_new_integer(state, n); jack_function_call(state, 1, 1); return jack_get_integer(state, -1); } int main() { state = jack_new_state(20); jack_call(state, jack_math, 0); jack_map_get_symbol(state, -1, "fib"); jack_new_list(state); // 1 - fib // 2 - list for (int j = 0; j < 0x10000; ++j) { printf("Generation %d\n", j); for (intptr_t i = 0; i <= 91; ++i) { jack_fib(i); // printf("fib(%ld) = %ld\n", i, jack_fib(i)); jack_pop(state); // jack_list_push(state, 2); } } jack_dump_state(state); jack_free_state(state); return 0; }
#include <stdio.h> #include <assert.h> #include "api.h" #include "lib/math.c" #include "lib/test.c" static jack_state_t* state; static intptr_t jack_fib(intptr_t n) { jack_new_integer(state, n); jack_function_call(state, 1, 1); return jack_get_integer(state, -1); } int main() { for (int j = 0; j < 0x1; ++j) { state = jack_new_state(15); jack_call(state, jack_math, 0); jack_map_get_symbol(state, -1, "fib"); jack_new_list(state); // 1 - fib // 2 - list for (intptr_t i = 0; i <= 91; ++i) { printf("fib(%ld) = %ld\n", i, jack_fib(i)); jack_list_push(state, 2); } jack_dump_state(state); jack_free_state(state); } return 0; }
--- +++ @@ -14,22 +14,25 @@ } int main() { - for (int j = 0; j < 0x1; ++j) { + state = jack_new_state(20); + jack_call(state, jack_math, 0); + jack_map_get_symbol(state, -1, "fib"); + jack_new_list(state); + // 1 - fib + // 2 - list - state = jack_new_state(15); - jack_call(state, jack_math, 0); - jack_map_get_symbol(state, -1, "fib"); - jack_new_list(state); - // 1 - fib - // 2 - list + for (int j = 0; j < 0x10000; ++j) { + printf("Generation %d\n", j); for (intptr_t i = 0; i <= 91; ++i) { - printf("fib(%ld) = %ld\n", i, jack_fib(i)); - jack_list_push(state, 2); + jack_fib(i); + // printf("fib(%ld) = %ld\n", i, jack_fib(i)); + jack_pop(state); + // jack_list_push(state, 2); } - jack_dump_state(state); - jack_free_state(state); } + jack_dump_state(state); + jack_free_state(state); return 0; }
Tweak for benchmark. fib(0-91) 1987925/second
mit
creationix/jack-lang,creationix/jack-lang
637d0f278459aa1130ab96c063fcaf0611507e47
#include "queue.h" struct Queue { size_t head; size_t tail; size_t size; void** e; }; Queue* Queue_Create(size_t n) { Queue* q = (Queue *)malloc(sizeof(Queue)); q->size = n; q->head = q->tail = 1; q->e = (void **)malloc(sizeof(void*) * (n + 1)); return q; } int Queue_Empty(Queue* q) { return (q->head == q->tail); } int Queue_Full(Queue* q) { return (q->head == q->tail + 1) || (q->head == 1 && q->tail == q->size); }
#include "queue.h" struct Queue { size_t head; size_t tail; size_t size; void** e; }; Queue* Queue_Create(size_t n) { Queue* q = (Queue *)malloc(sizeof(Queue)); q->size = n; q->head = q->tail = 1; q->e = (void **)malloc(sizeof(void*) * (n + 1)); return q; } int Queue_Empty(Queue* q) { return (q->head == q->tail); }
--- +++ @@ -21,3 +21,8 @@ { return (q->head == q->tail); } + +int Queue_Full(Queue* q) +{ + return (q->head == q->tail + 1) || (q->head == 1 && q->tail == q->size); +}
Add helper function Queue Full implementation
mit
MaxLikelihood/CADT
dbd9075781f1f83ec53841c162ea027902c3742a
#ifndef __EXGL_H__ #define __EXGL_H__ #ifdef __ANDROID__ #include <GLES2/gl2.h> #endif #ifdef __APPLE__ #include <OpenGLES/ES2/gl.h> #endif #include <JavaScriptCore/JSBase.h> #ifdef __cplusplus extern "C" { #endif // Identifies an EXGL context. No EXGL context has the id 0, so that can be // used as a 'null' value. typedef unsigned int EXGLContextId; // [JS thread] Create an EXGL context and return its id number. Saves the // JavaScript interface object (has a WebGLRenderingContext-style API) at // `global.__EXGLContexts[id]` in JavaScript. EXGLContextId EXGLContextCreate(JSGlobalContextRef jsCtx); // [Any thread] Release the resources for an EXGL context. The same id is never // reused. void EXGLContextDestroy(EXGLContextId exglCtxId); // [GL thread] Perform one frame's worth of queued up GL work void EXGLContextFlush(EXGLContextId exglCtxId); // [GL thread] Set the default framebuffer (used when binding 0). Allows using // platform-specific extensions on the default framebuffer, such as MSAA. void EXGLContextSetDefaultFramebuffer(EXGLContextId exglCtxId, GLint framebuffer); #ifdef __cplusplus } #endif #endif
#ifndef __EXGL_H__ #define __EXGL_H__ #include <OpenGLES/ES2/gl.h> #include <JavaScriptCore/JSBase.h> #ifdef __cplusplus extern "C" { #endif // Identifies an EXGL context. No EXGL context has the id 0, so that can be // used as a 'null' value. typedef unsigned int EXGLContextId; // [JS thread] Create an EXGL context and return its id number. Saves the // JavaScript interface object (has a WebGLRenderingContext-style API) at // `global.__EXGLContexts[id]` in JavaScript. EXGLContextId EXGLContextCreate(JSGlobalContextRef jsCtx); // [Any thread] Release the resources for an EXGL context. The same id is never // reused. void EXGLContextDestroy(EXGLContextId exglCtxId); // [GL thread] Perform one frame's worth of queued up GL work void EXGLContextFlush(EXGLContextId exglCtxId); // [GL thread] Set the default framebuffer (used when binding 0). Allows using // platform-specific extensions on the default framebuffer, such as MSAA. void EXGLContextSetDefaultFramebuffer(EXGLContextId exglCtxId, GLint framebuffer); #ifdef __cplusplus } #endif #endif
--- +++ @@ -2,7 +2,13 @@ #define __EXGL_H__ +#ifdef __ANDROID__ +#include <GLES2/gl2.h> +#endif +#ifdef __APPLE__ #include <OpenGLES/ES2/gl.h> +#endif + #include <JavaScriptCore/JSBase.h>
Fix Android vs. iOS GL header include fbshipit-source-id: 75ec20a
bsd-3-clause
jolicloud/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,jolicloud/exponent,exponent/exponent,jolicloud/exponent,exponentjs/exponent,jolicloud/exponent,exponent/exponent,jolicloud/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,jolicloud/exponent,jolicloud/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponentjs/exponent,jolicloud/exponent,exponent/exponent,jolicloud/exponent,exponentjs/exponent
f333a38b65f9d357ab6c2fc73fd014f8e266657f
/** @file Header file that supports Framework extension to UEFI/PI for DXE modules. This header file must include Framework extension definitions common to DXE modules. Copyright (c) 2007-2009, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _FRAMEWORK_DXE_H_ #define _FRAMEWORK_DXE_H_ #include <FrameworkPei.h> #include <Framework/DxeCis.h> #include <Framework/FrameworkInternalFormRepresentation.h> #endif
/** @file Header file that supports Framework extension to UEFI/PI for DXE modules. This header file must include Framework extension definitions common to DXE modules. Copyright (c) 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: FrameworkDxe.h **/ #ifndef _FRAMEWORK_DXE_H_ #define _FRAMEWORK_DXE_H_ #include <FrameworkPei.h> #include <Framework/DxeCis.h> #include <Framework/FrameworkInternalFormRepresentation.h> #endif
--- +++ @@ -4,7 +4,7 @@ This header file must include Framework extension definitions common to DXE modules. - Copyright (c) 2007, Intel Corporation + Copyright (c) 2007-2009, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -12,9 +12,6 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - Module Name: FrameworkDxe.h - **/ #ifndef _FRAMEWORK_DXE_H_
Update Copyright. Delete erroneous "Module Name" line. git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@8673 6f19259b-4bc3-4df7-8a09-765794883524
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
5ba364466dabf4e4d8809218197b5bd0761db881
#include <Elementary.h> #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif EAPI int elm_modapi_init(void *m __UNUSED__) { return 1; // succeed always } EAPI int elm_modapi_shutdown(void *m __UNUSED__) { return 1; // succeed always } EAPI Eina_Bool obj_hook(Evas_Object *obj __UNUSED__) { return EINA_TRUE; } EAPI Eina_Bool obj_unhook(Evas_Object *obj __UNUSED__) { return EINA_TRUE; } EAPI Eina_Bool obj_convert_geo_into_coord(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, double lon __UNUSED__, double lat __UNUSED__, int size __UNUSED__, int *x __UNUSED__, int *y __UNUSED__) { return EINA_FALSE; } EAPI Eina_Bool obj_convert_coord_into_geo(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, int x __UNUSED__, int y __UNUSED__, int size __UNUSED__, double *lon __UNUSED__, double *lat __UNUSED__) { return EINA_FALSE; } EAPI char* obj_url_request(Evas_Object *obj __UNUSED__, int x, int y, int zoom) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png", zoom, x, y); return strdup(buf); }
#include <Elementary.h> #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif EAPI int elm_modapi_init(void *m) { return 1; // succeed always } EAPI int elm_modapi_shutdown(void *m) { return 1; // succeed always } EAPI Eina_Bool obj_hook(Evas_Object *obj) { return EINA_TRUE; } EAPI Eina_Bool obj_unhook(Evas_Object *obj) { return EINA_TRUE; } EAPI Eina_Bool obj_convert_geo_into_coord(const Evas_Object *obj, int zoom, double lon, double lat, int size, int *x, int *y) { return EINA_FALSE; } EAPI Eina_Bool obj_convert_coord_into_geo(const Evas_Object *obj, int zoom, int x, int y, int size, double *lon, double *lat) { return EINA_FALSE; } EAPI char* obj_url_request(Evas_Object *obj, int x, int y, int zoom) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png", zoom, x, y); return strdup(buf); }
--- +++ @@ -4,43 +4,43 @@ #endif EAPI int -elm_modapi_init(void *m) +elm_modapi_init(void *m __UNUSED__) { return 1; // succeed always } EAPI int -elm_modapi_shutdown(void *m) +elm_modapi_shutdown(void *m __UNUSED__) { return 1; // succeed always } EAPI Eina_Bool -obj_hook(Evas_Object *obj) +obj_hook(Evas_Object *obj __UNUSED__) { return EINA_TRUE; } EAPI Eina_Bool -obj_unhook(Evas_Object *obj) +obj_unhook(Evas_Object *obj __UNUSED__) { return EINA_TRUE; } EAPI Eina_Bool -obj_convert_geo_into_coord(const Evas_Object *obj, int zoom, double lon, double lat, int size, int *x, int *y) +obj_convert_geo_into_coord(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, double lon __UNUSED__, double lat __UNUSED__, int size __UNUSED__, int *x __UNUSED__, int *y __UNUSED__) { return EINA_FALSE; } EAPI Eina_Bool -obj_convert_coord_into_geo(const Evas_Object *obj, int zoom, int x, int y, int size, double *lon, double *lat) +obj_convert_coord_into_geo(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, int x __UNUSED__, int y __UNUSED__, int size __UNUSED__, double *lon __UNUSED__, double *lat __UNUSED__) { return EINA_FALSE; } EAPI char* -obj_url_request(Evas_Object *obj, int x, int y, int zoom) +obj_url_request(Evas_Object *obj __UNUSED__, int x, int y, int zoom) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png",
Add UNUSED so we get a clean compile. SVN revision: 55786
lgpl-2.1
rvandegrift/elementary,FlorentRevest/Elementary,tasn/elementary,tasn/elementary,tasn/elementary,FlorentRevest/Elementary,tasn/elementary,rvandegrift/elementary,tasn/elementary,FlorentRevest/Elementary,rvandegrift/elementary,FlorentRevest/Elementary,rvandegrift/elementary
79c31c97a5c0c1b061f18fec06d6b969d267c766
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(NICTA_GPL) */ #ifndef ETHIF_INTEL_H #define ETHIF_INTEL_H #include <platsupport/io.h> /** * This function initialises the hardware * @param[in] io_ops A structure containing os specific data and * functions. * @param[in] bar0 Where pci bar0 has been mapped into our vspace * @return A reference to the ethernet drivers state. */ struct eth_driver* ethif_e82580_init(ps_io_ops_t io_ops, void *bar0); /** * This function initialises the hardware * @param[in] io_ops A structure containing os specific data and * functions. * @param[in] bar0 Where pci bar0 has been mapped into our vspace * @return A reference to the ethernet drivers state. */ struct eth_driver* ethif_e82574_init(ps_io_ops_t io_ops, void *bar0); #endif
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(NICTA_GPL) */ #include <platsupport/io.h> /** * This function initialises the hardware * @param[in] io_ops A structure containing os specific data and * functions. * @param[in] bar0 Where pci bar0 has been mapped into our vspace * @return A reference to the ethernet drivers state. */ struct eth_driver* ethif_e82580_init(ps_io_ops_t io_ops, void *bar0); /** * This function initialises the hardware * @param[in] io_ops A structure containing os specific data and * functions. * @param[in] bar0 Where pci bar0 has been mapped into our vspace * @return A reference to the ethernet drivers state. */ struct eth_driver* ethif_e82574_init(ps_io_ops_t io_ops, void *bar0);
--- +++ @@ -7,6 +7,9 @@ * * @TAG(NICTA_GPL) */ + +#ifndef ETHIF_INTEL_H +#define ETHIF_INTEL_H #include <platsupport/io.h> @@ -29,3 +32,5 @@ */ struct eth_driver* ethif_e82574_init(ps_io_ops_t io_ops, void *bar0); + +#endif
Add missing header file guards
bsd-2-clause
agacek/util_libs,agacek/util_libs,agacek/util_libs,agacek/util_libs
918002b7cc42d465dc80d2313e31d8fbfeef3712
/* Copyright (c) 2004 Timo Sirainen */ #include "lib.h" #include "str.h" #include "str-sanitize.h" void str_sanitize_append(string_t *dest, const char *src, size_t max_len) { const char *p; for (p = src; *p != '\0'; p++) { if (((unsigned char)*p & 0x7f) < 32) break; } str_append_n(dest, src, (size_t)(p - src)); for (; *p != '\0' && max_len > 0; p++, max_len--) { if (((unsigned char)*p & 0x7f) < 32) str_append_c(dest, '?'); else str_append_c(dest, *p); } if (*p != '\0') { str_truncate(dest, str_len(dest)-3); str_append(dest, "..."); } } const char *str_sanitize(const char *src, size_t max_len) { string_t *str; str = t_str_new(I_MIN(max_len, 256)); str_sanitize_append(str, src, max_len); return str_c(str); }
/* Copyright (c) 2004 Timo Sirainen */ #include "lib.h" #include "str.h" #include "str-sanitize.h" void str_sanitize_append(string_t *dest, const char *src, size_t max_len) { const char *p; for (p = src; *p != '\0'; p++) { if ((unsigned char)*p < 32) break; } str_append_n(dest, src, (size_t)(p - src)); for (; *p != '\0' && max_len > 0; p++, max_len--) { if ((unsigned char)*p < 32) str_append_c(dest, '?'); else str_append_c(dest, *p); } if (*p != '\0') { str_truncate(dest, str_len(dest)-3); str_append(dest, "..."); } } const char *str_sanitize(const char *src, size_t max_len) { string_t *str; str = t_str_new(I_MIN(max_len, 256)); str_sanitize_append(str, src, max_len); return str_c(str); }
--- +++ @@ -9,13 +9,13 @@ const char *p; for (p = src; *p != '\0'; p++) { - if ((unsigned char)*p < 32) + if (((unsigned char)*p & 0x7f) < 32) break; } str_append_n(dest, src, (size_t)(p - src)); for (; *p != '\0' && max_len > 0; p++, max_len--) { - if ((unsigned char)*p < 32) + if (((unsigned char)*p & 0x7f) < 32) str_append_c(dest, '?'); else str_append_c(dest, *p);
Convert also 0x80..0x9f characters to '?' --HG-- branch : HEAD
mit
dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot,dscho/dovecot
605cce4a8b87c2e92fcdd047383997ab1df0178d
#define CGLTF_IMPLEMENTATION #include "../cgltf.h" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { cgltf_options options = {0}; cgltf_data* data = NULL; cgltf_result res = cgltf_parse(&options, Data, Size, &data); if (res == cgltf_result_success) { cgltf_validate(data); cgltf_free(data); } return 0; }
#define CGLTF_IMPLEMENTATION #include "../cgltf.h" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { cgltf_options options = {0}; cgltf_data* data = NULL; cgltf_result res = cgltf_parse(&options, Data, Size, &data); if (res == cgltf_result_success) cgltf_free(data); return 0; }
--- +++ @@ -6,6 +6,10 @@ cgltf_options options = {0}; cgltf_data* data = NULL; cgltf_result res = cgltf_parse(&options, Data, Size, &data); - if (res == cgltf_result_success) cgltf_free(data); + if (res == cgltf_result_success) + { + cgltf_validate(data); + cgltf_free(data); + } return 0; }
Add validation to fuzz target This make sure new validation code is robust by itself.
mit
jkuhlmann/cgltf,jkuhlmann/cgltf,jkuhlmann/cgltf
b743e26e288da913ce62e96f74f73079c2f37299
/* * A solution to Exercise 1-2 in The C Programming Language (Second Edition). * * This file was written by Damien Dart, <damiendart@pobox.com>. This is free * and unencumbered software released into the public domain. For more * information, please refer to the accompanying "UNLICENCE" file. */ #include <stdio.h> #include <stdlib.h> int main(void) { puts("An audible or visual alert: \a"); puts("A form feed: \f"); puts("A carriage return: \r"); puts("A vertical tab: \v"); return EXIT_SUCCESS; }
/* * A solution to Exercise 1-2 in The C Programming Language (Second Edition). * * This file was written by Damien Dart, <damiendart@pobox.com>. This is free * and unencumbered software released into the public domain. For more * information, please refer to the accompanying "UNLICENCE" file. */ #include <stdio.h> #include <stdlib.h> int main(void) { puts("\\a produces an audible or visual alert: \a"); puts("\\f produces a formfeed: \f"); puts("\\r produces a carriage return: \rlololol"); puts("\\v produces a vertical tab: \t"); return EXIT_SUCCESS; }
--- +++ @@ -11,9 +11,9 @@ int main(void) { - puts("\\a produces an audible or visual alert: \a"); - puts("\\f produces a formfeed: \f"); - puts("\\r produces a carriage return: \rlololol"); - puts("\\v produces a vertical tab: \t"); + puts("An audible or visual alert: \a"); + puts("A form feed: \f"); + puts("A carriage return: \r"); + puts("A vertical tab: \v"); return EXIT_SUCCESS; }
Fix solution to Exercise 1-2.
unlicense
damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions
289440851590e50387cf1a121abad63c704b84ab
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "visitor.h" #include <vespa/vdslib/container/searchresult.h> namespace documentapi { class SearchResultMessage : public VisitorMessage, public vdslib::SearchResult { protected: DocumentReply::UP doCreateReply() const override; public: /** * Convenience typedefs. */ typedef std::unique_ptr<SearchResultMessage> UP; typedef std::shared_ptr<SearchResultMessage> SP; /** * Constructs a new search result message for deserialization. */ SearchResultMessage(); /** * Constructs a new search result message for the given search result. * * @param result The result to set. */ SearchResultMessage(const vdslib::SearchResult &result); uint32_t getApproxSize() const override; uint32_t getType() const override; string toString() const override { return "searchresultmessage"; } }; }
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/vdslib/container/searchresult.h> #include <vespa/documentapi/messagebus/messages/visitor.h> namespace documentapi { class SearchResultMessage : public VisitorMessage, public vdslib::SearchResult { protected: // Implements VisitorMessage. DocumentReply::UP doCreateReply() const; public: /** * Convenience typedefs. */ typedef std::unique_ptr<SearchResultMessage> UP; typedef std::shared_ptr<SearchResultMessage> SP; /** * Constructs a new search result message for deserialization. */ SearchResultMessage(); /** * Constructs a new search result message for the given search result. * * @param result The result to set. */ SearchResultMessage(const vdslib::SearchResult &result); // Overrides VisitorMessage. uint32_t getApproxSize() const; // Implements VisitorMessage. uint32_t getType() const; string toString() const { return "searchresultmessage"; } }; }
--- +++ @@ -1,16 +1,15 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once +#include "visitor.h" #include <vespa/vdslib/container/searchresult.h> -#include <vespa/documentapi/messagebus/messages/visitor.h> namespace documentapi { class SearchResultMessage : public VisitorMessage, public vdslib::SearchResult { protected: - // Implements VisitorMessage. - DocumentReply::UP doCreateReply() const; + DocumentReply::UP doCreateReply() const override; public: /** @@ -31,13 +30,9 @@ */ SearchResultMessage(const vdslib::SearchResult &result); - // Overrides VisitorMessage. - uint32_t getApproxSize() const; - - // Implements VisitorMessage. - uint32_t getType() const; - - string toString() const { return "searchresultmessage"; } + uint32_t getApproxSize() const override; + uint32_t getType() const override; + string toString() const override { return "searchresultmessage"; } }; }
Add the overrides and you are backin business.
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
98330bd7030626759102845a0467ed2c71f26c30
#ifndef RWTE_COORDS_H #define RWTE_COORDS_H struct Cell { int row = 0; int col = 0; inline bool operator==(const Cell& other) const { return row == other.row && col == other.col; } inline bool operator!=(const Cell& other) const { return row != other.row || col != other.col; } inline bool operator< (const Cell& other) const { return row < other.row || col < other.col; } inline bool operator> (const Cell& other) const { return row > other.row || col > other.col; } inline bool operator<=(const Cell& other) const { return row < other.row || col < other.col || (row == other.row && col == other.col); } inline bool operator>=(const Cell& other) const { return row > other.row || col > other.col || (row == other.row && col == other.col); } }; #endif // RWTE_COORDS_H
#ifndef RWTE_COORDS_H #define RWTE_COORDS_H struct Cell { int row, col; inline bool operator==(const Cell& other) const { return row == other.row && col == other.col; } inline bool operator!=(const Cell& other) const { return row != other.row || col != other.col; } inline bool operator< (const Cell& other) const { return row < other.row || col < other.col; } inline bool operator> (const Cell& other) const { return row > other.row || col > other.col; } inline bool operator<=(const Cell& other) const { return row < other.row || col < other.col || (row == other.row && col == other.col); } inline bool operator>=(const Cell& other) const { return row > other.row || col > other.col || (row == other.row && col == other.col); } }; #endif // RWTE_COORDS_H
--- +++ @@ -3,7 +3,8 @@ struct Cell { - int row, col; + int row = 0; + int col = 0; inline bool operator==(const Cell& other) const {
Set default values for Cell members.
mit
drcforbin/rwte,drcforbin/rwte,drcforbin/rwte,drcforbin/rwte
6c93a693f3e0e4a2979fa8677278d181c5e3edb2
// RUN: %ucc -Xprint %s 2>/dev/null | grep 'typeof' | %output_check -w "/typeof\(int \*\) ip.*/" "/typeof\(int \*\) \*a1.*/" "/typeof\(int \*\) a2\[2\].*/" "/typeof\(int \*\) a3\(\).*/" "typeof(expr: identifier) (aka 'long *') abc()" "typeof(expr: identifier) (aka 'long *') xyz()" long *x; __typeof(int *) ip; __typeof(int *) *a1; __typeof(int *) a2[2]; __typeof(int *) a3(); auto abc() -> __typeof(x) { } __typeof(x) xyz() { }
// RUN: %ucc -Xprint %s 2>/dev/null | grep 'typeof' | %output_check -w "/typeof\(int \*\) ip.*/" "/typeof\(int \*\) \*a1.*/" "/typeof\(int \*\) a2\[2\].*/" "/typeof\(int \*\) a3\(\).*/" "typeof(expr: identifier) (aka 'long *') xyz()" long *x; __typeof(int *) ip; __typeof(int *) *a1; __typeof(int *) a2[2]; __typeof(int *) a3(); __typeof(x) xyz() { }
--- +++ @@ -1,4 +1,4 @@ -// RUN: %ucc -Xprint %s 2>/dev/null | grep 'typeof' | %output_check -w "/typeof\(int \*\) ip.*/" "/typeof\(int \*\) \*a1.*/" "/typeof\(int \*\) a2\[2\].*/" "/typeof\(int \*\) a3\(\).*/" "typeof(expr: identifier) (aka 'long *') xyz()" +// RUN: %ucc -Xprint %s 2>/dev/null | grep 'typeof' | %output_check -w "/typeof\(int \*\) ip.*/" "/typeof\(int \*\) \*a1.*/" "/typeof\(int \*\) a2\[2\].*/" "/typeof\(int \*\) a3\(\).*/" "typeof(expr: identifier) (aka 'long *') abc()" "typeof(expr: identifier) (aka 'long *') xyz()" long *x; @@ -8,6 +8,10 @@ __typeof(int *) a2[2]; __typeof(int *) a3(); +auto abc() -> __typeof(x) +{ +} + __typeof(x) xyz() { }
Add trailing return type to type printing test
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
78d48b4a6c7f49ee07ff9bced8df6f7379c13d6f
#ifndef SPIRALLINESGLWIDGET_H #define SPIRALLINESGLWIDGET_H #include "GLWidget.h" #include <cmath> class SpiralLinesGLWidget : public GLWidget { public: SpiralLinesGLWidget(QWidget* parent = 0); protected: void initializeGL(); void render(); }; SpiralLinesGLWidget::SpiralLinesGLWidget(QWidget* parent) : GLWidget(parent) {} void SpiralLinesGLWidget::initializeGL() { GLWidget::initializeGL(); setXRotation(-45); setYRotation(15); setZRotation(45); } void SpiralLinesGLWidget::render() { // How many revolutions of the spiral are rendered. static const float REVOLUTIONS = 10; static const float PI = 3.14159; // How many vertices per revolution. static const float SLICES = 10; glBegin(GL_LINE_STRIP); for (int i = 0; i <= REVOLUTIONS * SLICES; i++) { const float angle = i * 2 * PI / SLICES; glVertex2f( angle * (float) sin(angle), angle * (float) cos(angle)); } glEnd(); } #endif // SPIRALLINESGLWIDGET_H
#ifndef SPIRALLINESGLWIDGET_H #define SPIRALLINESGLWIDGET_H #include "GLWidget.h" #include <cmath> class SpiralLinesGLWidget : public GLWidget { public: SpiralLinesGLWidget(QWidget* parent = 0); protected: void initializeGL(); void render(); }; SpiralLinesGLWidget::SpiralLinesGLWidget(QWidget* parent) : GLWidget(parent) {} void SpiralLinesGLWidget::initializeGL() { GLWidget::initializeGL(); setXRotation(-45); setYRotation(15); setZRotation(45); } void SpiralLinesGLWidget::render() { // How many revolutions of the spiral are rendered. static const float REVOLUTIONS = 10; static const float PI = 3.14159; glBegin(GL_LINE_STRIP); for (float angle = 0; angle < 2*PI*REVOLUTIONS; angle += PI / (2 * REVOLUTIONS * 10)) { glVertex2f( angle * (float) sin(angle), angle * (float) cos(angle)); } glEnd(); } #endif // SPIRALLINESGLWIDGET_H
--- +++ @@ -29,8 +29,12 @@ static const float REVOLUTIONS = 10; static const float PI = 3.14159; + // How many vertices per revolution. + static const float SLICES = 10; + glBegin(GL_LINE_STRIP); - for (float angle = 0; angle < 2*PI*REVOLUTIONS; angle += PI / (2 * REVOLUTIONS * 10)) { + for (int i = 0; i <= REVOLUTIONS * SLICES; i++) { + const float angle = i * 2 * PI / SLICES; glVertex2f( angle * (float) sin(angle), angle * (float) cos(angle));
Use integers instead of floats in for-loop While this adds a few more lines to the program, I think it makes it more explicit where the constants come from. It also faciliates easier modification of the example. It's also safer to use an integer instead of a float as a conditional in a for-loop. This is because floating point values are imprecise. As a result, you may end up with one more or one fewer iteration than you anticipated. Integers don't have this disadvantage.
mit
dafrito/alpha,dafrito/alpha,dafrito/alpha
3f27d22593d0d595bc4e9695d122fa16051d8990
#include <libterm_internal.h> void term_update(term_t_i *term) { if( term->dirty.exists && term->update != NULL ) { term->update(TO_H(term), term->dirty.x, term->dirty.y - (term->grid.history - term->grid.height), term->dirty.width, term->dirty.height); term->dirty.exists = false; } } void term_cursor_update(term_t_i *term) { if( term->dirty_cursor.exists && term->cursor_update != NULL ) { term->cursor_update(TO_H(term), term->dirty_cursor.old_ccol, term->dirty_cursor.old_crow - (term->grid.history - term->grid.height), term->ccol, term->crow - (term->grid.history - term->grid.height)); term->dirty_cursor.exists = false; term->dirty_cursor.old_ccol = term->ccol; term->dirty_cursor.old_crow = term->crow; } }
#include <libterm_internal.h> void term_update(term_t_i *term) { if( term->dirty.exists && term->update != NULL ) { term->update(TO_H(term), term->dirty.x, term->dirty.y, term->dirty.width, term->dirty.height); term->dirty.exists = false; } } void term_cursor_update(term_t_i *term) { if( term->dirty_cursor.exists && term->cursor_update != NULL ) { term->cursor_update(TO_H(term), term->dirty_cursor.old_ccol, term->dirty_cursor.old_crow - (term->grid.history - term->grid.height), term->ccol, term->crow - (term->grid.history - term->grid.height)); term->dirty_cursor.exists = false; term->dirty_cursor.old_ccol = term->ccol; term->dirty_cursor.old_crow = term->crow; } }
--- +++ @@ -3,7 +3,7 @@ void term_update(term_t_i *term) { if( term->dirty.exists && term->update != NULL ) { - term->update(TO_H(term), term->dirty.x, term->dirty.y, term->dirty.width, term->dirty.height); + term->update(TO_H(term), term->dirty.x, term->dirty.y - (term->grid.history - term->grid.height), term->dirty.width, term->dirty.height); term->dirty.exists = false; } }
Fix update callback position to be grid-relative not scrollback-relative.
apache-2.0
absmall/libterm,absmall/libterm
c183c2b8aac1bfaefe82c9532bd16ec0f373142b
// A current_time function for use in the tests. Returns time in // milliseconds. #ifdef _WIN32 #include <Windows.h> double current_time() { LARGE_INTEGER freq, t; QueryPerformanceCounter(&t); QueryPerformanceFrequency(&freq); return (t.QuadPart * 1000.0) / freq.QuadPart; } // Gross, these come from Windows.h #undef max #undef min #else #include <sys/time.h> double current_time() { static bool first_call = true; static timeval reference_time; if (first_call) { first_call = false; gettimeofday(&reference_time, NULL); return 0.0; } else { timeval t; gettimeofday(&t, NULL); return ((t.tv_sec - reference_time.tv_sec)*1000.0 + (t.tv_usec - reference_time.tv_usec)/1000.0); } } #endif
// A current_time function for use in the tests. Returns time in // milliseconds. #ifdef _WIN32 extern "C" bool QueryPerformanceCounter(uint64_t *); extern "C" bool QueryPerformanceFrequency(uint64_t *); double current_time() { uint64_t t, freq; QueryPerformanceCounter(&t); QueryPerformanceFrequency(&freq); return (t * 1000.0) / freq; } #else #include <sys/time.h> double current_time() { static bool first_call = true; static timeval reference_time; if (first_call) { first_call = false; gettimeofday(&reference_time, NULL); return 0.0; } else { timeval t; gettimeofday(&t, NULL); return ((t.tv_sec - reference_time.tv_sec)*1000.0 + (t.tv_usec - reference_time.tv_usec)/1000.0); } } #endif
--- +++ @@ -2,14 +2,16 @@ // milliseconds. #ifdef _WIN32 -extern "C" bool QueryPerformanceCounter(uint64_t *); -extern "C" bool QueryPerformanceFrequency(uint64_t *); +#include <Windows.h> double current_time() { - uint64_t t, freq; + LARGE_INTEGER freq, t; QueryPerformanceCounter(&t); QueryPerformanceFrequency(&freq); - return (t * 1000.0) / freq; + return (t.QuadPart * 1000.0) / freq.QuadPart; } +// Gross, these come from Windows.h +#undef max +#undef min #else #include <sys/time.h> double current_time() {
Fix build of tutorials that require libpng under Visual Studio.
mit
adasworks/Halide,ronen/Halide,smxlong/Halide,rodrigob/Halide,adasworks/Halide,mcanthony/Halide,myrtleTree33/Halide,lglucin/Halide,myrtleTree33/Halide,dougkwan/Halide,damienfir/Halide,fengzhyuan/Halide,dan-tull/Halide,ronen/Halide,lglucin/Halide,adasworks/Halide,aam/Halide,adasworks/Halide,ayanazmat/Halide,myrtleTree33/Halide,dan-tull/Halide,dougkwan/Halide,delcypher/Halide,kenkuang1213/Halide,dougkwan/Halide,rodrigob/Halide,ronen/Halide,fengzhyuan/Halide,kenkuang1213/Halide,fengzhyuan/Halide,mcanthony/Halide,lglucin/Halide,delcypher/Halide,aam/Halide,fengzhyuan/Halide,dan-tull/Halide,mcanthony/Halide,adasworks/Halide,rodrigob/Halide,kgnk/Halide,rodrigob/Halide,dan-tull/Halide,tdenniston/Halide,delcypher/Halide,psuriana/Halide,ronen/Halide,dougkwan/Halide,dan-tull/Halide,tdenniston/Halide,psuriana/Halide,kgnk/Halide,kenkuang1213/Halide,jiawen/Halide,rodrigob/Halide,tdenniston/Halide,ayanazmat/Halide,aam/Halide,mcanthony/Halide,smxlong/Halide,mcanthony/Halide,ayanazmat/Halide,delcypher/Halide,tdenniston/Halide,lglucin/Halide,dougkwan/Halide,delcypher/Halide,lglucin/Halide,lglucin/Halide,damienfir/Halide,psuriana/Halide,smxlong/Halide,lglucin/Halide,dan-tull/Halide,kgnk/Halide,mcanthony/Halide,jiawen/Halide,kenkuang1213/Halide,jiawen/Halide,smxlong/Halide,kenkuang1213/Halide,fengzhyuan/Halide,delcypher/Halide,adasworks/Halide,smxlong/Halide,damienfir/Halide,psuriana/Halide,psuriana/Halide,jiawen/Halide,fengzhyuan/Halide,mcanthony/Halide,jiawen/Halide,ayanazmat/Halide,ayanazmat/Halide,myrtleTree33/Halide,tdenniston/Halide,aam/Halide,aam/Halide,ayanazmat/Halide,jiawen/Halide,dan-tull/Halide,ronen/Halide,jiawen/Halide,ronen/Halide,adasworks/Halide,psuriana/Halide,dougkwan/Halide,dougkwan/Halide,smxlong/Halide,myrtleTree33/Halide,mcanthony/Halide,rodrigob/Halide,tdenniston/Halide,ronen/Halide,tdenniston/Halide,kgnk/Halide,adasworks/Halide,damienfir/Halide,dougkwan/Halide,fengzhyuan/Halide,tdenniston/Halide,damienfir/Halide,aam/Halide,damienfir/Halide,delcypher/Halide,myrtleTree33/Halide,psuriana/Halide,damienfir/Halide,kenkuang1213/Halide,delcypher/Halide,ayanazmat/Halide,ronen/Halide,dan-tull/Halide,ayanazmat/Halide,myrtleTree33/Halide,kgnk/Halide,kenkuang1213/Halide,smxlong/Halide,kenkuang1213/Halide,rodrigob/Halide,myrtleTree33/Halide,kgnk/Halide,fengzhyuan/Halide,kgnk/Halide,aam/Halide,kgnk/Halide,rodrigob/Halide,damienfir/Halide,smxlong/Halide
65788a4fd0699c3ed06bdd314ad1a8d5de5a6a3c
// RUN: %clang_cc1 -fsyntax-only -verify %s typedef __typeof((int*) 0 - (int*) 0) intptr_t; static int f = 10; static int b = f; // expected-error {{initializer element is not a compile-time constant}} float r = (float) (intptr_t) &r; // expected-error {{initializer element is not a compile-time constant}} intptr_t s = (intptr_t) &s; _Bool t = &t; union bar { int i; }; struct foo { unsigned ptr; }; union bar u[1]; struct foo x = {(intptr_t) u}; // no-error struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}}
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -fsyntax-only -verify %s #include <stdint.h> static int f = 10; static int b = f; // expected-error {{initializer element is not a compile-time constant}} float r = (float) (intptr_t) &r; // expected-error {{initializer element is not a compile-time constant}} intptr_t s = (intptr_t) &s; _Bool t = &t; union bar { int i; }; struct foo { unsigned ptr; }; union bar u[1]; struct foo x = {(intptr_t) u}; // no-error struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}}
--- +++ @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple i386-pc-linux-gnu -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s -#include <stdint.h> +typedef __typeof((int*) 0 - (int*) 0) intptr_t; static int f = 10; static int b = f; // expected-error {{initializer element is not a compile-time constant}}
Fix test to not force triple, and also to not need stdint.h. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@96499 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
apple/swift-clang,llvm-mirror/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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
56bddeda24adcb927dd5ceafd75f84ebc2eb4203
// // ASAbsoluteLayoutElement.h // AsyncDisplayKit // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // #import <AsyncDisplayKit/ASBaseDefines.h> #import <AsyncDisplayKit/ASDimension.h> NS_ASSUME_NONNULL_BEGIN /** * Layout options that can be defined for an ASLayoutElement being added to a ASAbsoluteLayoutSpec. */ @protocol ASAbsoluteLayoutElement /** * @abstract The position of this object within its parent spec. */ @property (nonatomic, assign) CGPoint layoutPosition; #pragma mark Deprecated @property (nonatomic, assign) ASRelativeSizeRange sizeRange ASDISPLAYNODE_DEPRECATED; @end NS_ASSUME_NONNULL_END
// // ASAbsoluteLayoutElement.h // AsyncDisplayKit // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // NS_ASSUME_NONNULL_BEGIN /** * Layout options that can be defined for an ASLayoutElement being added to a ASAbsoluteLayoutSpec. */ @protocol ASAbsoluteLayoutElement /** * @abstract The position of this object within its parent spec. */ @property (nonatomic, assign) CGPoint layoutPosition; #pragma mark Deprecated @property (nonatomic, assign) ASRelativeSizeRange sizeRange ASDISPLAYNODE_DEPRECATED; @end NS_ASSUME_NONNULL_END
--- +++ @@ -7,6 +7,9 @@ // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // + +#import <AsyncDisplayKit/ASBaseDefines.h> +#import <AsyncDisplayKit/ASDimension.h> NS_ASSUME_NONNULL_BEGIN
[Build] Add imports that are necessary for clang to parse header files after compilation. This allows the objc-diff tool (which creates API diffs) to run successfully.
bsd-3-clause
maicki/AsyncDisplayKit,tomizimobile/AsyncDisplayKit,rmls/AsyncDisplayKit,romyilano/AsyncDisplayKit,tomizimobile/AsyncDisplayKit,rahul-malik/AsyncDisplayKit,chrisdanford/AsyncDisplayKit,flovouin/AsyncDisplayKit,aaronschubert0/AsyncDisplayKit,harryworld/AsyncDisplayKit,tomizimobile/AsyncDisplayKit,george-gw/AsyncDisplayKit,JetZou/AsyncDisplayKit,rahul-malik/AsyncDisplayKit,JetZou/AsyncDisplayKit,aaronschubert0/AsyncDisplayKit,harryworld/AsyncDisplayKit,aaronschubert0/AsyncDisplayKit,romyilano/AsyncDisplayKit,rahul-malik/AsyncDisplayKit,maicki/AsyncDisplayKit,george-gw/AsyncDisplayKit,romyilano/AsyncDisplayKit,chrisdanford/AsyncDisplayKit,JetZou/AsyncDisplayKit,rmls/AsyncDisplayKit,JetZou/AsyncDisplayKit,tomizimobile/AsyncDisplayKit,lappp9/AsyncDisplayKit,lappp9/AsyncDisplayKit,flovouin/AsyncDisplayKit,romyilano/AsyncDisplayKit,chrisdanford/AsyncDisplayKit,aaronschubert0/AsyncDisplayKit,harryworld/AsyncDisplayKit,rmls/AsyncDisplayKit,lappp9/AsyncDisplayKit,chrisdanford/AsyncDisplayKit,maicki/AsyncDisplayKit,harryworld/AsyncDisplayKit,maicki/AsyncDisplayKit,maicki/AsyncDisplayKit,tomizimobile/AsyncDisplayKit,harryworld/AsyncDisplayKit,george-gw/AsyncDisplayKit,flovouin/AsyncDisplayKit,rmls/AsyncDisplayKit,rmls/AsyncDisplayKit,aaronschubert0/AsyncDisplayKit,george-gw/AsyncDisplayKit,lappp9/AsyncDisplayKit,flovouin/AsyncDisplayKit,JetZou/AsyncDisplayKit,flovouin/AsyncDisplayKit,rahul-malik/AsyncDisplayKit
d7ba0a9c6dad9db4a22d06c25646ae6df25ccd68
//===--- ParentMap.h - Mappings from Stmts to their Parents -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the ParentMap class. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_PARENTMAP_H #define LLVM_CLANG_PARENTMAP_H namespace clang { class Stmt; class ParentMap { void* Impl; public: ParentMap(Stmt* ASTRoot); ~ParentMap(); Stmt* getParent(Stmt*) const; const Stmt* getParent(const Stmt* S) const { return getParent(const_cast<Stmt*>(S)); } bool hasParent(Stmt* S) const { return getParent(S) != 0; } }; } // end clang namespace #endif
//===--- ParentMap.h - Mappings from Stmts to their Parents -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the ParentMap class. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_PARENTMAP_H #define LLVM_CLANG_PARENTMAP_H namespace clang { class Stmt; class ParentMap { void* Impl; public: ParentMap(Stmt* ASTRoot); ~ParentMap(); Stmt* getParent(Stmt*) const; bool hasParent(Stmt* S) const { return getParent(S) != 0; } }; } // end clang namespace #endif
--- +++ @@ -23,7 +23,11 @@ ParentMap(Stmt* ASTRoot); ~ParentMap(); - Stmt* getParent(Stmt*) const; + Stmt* getParent(Stmt*) const; + + const Stmt* getParent(const Stmt* S) const { + return getParent(const_cast<Stmt*>(S)); + } bool hasParent(Stmt* S) const { return getParent(S) != 0;
Add missing header file change. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@67871 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
ced21016cec1f189a695857bed103ecc9e3f3696
#ifndef POPULATION_H #define POPULATION_H class POPULATION { public: int **initializePopulation(int individuals, int genes, bool FILL_ZERO = false); int createRandomPopulation(int **population, int individuals, int genes); }; #endif
#ifndef POPULATION_H #define POPULATION_H class POPULATION { public: int **initializePopulation(int individuals, int genes, bool FILL_ZERO = false); int **createRandomPopulation(int **population, int individuals, int genes); }; #endif
--- +++ @@ -5,7 +5,7 @@ { public: int **initializePopulation(int individuals, int genes, bool FILL_ZERO = false); - int **createRandomPopulation(int **population, int individuals, int genes); + int createRandomPopulation(int **population, int individuals, int genes); }; #endif
Update return datatype function 'createRandomPopulation'.
mit
wkohlenberg/simple_GA
948ec1820d49c8ec2ec68eb000e088ead4c3bf37
#ifndef _LPMS_FFMPEG_H_ #define _LPMS_FFMPEG_H_ #include <libavutil/rational.h> typedef struct { char *fname; int w, h, bitrate; AVRational fps; } output_params; void lpms_init(); int lpms_rtmp2hls(char *listen, char *outf, char *ts_tmpl, char *seg_time, char *seg_start); int lpms_transcode(char *inp, output_params *params, int nb_outputs); #endif // _LPMS_FFMPEG_H_
#include <libavutil/rational.h> typedef struct { char *fname; int w, h, bitrate; AVRational fps; } output_params; void lpms_init(); void lpms_deinit(); int lpms_rtmp2hls(char *listen, char *outf, char *ts_tmpl, char *seg_time, char *seg_start); int lpms_transcode(char *inp, output_params *params, int nb_outputs); int lpms_length(char *inp, int ts_max, int packet_max);
--- +++ @@ -1,3 +1,6 @@ +#ifndef _LPMS_FFMPEG_H_ +#define _LPMS_FFMPEG_H_ + #include <libavutil/rational.h> typedef struct { @@ -7,7 +10,7 @@ } output_params; void lpms_init(); -void lpms_deinit(); int lpms_rtmp2hls(char *listen, char *outf, char *ts_tmpl, char *seg_time, char *seg_start); int lpms_transcode(char *inp, output_params *params, int nb_outputs); -int lpms_length(char *inp, int ts_max, int packet_max); + +#endif // _LPMS_FFMPEG_H_
ffmpeg: Remove unused declarations from headers. Also add some include guards.
mit
livepeer/lpms,livepeer/lpms,livepeer/lpms,livepeer/lpms
8f39850a0cc1114eeb77d3e71fa2eed98f61ca87
// // WeakUniqueCollection.h // book-shelf // // Created by Artem Gladkov on 28.06.16. // Copyright © 2016 Sibext Ltd. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /** WeakUniqueCollection keeps weak references to the objects and maintains uniqueness. It's public API is fully thread safe. WeakUniqueCollection is not optimized for working with large amount of objects. */ @interface WeakUniqueCollection<ObjectType> : NSObject @property(readonly)NSUInteger count; /** Adds object to the collection @param object ObjectType to be added to the collection */ - (void)addObject:(ObjectType)object; /** Removes object from the collection (if collection contains it). @param object ObjectType to be removed from the collection */ - (void)removeObject:(ObjectType)object; /** Removes all objects from the collection. */ - (void)removeAllObjects; /** Returns any object from the collection. @return ObjectType or nil (if the collection is empty). */ - (nullable ObjectType)anyObject; /** Returns array with all objects from the collection. @return NSArray with objects (cound be empty if the collection is empty). */ - (NSArray <ObjectType> *)allObjects; /** Determines if the object is already contained in the collection. @param object ObjectType to be verified @return YES if object is in the collection NO if object is not in the collection */ - (BOOL)member:(ObjectType)object; @end NS_ASSUME_NONNULL_END
// // WeakUniqueCollection.h // book-shelf // // Created by Artem Gladkov on 28.06.16. // Copyright © 2016 Sibext Ltd. All rights reserved. // #import <Foundation/Foundation.h> @interface WeakUniqueCollection<ObjectType> : NSObject @property(readonly)NSUInteger count; - (void)addObject:(ObjectType)object; - (void)removeObject:(ObjectType)object; - (void)removeAllObjects; - (ObjectType)anyObject; - (NSArray <ObjectType> *)allObjects; - (BOOL)member:(ObjectType)object; @end
--- +++ @@ -8,16 +8,60 @@ #import <Foundation/Foundation.h> +NS_ASSUME_NONNULL_BEGIN + +/** + WeakUniqueCollection keeps weak references to the objects and maintains uniqueness. + It's public API is fully thread safe. + + WeakUniqueCollection is not optimized for working with large amount of objects. + */ @interface WeakUniqueCollection<ObjectType> : NSObject @property(readonly)NSUInteger count; +/** + Adds object to the collection + + @param object ObjectType to be added to the collection + */ - (void)addObject:(ObjectType)object; + +/** + Removes object from the collection (if collection contains it). + + @param object ObjectType to be removed from the collection + */ - (void)removeObject:(ObjectType)object; + +/** + Removes all objects from the collection. + */ - (void)removeAllObjects; -- (ObjectType)anyObject; +/** + Returns any object from the collection. + + @return ObjectType or nil (if the collection is empty). + */ +- (nullable ObjectType)anyObject; + +/** + Returns array with all objects from the collection. + + @return NSArray with objects (cound be empty if the collection is empty). + */ - (NSArray <ObjectType> *)allObjects; + +/** + Determines if the object is already contained in the collection. + + @param object ObjectType to be verified + @return YES if object is in the collection + NO if object is not in the collection + */ - (BOOL)member:(ObjectType)object; @end + +NS_ASSUME_NONNULL_END
Add documentation for public API and nullability specification.
mit
sibext/WeakUniqueCollection,sibext/WeakUniqueCollection
8f1e899485677eb8accfdc999fbd1e7e12187302
#include <inttypes.h> #include <stdlib.h> #include <unistd.h> #include <stdbool.h> #include "tock.h" #pragma GCC diagnostic ignored "-Wunused-parameter" void yield_for(bool *cond) { while(!*cond) { yield(); } } void yield() { asm volatile("push {lr}\nsvc 0\npop {pc}" ::: "memory", "r0"); } int subscribe(uint32_t driver, uint32_t subscribe, subscribe_cb cb, void* userdata) { register int ret __asm__ ("r0"); asm volatile("svc 1" ::: "memory", "r0"); return ret; } int command(uint32_t driver, uint32_t command, int data) { register int ret __asm__ ("r0"); asm volatile("svc 2\nbx lr" ::: "memory", "r0"); return ret; } int allow(uint32_t driver, uint32_t allow, void* ptr, size_t size) { register int ret __asm__ ("r0"); asm volatile("svc 3\nbx lr" ::: "memory", "r0"); return ret; } int memop(uint32_t op_type, int arg1) { register int ret __asm__ ("r0"); asm volatile("svc 4\nbx lr" ::: "memory", "r0"); return ret; } bool driver_exists(uint32_t driver) { int ret = command(driver, 0, 0); return ret >= 0; }
#include <inttypes.h> #include <stdlib.h> #include <unistd.h> #include <stdbool.h> #include "tock.h" #pragma GCC diagnostic ignored "-Wunused-parameter" void yield_for(bool *cond) { while(!*cond) { yield(); } } void yield() { asm volatile("push {lr}\nsvc 0\npop {pc}" ::: "memory", "r0"); } int subscribe(uint32_t driver, uint32_t subscribe, subscribe_cb cb, void* userdata) { asm volatile("svc 1\nbx lr" ::: "memory", "r0"); } int command(uint32_t driver, uint32_t command, int data) { asm volatile("svc 2\nbx lr" ::: "memory", "r0"); } int allow(uint32_t driver, uint32_t allow, void* ptr, size_t size) { asm volatile("svc 3\nbx lr" ::: "memory", "r0"); } int memop(uint32_t op_type, int arg1) { asm volatile("svc 4\nbx lr" ::: "memory", "r0"); } bool driver_exists(uint32_t driver) { int ret = command(driver, 0, 0); return ret >= 0; }
--- +++ @@ -18,20 +18,28 @@ int subscribe(uint32_t driver, uint32_t subscribe, subscribe_cb cb, void* userdata) { - asm volatile("svc 1\nbx lr" ::: "memory", "r0"); + register int ret __asm__ ("r0"); + asm volatile("svc 1" ::: "memory", "r0"); + return ret; } int command(uint32_t driver, uint32_t command, int data) { + register int ret __asm__ ("r0"); asm volatile("svc 2\nbx lr" ::: "memory", "r0"); + return ret; } int allow(uint32_t driver, uint32_t allow, void* ptr, size_t size) { + register int ret __asm__ ("r0"); asm volatile("svc 3\nbx lr" ::: "memory", "r0"); + return ret; } int memop(uint32_t op_type, int arg1) { + register int ret __asm__ ("r0"); asm volatile("svc 4\nbx lr" ::: "memory", "r0"); + return ret; } bool driver_exists(uint32_t driver) {
Resolve 'control reaches end of non-void function' Following http://stackoverflow.com/questions/15927583/
apache-2.0
tock/libtock-c,tock/libtock-c,tock/libtock-c
e14f51a4248fe3c4f031a011b483947bfb2f2f5d
#ifndef _gnugol_engines #define _gnugol_engines 1 #include "nodelist.h" #ifdef DEBUG_SHAREDLIBS # define GNUGOL_SHAREDLIBDIR "../engines" #else # define GNUGOL_SHAREDLIBDIR "/var/lib/gnugol" #endif typedef struct ggengine { Node node; void *lib; const char *name; int (*setup) (QueryOptions_t *); int (*search)(QueryOptions_t *); } *GnuGolEngine; GnuGolEngine gnugol_engine_load (const char *); int gnugol_engine_query (GnuGolEngine,QueryOptions_t *); void gnugol_engine_unload (GnuGolEngine); int gnugol_read_key (char *const,size_t *const,const char *const); #endif
#ifndef _gnugol_engines #define _gnugol_engines 1 #ifdef DEBUG_SHAREDLIBS # define GNUGOL_SHAREDLIBDIR "../engines" #else # define GNUGOL_SHAREDLIBDIR "/var/lib/gnugol" #endif typedef struct ggengine { Node node; void *lib; const char *name; int (*setup) (QueryOptions_t *); int (*search)(QueryOptions_t *); } *GnuGolEngine; GnuGoldEngine gnugol_engine_load (const char *); int gnugol_engine_query (GnuGolEngine,QueryOptions_t *); void gnugol_engine_unload (GnuGolEngine); int gnugol_read_key (char *const,size_t *const,const char *const); #endif
--- +++ @@ -1,5 +1,7 @@ #ifndef _gnugol_engines #define _gnugol_engines 1 + +#include "nodelist.h" #ifdef DEBUG_SHAREDLIBS # define GNUGOL_SHAREDLIBDIR "../engines" @@ -16,7 +18,7 @@ int (*search)(QueryOptions_t *); } *GnuGolEngine; -GnuGoldEngine gnugol_engine_load (const char *); +GnuGolEngine gnugol_engine_load (const char *); int gnugol_engine_query (GnuGolEngine,QueryOptions_t *); void gnugol_engine_unload (GnuGolEngine); int gnugol_read_key (char *const,size_t *const,const char *const);
Include nodelist here, and fix a typo.
agpl-3.0
dtaht/Gnugol,dtaht/Gnugol,dtaht/Gnugol,dtaht/Gnugol
c5f51ac16b113923162c442e1234223ab528c7d4
// // DDMathParserMacros.h // DDMathParser // // Created by Dave DeLong on 2/19/11. // Copyright 2011 __MyCompanyName__. All rights reserved. // #import <Foundation/Foundation.h> #import "DDTypes.h" #ifndef ERR_ASSERT #define ERR_ASSERT(_e) NSAssert((_e) != nil, @"NULL out error") #endif #ifndef DD_ERR #define DD_ERR(_c,_f,...) [NSError errorWithDomain:DDMathParserErrorDomain code:(_c) userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:(_f), ##__VA_ARGS__]}] #endif #define DDMathParserDeprecated(_r) __attribute__((deprecated(_r)))
// // DDMathParserMacros.h // DDMathParser // // Created by Dave DeLong on 2/19/11. // Copyright 2011 __MyCompanyName__. All rights reserved. // #import <Foundation/Foundation.h> #import "DDTypes.h" #ifndef ERR_ASSERT #define ERR_ASSERT(_e) NSAssert((_e) != nil, @"NULL out error") #endif #ifndef ERR #define DD_ERR(_c,_f,...) [NSError errorWithDomain:DDMathParserErrorDomain code:(_c) userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:(_f), ##__VA_ARGS__]}] #endif #define DDMathParserDeprecated(_r) __attribute__((deprecated(_r)))
--- +++ @@ -14,7 +14,7 @@ #define ERR_ASSERT(_e) NSAssert((_e) != nil, @"NULL out error") #endif -#ifndef ERR +#ifndef DD_ERR #define DD_ERR(_c,_f,...) [NSError errorWithDomain:DDMathParserErrorDomain code:(_c) userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:(_f), ##__VA_ARGS__]}] #endif
Correct conditional on DD_ERR macro
mit
mrackwitz/DDMathParser,carabina/DDMathParser,davedelong/DDMathParser,carabina/DDMathParser,mrackwitz/DDMathParser,davedelong/DDMathParser
61f591fe949c76b918ae3342ae8d87b2bd5ce072
// // C++ Interface: getdetailstask // // Description: // // // Author: SUSE AG <>, (C) 2004 // // Copyright: See COPYING file that comes with this distribution // // #ifndef GETDETAILSTASK_H #define GETDETAILSTASK_H #include "gwerror.h" #include "requesttask.h" /** This task fetches the details for a set of user IDs from the server. Sometimes we get an event that only has a DN, and we need other details before showing the event to the user. @author SUSE AG */ using namespace GroupWise; class GetDetailsTask : public RequestTask { Q_OBJECT public: GetDetailsTask( Task * parent ); ~GetDetailsTask(); bool take( Transfer * transfer ); void userDNs( const QStringList & userDNs ); signals: void gotContactUserDetails( const GroupWise::ContactDetails & ); protected: GroupWise::ContactDetails extractUserDetails( Field::MultiField * details ); }; #endif
// // C++ Interface: getdetailstask // // Description: // // // Author: SUSE AG <>, (C) 2004 // // Copyright: See COPYING file that comes with this distribution // // #ifndef GETDETAILSTASK_H #define GETDETAILSTASK_H #include "gwerror.h" #include "requesttask.h" /** This task fetches the details for a set of user IDs from the server. Sometimes we get an event that only has a DN, and we need other details before showing the event to the user. @author SUSE AG */ using namespace GroupWise; class GetDetailsTask : public RequestTask { Q_OBJECT public: GetDetailsTask( Task * parent ); ~GetDetailsTask(); bool take( Transfer * transfer ); void userDNs( const QStringList & userDNs ); signals: void gotContactUserDetails( const ContactDetails & ); protected: GroupWise::ContactDetails extractUserDetails( Field::MultiField * details ); }; #endif
--- +++ @@ -31,7 +31,7 @@ bool take( Transfer * transfer ); void userDNs( const QStringList & userDNs ); signals: - void gotContactUserDetails( const ContactDetails & ); + void gotContactUserDetails( const GroupWise::ContactDetails & ); protected: GroupWise::ContactDetails extractUserDetails( Field::MultiField * details );
Fix broken signal connection CVS_SILENT svn path=/branches/groupwise_in_anger/kdenetwork/kopete/; revision=344030
lgpl-2.1
josh-wambua/kopete,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,Jtalk/kopete-fork-xep0136,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,josh-wambua/kopete,josh-wambua/kopete,josh-wambua/kopete,Jtalk/kopete-fork-xep0136,Jtalk/kopete-fork-xep0136,josh-wambua/kopete
f20b984aa6bffeaccdd9b789fc543c93f20271f9
/** * mips.h - all the aliases to MIPS ISA * @author Aleksandr Misevich * Copyright 2018 MIPT-MIPS */ #ifndef MIPS_H_ #define MIPS_H_ #include <infra/instrcache/instr_cache_memory.h> #include "mips_instr.h" struct MIPS { using FuncInstr = MIPSInstr; using Register = MIPSRegister; using Memory = InstrMemory<MIPSInstr>; using RegisterUInt = uint32; using RegDstUInt = doubled_t<uint32>; // MIPS may produce output to 2x HI/LO register }; #endif // MIPS_H_
/** * mips.h - all the aliases to MIPS ISA * @author Aleksandr Misevich * Copyright 2018 MIPT-MIPS */ #ifndef MIPS_H_ #define MIPS_H_ #include <infra/instrcache/instr_cache_memory.h> #include "mips_instr.h" struct MIPS { using FuncInstr = MIPSInstr; using Register = MIPSRegister; using Memory = InstrMemory<MIPSInstr>; using RegisterUInt = uint32; using RegDstUInt = uint64; }; #endif // MIPS_H_
--- +++ @@ -16,7 +16,7 @@ using Register = MIPSRegister; using Memory = InstrMemory<MIPSInstr>; using RegisterUInt = uint32; - using RegDstUInt = uint64; + using RegDstUInt = doubled_t<uint32>; // MIPS may produce output to 2x HI/LO register }; #endif // MIPS_H_
Use doubled_t for MIPS defines
mit
MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips,MIPT-ILab/mipt-mips,MIPT-ILab/mipt-mips-2015,MIPT-ILab/mipt-mips-2015
3350085ed7177cdc387d162a71073b787ba401be
#ifndef PLATFORM_HW_H__ #define PLATFORM_HW_H__ #include <stdbool.h> #include "color.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_hal_gpio.h" #define LED_CHAIN_LENGTH 10 #define USER_BUTTON_PORT (GPIOA) #define USER_BUTTON_PIN (GPIO_PIN_0) #define LED_SPI_INSTANCE (SPI1) #pragma pack(push) /* push current alignment to stack */ #pragma pack(1) /* set alignment to 1 byte boundary */ union platformHW_LEDRegister { uint8_t raw[4]; struct { //3 bits always, 5 bits global brightness, 8B, 8G, 8R //Glob = 0xE1 = min bright uint8_t globalBrightness :5; //header/global brightness is 0bAAABBBBB //A = 1 //B = integer brightness divisor from 0x0 -> 0x1F uint8_t const header :3; struct color_ColorRGB color; }; }; #pragma pack(pop) /* restore original alignment from stack */ bool platformHW_Init(void); bool platformHW_SpiInit(SPI_HandleTypeDef * const spi, SPI_TypeDef* spiInstance); void platformHW_UpdateLEDs(SPI_HandleTypeDef* spi); #endif//PLATFORM_HW_H__
#ifndef PLATFORM_HW_H__ #define PLATFORM_HW_H__ #include <stdbool.h> #include "color.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_hal_gpio.h" #define LED_CHAIN_LENGTH 10 #define USER_BUTTON_PORT (GPIOA) #define USER_BUTTON_PIN (GPIO_PIN_0) #define LED_SPI_INSTANCE (SPI1) #pragma pack(push) /* push current alignment to stack */ #pragma pack(1) /* set alignment to 1 byte boundary */ union platformHW_LEDRegister { uint8_t raw[4]; struct { //header/global brightness is 0bAAABBBBB //A = 1 //B = integer brightness divisor from 0x0 -> 0x1F uint8_t const header :3; //3 bits always, 5 bits global brightness, 8B, 8G, 8R //Glob = 0xE1 = min bright //uint8_t const globalHeader :8; uint8_t globalBrightness :5; struct color_ColorRGB color; }; }; #pragma pack(pop) /* restore original alignment from stack */ bool platformHW_Init(void); bool platformHW_SpiInit(SPI_HandleTypeDef * const spi, SPI_TypeDef* spiInstance); void platformHW_UpdateLEDs(SPI_HandleTypeDef* spi); #endif//PLATFORM_HW_H__
--- +++ @@ -18,16 +18,15 @@ union platformHW_LEDRegister { uint8_t raw[4]; struct { + //3 bits always, 5 bits global brightness, 8B, 8G, 8R + //Glob = 0xE1 = min bright + uint8_t globalBrightness :5; + //header/global brightness is 0bAAABBBBB //A = 1 //B = integer brightness divisor from 0x0 -> 0x1F - uint8_t const header :3; - //3 bits always, 5 bits global brightness, 8B, 8G, 8R - //Glob = 0xE1 = min bright - //uint8_t const globalHeader :8; - uint8_t globalBrightness :5; struct color_ColorRGB color; }; };
Fix incorrect LED header bit order
mit
borgel/sympetrum-v2,borgel/sympetrum-v2
f7285e5f08b0b2aca0caf7fe03b897303c9981bd
/* * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. * Copyright 2016 Cryptography Research, Inc. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html * * Originally written by Mike Hamburg */ #ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H # define OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H # include "internal/constant_time.h" # define ARCH_WORD_BITS 64 # define word_is_zero(a) constant_time_is_zero_64(a) static ossl_inline uint128_t widemul(uint64_t a, uint64_t b) { return ((uint128_t) a) * b; } #endif /* OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H */
/* * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. * Copyright 2016 Cryptography Research, Inc. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html * * Originally written by Mike Hamburg */ #ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H # define OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H # define ARCH_WORD_BITS 64 static ossl_inline uint64_t word_is_zero(uint64_t a) { /* let's hope the compiler isn't clever enough to optimize this. */ return (((__uint128_t) a) - 1) >> 64; } static ossl_inline uint128_t widemul(uint64_t a, uint64_t b) { return ((uint128_t) a) * b; } #endif /* OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H */
--- +++ @@ -13,13 +13,11 @@ #ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H # define OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H +# include "internal/constant_time.h" + # define ARCH_WORD_BITS 64 -static ossl_inline uint64_t word_is_zero(uint64_t a) -{ - /* let's hope the compiler isn't clever enough to optimize this. */ - return (((__uint128_t) a) - 1) >> 64; -} +# define word_is_zero(a) constant_time_is_zero_64(a) static ossl_inline uint128_t widemul(uint64_t a, uint64_t b) {
curve448: Use constant time zero check function Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Tomas Mraz <2bc6038c3dfca09b2da23c8b6da8ba884dc2dcc2@openssl.org> Reviewed-by: Matt Caswell <1fa2ef4755a9226cb9a0a4840bd89b158ac71391@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14784)
apache-2.0
openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl
f684a2d783bf2c4728e65f83e0f89ec654f40e79
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "i_hw_info.h" namespace vespalib { /* * Class describing some hardware on the machine. */ class HwInfo : public IHwInfo { bool _spinningDisk; public: HwInfo(); virtual ~HwInfo(); virtual bool spinningDisk() const override; }; }
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "i_hw_info.h" namespace vespalib { /* * class describing some hardware on the machine. */ class HwInfo : public IHwInfo { bool _spinningDisk; public: HwInfo(); virtual ~HwInfo(); virtual bool spinningDisk() const override; }; }
--- +++ @@ -7,7 +7,7 @@ namespace vespalib { /* - * class describing some hardware on the machine. + * Class describing some hardware on the machine. */ class HwInfo : public IHwInfo {
Use proper uppercase at start of comment.
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
c67c564520eecf9c8517075b286ec0ac976d07a4
#ifndef __ASM_X86_BITSPERLONG_H #define __ASM_X86_BITSPERLONG_H #if defined(__x86_64__) && !defined(__ILP32__) # define __BITS_PER_LONG 64 #else # define __BITS_PER_LONG 32 #endif #include <asm-generic/bitsperlong.h> #endif /* __ASM_X86_BITSPERLONG_H */
#ifndef __ASM_X86_BITSPERLONG_H #define __ASM_X86_BITSPERLONG_H #ifdef __x86_64__ # define __BITS_PER_LONG 64 #else # define __BITS_PER_LONG 32 #endif #include <asm-generic/bitsperlong.h> #endif /* __ASM_X86_BITSPERLONG_H */
--- +++ @@ -1,7 +1,7 @@ #ifndef __ASM_X86_BITSPERLONG_H #define __ASM_X86_BITSPERLONG_H -#ifdef __x86_64__ +#if defined(__x86_64__) && !defined(__ILP32__) # define __BITS_PER_LONG 64 #else # define __BITS_PER_LONG 32
x86/headers/uapi: Fix __BITS_PER_LONG value for x32 builds On x32, gcc predefines __x86_64__ but long is only 32-bit. Use __ILP32__ to distinguish x32. Fixes this compiler error in perf: tools/include/asm-generic/bitops/__ffs.h: In function '__ffs': tools/include/asm-generic/bitops/__ffs.h:19:8: error: right shift count >= width of type [-Werror=shift-count-overflow] word >>= 32; ^ This isn't sufficient to build perf for x32, though. Signed-off-by: Ben Hutchings <73675debcd8a436be48ec22211dcf44fe0df0a64@decadent.org.uk> Cc: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org> Cc: Mike Galbraith <3cfa3897b7f55b5396b7a47c83b66325184bc9b4@gmx.de> Cc: Peter Zijlstra <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org> Cc: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de> Cc: 2578944098299abf708b08eff6fcf60565553586@vger.kernel.org Link: 1a33e98b5ba0bc803f6f34527d38fce92e88714d@decadent.org.uk Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
f4b4aae1828855db761bf998ce37d3062b1d6446
/* Path handling. This was copied from Lua, with some minor adjustments. The biggest one is the lack of Windows support, because I don't have my Windows box setup for Lily yet (I'd rather make sure Windows works all at once). */ #define LILY_MAJOR "0" #define LILY_MINOR "13" #define LILY_VERSION_DIR LILY_MAJOR "_" LILY_MINOR #define LILY_BASE_DIR "/usr/local/" #define LILY_SHARE_DIR LILY_BASE_DIR "share/lily/" LILY_VERSION_DIR "/" #define LILY_LIB_DIR LILY_BASE_DIR "lib/lily/" LILY_VERSION_DIR "/" /* This is where Lily will attempt to import new files from. If the parser is loading from a file, then the directory of the first file is added as the very last path to search. */ #define LILY_PATH_SEED \ LILY_SHARE_DIR ";" \ LILY_LIB_DIR ";" \ "./;"
/* Path handling. This was copied from Lua, with some minor adjustments. The biggest one is the lack of Windows support, because I don't have my Windows box setup for Lily yet (I'd rather make sure Windows works all at once). */ #define LILY_MAJOR "0" #define LILY_MINOR "13" #define LILY_VERSION_DIR LILY_MAJOR "." LILY_MINOR #define LILY_BASE_DIR "/usr/local/" #define LILY_SHARE_DIR LILY_ROOT "share/lua/" LUA_VDIR "/" #define LILY_CDIR LILY_ROOT "lib/lua/" LUA_VDIR "/" /* So, by default, Lily will attempt to load .lly files from these directories. */ #define LILY_PATH_SEED \ LILY_BASE_DIR "share/" LILY_VERSION_DIR "/;" \ LILY_BASE_DIR "lib/" LILY_VERSION_DIR "/;" \ "./;"
--- +++ @@ -3,17 +3,18 @@ The biggest one is the lack of Windows support, because I don't have my Windows box setup for Lily yet (I'd rather make sure Windows works all at once). */ -#define LILY_MAJOR "0" -#define LILY_MINOR "13" -#define LILY_VERSION_DIR LILY_MAJOR "." LILY_MINOR +#define LILY_MAJOR "0" +#define LILY_MINOR "13" +#define LILY_VERSION_DIR LILY_MAJOR "_" LILY_MINOR -#define LILY_BASE_DIR "/usr/local/" -#define LILY_SHARE_DIR LILY_ROOT "share/lua/" LUA_VDIR "/" -#define LILY_CDIR LILY_ROOT "lib/lua/" LUA_VDIR "/" +#define LILY_BASE_DIR "/usr/local/" +#define LILY_SHARE_DIR LILY_BASE_DIR "share/lily/" LILY_VERSION_DIR "/" +#define LILY_LIB_DIR LILY_BASE_DIR "lib/lily/" LILY_VERSION_DIR "/" -/* So, by default, Lily will attempt to load .lly files from these - directories. */ +/* This is where Lily will attempt to import new files from. If the parser is + loading from a file, then the directory of the first file is added as the + very last path to search. */ #define LILY_PATH_SEED \ - LILY_BASE_DIR "share/" LILY_VERSION_DIR "/;" \ - LILY_BASE_DIR "lib/" LILY_VERSION_DIR "/;" \ + LILY_SHARE_DIR ";" \ + LILY_LIB_DIR ";" \ "./;"
Fix up the embarassing mess of path seeding. Yikes. :(
mit
crasm/lily,crasm/lily,boardwalk/lily,crasm/lily,boardwalk/lily
5d334bbd060cb6129f8e8af6b29f897d6d4840a1
/* * Copyright (c) 2018, Intel Corporation. * SPDX-License-Identifier: BSD-3-Clause */ #include <CommandParser.h> #if defined(__LINUX__) || defined(__ESX__) #define EXE_NAME L"ipmctl" #elif defined(_MSC_VER) && defined(OS_BUILD) #define EXE_NAME L"ipmctl.exe" #else #define EXE_NAME L"ipmctl.efi" #endif #define APP_DESCRIPTION L"Command Line Interface" #define DRIVER_API_DESCRIPTION L"Driver API" extern EFI_HANDLE gNvmDimmCliHiiHandle; // // This is the generated String package data for all .UNI files. // This data array is ready to be used as input of HiiAddPackages() to // create a packagelist (which contains Form packages, String packages, etc). // extern unsigned char ipmctlStrings[]; extern int g_basic_commands; /** Register commands on the commands list @retval a return code from called functions **/ EFI_STATUS RegisterCommands( ); /** Register basic commands on the commands list for non-root users @retval a return code from called functions **/ EFI_STATUS RegisterNonAdminUserCommands( ); /** Print the CLI application help **/ EFI_STATUS showHelp(struct Command *pCmd);
/* * Copyright (c) 2018, Intel Corporation. * SPDX-License-Identifier: BSD-3-Clause */ #include <CommandParser.h> #if defined(__LINUX__) || defined(__ESX__) #define EXE_NAME L"ipmctl" #elif defined(_MSC_VER) #define EXE_NAME L"ipmctl.exe" #else #define EXE_NAME L"ipmctl.efi" #endif #define APP_DESCRIPTION L"Command Line Interface" #define DRIVER_API_DESCRIPTION L"Driver API" extern EFI_HANDLE gNvmDimmCliHiiHandle; // // This is the generated String package data for all .UNI files. // This data array is ready to be used as input of HiiAddPackages() to // create a packagelist (which contains Form packages, String packages, etc). // extern unsigned char ipmctlStrings[]; extern int g_basic_commands; /** Register commands on the commands list @retval a return code from called functions **/ EFI_STATUS RegisterCommands( ); /** Register basic commands on the commands list for non-root users @retval a return code from called functions **/ EFI_STATUS RegisterNonAdminUserCommands( ); /** Print the CLI application help **/ EFI_STATUS showHelp(struct Command *pCmd);
--- +++ @@ -7,7 +7,7 @@ #if defined(__LINUX__) || defined(__ESX__) #define EXE_NAME L"ipmctl" -#elif defined(_MSC_VER) +#elif defined(_MSC_VER) && defined(OS_BUILD) #define EXE_NAME L"ipmctl.exe" #else #define EXE_NAME L"ipmctl.efi"
Fix incorrect help message for UEFI Signed-off-by: Shilpa Nanja <a1983ef2f4a2c6b4f6ff7c9741e30dce4eb007d5@intel.com>
bsd-3-clause
intel/ipmctl,intel/ipmctl,intel/ipmctl,intel/ipmctl
42e0da4a0ce867dbc186665754418f5bce98301f
#ifndef _ANDROIDOPENGLINITEVENT_H_ #define _ANDROIDOPENGLINITEVENT_H_ #include <OpenGLInitEvent.h> #include <android/native_window.h> class AndroidOpenGLInitEvent : public OpenGLInitEvent { public: AndroidOpenGLInitEvent(double _timestamp, int _opengl_es_version, ANativeWindow * _window) : OpenGLInitEvent(_timestamp, _opengl_es_version), window(_window) { } ANativeWindow * getWindow() { return window; } std::shared_ptr<EventBase> dup() const { return std::make_shared<AndroidOpenGLInitEvent>(*this); } void dispatch(Element & element) { } private: ANativeWindow * window = 0; }; #endif
#ifndef _ANDROIDOPENGLINITEVENT_H_ #define _ANDROIDOPENGLINITEVENT_H_ #include <OpenGLInitEvent.h> #include <android/native_window.h> class AndroidOpenGLInitEvent : public OpenGLInitEvent { public: AndroidOpenGLInitEvent(double _timestamp, int _opengl_es_version, ANativeWindow * _window) : OpenGLInitEvent(_timestamp, _opengl_es_version), window(_window) { } ANativeWindow * getWindow() { return window; } std::shared_ptr<EventBase> dup() const { return std::make_shared<AndroidOpenGLInitEvent>(*this); } void dispatch(Element & element); private: ANativeWindow * window = 0; }; #endif
--- +++ @@ -11,7 +11,7 @@ ANativeWindow * getWindow() { return window; } std::shared_ptr<EventBase> dup() const { return std::make_shared<AndroidOpenGLInitEvent>(*this); } - void dispatch(Element & element); + void dispatch(Element & element) { } private: ANativeWindow * window = 0;
Add Todo implementation to dispatch
mit
Sometrik/framework,Sometrik/framework,Sometrik/framework
b374c810d36bffa656b626855d79f19efc6dd2ef
#import "WMFArticleListDataSourceTableViewController.h" @interface WMFDisambiguationPagesViewController : WMFArticleListDataSourceTableViewController @property (nonatomic, strong, readonly) MWKArticle* article; - (instancetype)initWithArticle:(MWKArticle*)article dataStore:(MWKDataStore*)dataStore; @end
#import "WMFArticleListTableViewController.h" @interface WMFDisambiguationPagesViewController : WMFArticleListTableViewController @property (nonatomic, strong, readonly) MWKArticle* article; - (instancetype)initWithArticle:(MWKArticle*)article dataStore:(MWKDataStore*)dataStore; @end
--- +++ @@ -1,6 +1,6 @@ -#import "WMFArticleListTableViewController.h" +#import "WMFArticleListDataSourceTableViewController.h" -@interface WMFDisambiguationPagesViewController : WMFArticleListTableViewController +@interface WMFDisambiguationPagesViewController : WMFArticleListDataSourceTableViewController @property (nonatomic, strong, readonly) MWKArticle* article;
Update disambiguation VC base class
mit
montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,anirudh24seven/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,anirudh24seven/wikipedia-ios,julienbodet/wikipedia-ios,anirudh24seven/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia
8d066a64a7a835e3b5b173fa637b2d66e2c3e2c2
// // GTDiffFile.h // ObjectiveGitFramework // // Created by Danny Greg on 30/11/2012. // Copyright (c) 2012 GitHub, Inc. All rights reserved. // #import "git2.h" // Flags which may be set on the file. // // See diff.h for individual documentation. typedef enum : git_diff_flag_t { GTDiffFileFlagValidOID = GIT_DIFF_FLAG_VALID_OID, GTDiffFileFlagBinary = GIT_DIFF_FLAG_BINARY, GTDiffFileFlagNotBinary = GIT_DIFF_FLAG_NOT_BINARY, } GTDiffFileFlag; // A class representing a file on one side of a diff. @interface GTDiffFile : NSObject // The location within the working directory of the file. @property (nonatomic, readonly, copy) NSString *path; // The size (in bytes) of the file. @property (nonatomic, readonly) NSUInteger size; // Any flags set on the file (see `GTDiffFileFlag` for more info). @property (nonatomic, readonly) GTDiffFileFlag flags; // The mode of the file. @property (nonatomic, readonly) mode_t mode; // Designated initialiser. - (instancetype)initWithGitDiffFile:(git_diff_file)file; @end
// // GTDiffFile.h // ObjectiveGitFramework // // Created by Danny Greg on 30/11/2012. // Copyright (c) 2012 GitHub, Inc. All rights reserved. // #import "git2.h" // Flags which may be set on the file. // // See diff.h for individual documentation. typedef enum : git_diff_file_flag_t { GTDiffFileFlagValidOID = GIT_DIFF_FILE_VALID_OID, GTDiffFileFlagFreePath = GIT_DIFF_FILE_FREE_PATH, GTDiffFileFlagBinary = GIT_DIFF_FILE_BINARY, GTDiffFileFlagNotBinary = GIT_DIFF_FILE_NOT_BINARY, GTDiffFileFlagFreeData = GIT_DIFF_FILE_FREE_DATA, GTDiffFileFlagUnmapData = GIT_DIFF_FILE_UNMAP_DATA, GTDiffFileFlagNoData = GIT_DIFF_FILE_NO_DATA, } GTDiffFileFlag; // A class representing a file on one side of a diff. @interface GTDiffFile : NSObject // The location within the working directory of the file. @property (nonatomic, readonly, copy) NSString *path; // The size (in bytes) of the file. @property (nonatomic, readonly) NSUInteger size; // Any flags set on the file (see `GTDiffFileFlag` for more info). @property (nonatomic, readonly) GTDiffFileFlag flags; // The mode of the file. @property (nonatomic, readonly) mode_t mode; // Designated initialiser. - (instancetype)initWithGitDiffFile:(git_diff_file)file; @end
--- +++ @@ -11,14 +11,10 @@ // Flags which may be set on the file. // // See diff.h for individual documentation. -typedef enum : git_diff_file_flag_t { - GTDiffFileFlagValidOID = GIT_DIFF_FILE_VALID_OID, - GTDiffFileFlagFreePath = GIT_DIFF_FILE_FREE_PATH, - GTDiffFileFlagBinary = GIT_DIFF_FILE_BINARY, - GTDiffFileFlagNotBinary = GIT_DIFF_FILE_NOT_BINARY, - GTDiffFileFlagFreeData = GIT_DIFF_FILE_FREE_DATA, - GTDiffFileFlagUnmapData = GIT_DIFF_FILE_UNMAP_DATA, - GTDiffFileFlagNoData = GIT_DIFF_FILE_NO_DATA, +typedef enum : git_diff_flag_t { + GTDiffFileFlagValidOID = GIT_DIFF_FLAG_VALID_OID, + GTDiffFileFlagBinary = GIT_DIFF_FLAG_BINARY, + GTDiffFileFlagNotBinary = GIT_DIFF_FLAG_NOT_BINARY, } GTDiffFileFlag; // A class representing a file on one side of a diff.
Remove some diff file flags
mit
libgit2/objective-git,TOMalley104/objective-git,alehed/objective-git,pietbrauer/objective-git,nerdishbynature/objective-git,c9s/objective-git,misterfifths/objective-git,dleehr/objective-git,Acidburn0zzz/objective-git,phatblat/objective-git,dleehr/objective-git,blackpixel/objective-git,slavikus/objective-git,slavikus/objective-git,nerdishbynature/objective-git,dleehr/objective-git,pietbrauer/objective-git,libgit2/objective-git,misterfifths/objective-git,0x4a616e/objective-git,blackpixel/objective-git,c9s/objective-git,javiertoledo/objective-git,pietbrauer/objective-git,libgit2/objective-git,tiennou/objective-git,libgit2/objective-git,phatblat/objective-git,alehed/objective-git,tiennou/objective-git,TOMalley104/objective-git,phatblat/objective-git,0x4a616e/objective-git,blackpixel/objective-git,javiertoledo/objective-git,blackpixel/objective-git,alehed/objective-git,misterfifths/objective-git,misterfifths/objective-git,javiertoledo/objective-git,nerdishbynature/objective-git,c9s/objective-git,javiertoledo/objective-git,TOMalley104/objective-git,TOMalley104/objective-git,pietbrauer/objective-git,0x4a616e/objective-git,Acidburn0zzz/objective-git,c9s/objective-git,Acidburn0zzz/objective-git,tiennou/objective-git,slavikus/objective-git,dleehr/objective-git,Acidburn0zzz/objective-git
9d58853f5797b062e68509c2afcfe5375309d145
#ifndef __BYTESTREAM__ #define __BYTESTREAM__ #include <stdint.h> #include <unistd.h> #define BS_RO 0 #define BS_RW 1 // MAP_ANONYMOUS is MAP_ANON on OSX, so this will let us compile #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif typedef struct _ByteStream { char* filename; size_t size; uint8_t* data; uint32_t offset; int exhausted; } ByteStream; ByteStream* bsalloc(unsigned int size); ByteStream* bsmap(char* filename); int bsfree(ByteStream* bstream); void bsseek(ByteStream* bs, uint32_t offset); void bsreset(ByteStream* bs); unsigned int bsread(ByteStream* bs, uint8_t* buf, size_t size); unsigned int bsread_offset(ByteStream* bs, uint8_t* buf, size_t size, uint32_t offset); int bswrite(ByteStream* bs, uint8_t* data, unsigned int size); unsigned int bswrite_offset(ByteStream* bs, uint8_t* buf, size_t size, uint32_t offset); int bssave(ByteStream* bs, char* filename); #endif
#ifndef __BYTESTREAM__ #define __BYTESTREAM__ #include <stdint.h> #include <unistd.h> #define BS_RO 0 #define BS_RW 1 typedef struct _ByteStream { char* filename; size_t size; uint8_t* data; uint32_t offset; int exhausted; } ByteStream; ByteStream* bsalloc(unsigned int size); ByteStream* bsmap(char* filename); int bsfree(ByteStream* bstream); void bsseek(ByteStream* bs, uint32_t offset); void bsreset(ByteStream* bs); unsigned int bsread(ByteStream* bs, uint8_t* buf, size_t size); unsigned int bsread_offset(ByteStream* bs, uint8_t* buf, size_t size, uint32_t offset); int bswrite(ByteStream* bs, uint8_t* data, unsigned int size); unsigned int bswrite_offset(ByteStream* bs, uint8_t* buf, size_t size, uint32_t offset); int bssave(ByteStream* bs, char* filename); #endif
--- +++ @@ -6,6 +6,11 @@ #define BS_RO 0 #define BS_RW 1 + +// MAP_ANONYMOUS is MAP_ANON on OSX, so this will let us compile +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif typedef struct _ByteStream { char* filename;
Fix compilation on OSX MAP_ANONYMOUS is MAP_ANON on OSX, so this will let the project compile.
bsd-3-clause
strazzere/dexterity,rchiossi/dexterity,rchiossi/dexterity,rchiossi/dexterity,strazzere/dexterity,strazzere/dexterity
c13fa6ae63ef93364adc41d332eaa249f3585ec6
/* Copyright (C) 2003 Timo Sirainen */ #include "lib.h" #include "ioloop-internal.h" #ifdef IOLOOP_NOTIFY_NONE #undef io_add_notify struct io *io_add_notify(const char *path __attr_unused__, io_callback_t *callback __attr_unused__, void *context __attr_unused__) { return NULL; } void io_loop_notify_remove(struct ioloop *ioloop __attr_unused__, struct io *io __attr_unused__) { } void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__) { } #endif
/* Copyright (C) 2003 Timo Sirainen */ #include "lib.h" #include "ioloop-internal.h" #ifdef IOLOOP_NOTIFY_NONE struct io *io_loop_notify_add(struct ioloop *ioloop __attr_unused__, const char *path __attr_unused__, io_callback_t *callback __attr_unused__, void *context __attr_unused__) { return NULL; } void io_loop_notify_remove(struct ioloop *ioloop __attr_unused__, struct io *io __attr_unused__) { } void io_loop_notify_handler_init(struct ioloop *ioloop __attr_unused__) { } void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__) { } #endif
--- +++ @@ -5,10 +5,10 @@ #ifdef IOLOOP_NOTIFY_NONE -struct io *io_loop_notify_add(struct ioloop *ioloop __attr_unused__, - const char *path __attr_unused__, - io_callback_t *callback __attr_unused__, - void *context __attr_unused__) +#undef io_add_notify +struct io *io_add_notify(const char *path __attr_unused__, + io_callback_t *callback __attr_unused__, + void *context __attr_unused__) { return NULL; } @@ -18,10 +18,6 @@ { } -void io_loop_notify_handler_init(struct ioloop *ioloop __attr_unused__) -{ -} - void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__) { }
Fix for building without notify
mit
Distrotech/dovecot,Distrotech/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,damoxc/dovecot,Distrotech/dovecot,damoxc/dovecot,Distrotech/dovecot,Distrotech/dovecot
055d3f2df632ffe49a10bd83956755bb71dc1a61
/* StdAfx.h * * Copyright (C) 2013 Michael Imamura * * 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 _WIN32 # define VC_EXTRALEAN # define WIN32_LEAN_AND_MEAN # include <windows.h> #endif #include <math.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <list> #include <map> #include <memory> #include <sstream> #include <string> #include <vector> #include <utility> #include <SDL2/SDL.h> #include <SDL2/SDL_image.h> #include <SDL2/SDL_ttf.h>
/* StdAfx.h * * Copyright (C) 2013 Michael Imamura * * 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 _WIN32 # define VC_EXTRALEAN # define WIN32_LEAN_AND_MEAN # include <windows.h> #endif #include <math.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <list> #include <map> #include <memory> #include <string> #include <utility> #include <SDL2/SDL.h> #include <SDL2/SDL_image.h> #include <SDL2/SDL_ttf.h>
--- +++ @@ -32,7 +32,9 @@ #include <list> #include <map> #include <memory> +#include <sstream> #include <string> +#include <vector> #include <utility> #include <SDL2/SDL.h>
Add more common includes to PCH.
apache-2.0
ZoogieZork/Adventures-in-SDL2,ZoogieZork/Adventures-in-SDL2
00ce45e79a3abaf31a3861001b06107f461dcc90
/* This file is part of KDE Copyright (C) 2006 Christian Ehrlicher <ch.ehrlicher@gmx.de> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _KATE_EXPORT_H #define _KATE_EXPORT_H #include <kdemacros.h> #ifdef MAKE_KATEINTERFACES_LIB # define KATEINTERFACES_EXPORT KDE_EXPORT #else # if defined _WIN32 || defined _WIN64 # define KATEINTERFACES_EXPORT KDE_IMPORT # else # define KATEINTERFACES_EXPORT KDE_EXPORT # endif #endif #endif // _KATE_EXPORT_H
/* This file is part of KDE Copyright (C) 2006 Christian Ehrlicher <ch.ehrlicher@gmx.de> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _KDEBASE_EXPORT_H #define _KDEBASE_EXPORT_H #include <kdemacros.h> #ifdef MAKE_KATEINTERFACES_LIB # define KATEINTERFACES_EXPORT KDE_EXPORT #else # if defined _WIN32 || defined _WIN64 # define KATEINTERFACES_EXPORT KDE_IMPORT # else # define KATEINTERFACES_EXPORT KDE_EXPORT # endif #endif #endif // _KDEBASE_EXPORT_H
--- +++ @@ -17,8 +17,8 @@ Boston, MA 02110-1301, USA. */ -#ifndef _KDEBASE_EXPORT_H -#define _KDEBASE_EXPORT_H +#ifndef _KATE_EXPORT_H +#define _KATE_EXPORT_H #include <kdemacros.h> @@ -32,5 +32,5 @@ # endif #endif -#endif // _KDEBASE_EXPORT_H +#endif // _KATE_EXPORT_H
Replace the include guard too. svn path=/trunk/KDE/kdesdk/kate/; revision=636748
lgpl-2.1
hlamer/kate,cmacq2/kate,DickJ/kate,hlamer/kate,hlamer/kate,DickJ/kate,jfmcarreira/kate,sandsmark/kate,hlamer/kate,hlamer/kate,cmacq2/kate,hlamer/kate,hlamer/kate,hlamer/kate,DickJ/kate,jfmcarreira/kate,hlamer/kate,jfmcarreira/kate,sandsmark/kate,hlamer/kate,sandsmark/kate,DickJ/kate,cmacq2/kate,sandsmark/kate
3967214b04e7411c3ac17d17bc8f62be71193c03
#ifndef PROPOSER_H #define PROPOSER_H #include <boost/shared_ptr.hpp> #include <vector> #include <map> #include "proctor/detector.h" #include "proctor/database_entry.h" namespace pcl { namespace proctor { struct Candidate { std::string id; double votes; }; class Proposer { public: typedef boost::shared_ptr<Proposer> Ptr; typedef boost::shared_ptr<const Proposer> ConstPtr; typedef boost::shared_ptr<std::map<std::string, Entry> > DatabasePtr; typedef boost::shared_ptr<const std::map<std::string, Entry> > ConstDatabasePtr; Proposer() {} void setDatabase(const DatabasePtr database) { database_ = database; } virtual void getProposed(int max_num, Entry &query, std::vector<std::string> &input, std::vector<std::string> &output) = 0; virtual void selectBestCandidates(int max_num, vector<Candidate> &ballot, std::vector<std::string> &output); protected: DatabasePtr database_; }; } } #endif
#ifndef PROPOSER_H #define PROPOSER_H #include <boost/shared_ptr.hpp> #include <vector> #include <map> #include "proctor/detector.h" #include "proctor/database_entry.h" namespace pcl { namespace proctor { struct Candidate { std::string id; float votes; }; class Proposer { public: typedef boost::shared_ptr<Proposer> Ptr; typedef boost::shared_ptr<const Proposer> ConstPtr; typedef boost::shared_ptr<std::map<std::string, Entry> > DatabasePtr; typedef boost::shared_ptr<const std::map<std::string, Entry> > ConstDatabasePtr; Proposer() {} void setDatabase(const DatabasePtr database) { database_ = database; } virtual void getProposed(int max_num, Entry &query, std::vector<std::string> &input, std::vector<std::string> &output) = 0; virtual void selectBestCandidates(int max_num, vector<Candidate> &ballot, std::vector<std::string> &output); protected: DatabasePtr database_; }; } } #endif
--- +++ @@ -15,7 +15,7 @@ struct Candidate { std::string id; - float votes; + double votes; }; class Proposer {
Change votes to use double. git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@4320 a9d63959-f2ad-4865-b262-bf0e56cfafb6
bsd-3-clause
psoetens/pcl-svn,psoetens/pcl-svn,psoetens/pcl-svn,psoetens/pcl-svn,psoetens/pcl-svn
6be828419968fa1f105f7362832b4eafb2157ab6
#ifndef WSGI_VERSION_H #define WSGI_VERSION_H /* ------------------------------------------------------------------------- */ /* * Copyright 2007-2021 GRAHAM DUMPLETON * * 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. */ /* ------------------------------------------------------------------------- */ /* Module version information. */ #define MOD_WSGI_MAJORVERSION_NUMBER 4 #define MOD_WSGI_MINORVERSION_NUMBER 9 #define MOD_WSGI_MICROVERSION_NUMBER 1 #define MOD_WSGI_VERSION_STRING "4.9.1.dev1" /* ------------------------------------------------------------------------- */ #endif /* vi: set sw=4 expandtab : */
#ifndef WSGI_VERSION_H #define WSGI_VERSION_H /* ------------------------------------------------------------------------- */ /* * Copyright 2007-2021 GRAHAM DUMPLETON * * 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. */ /* ------------------------------------------------------------------------- */ /* Module version information. */ #define MOD_WSGI_MAJORVERSION_NUMBER 4 #define MOD_WSGI_MINORVERSION_NUMBER 9 #define MOD_WSGI_MICROVERSION_NUMBER 0 #define MOD_WSGI_VERSION_STRING "4.9.0" /* ------------------------------------------------------------------------- */ #endif /* vi: set sw=4 expandtab : */
--- +++ @@ -25,8 +25,8 @@ #define MOD_WSGI_MAJORVERSION_NUMBER 4 #define MOD_WSGI_MINORVERSION_NUMBER 9 -#define MOD_WSGI_MICROVERSION_NUMBER 0 -#define MOD_WSGI_VERSION_STRING "4.9.0" +#define MOD_WSGI_MICROVERSION_NUMBER 1 +#define MOD_WSGI_VERSION_STRING "4.9.1.dev1" /* ------------------------------------------------------------------------- */
Increment version to 4.9.1 for new development work.
apache-2.0
GrahamDumpleton/mod_wsgi,GrahamDumpleton/mod_wsgi,GrahamDumpleton/mod_wsgi
6ebd618ef522838e0478ebacfc60adc7ecc9d8fa
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \ (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8)) #define PT_DISPATCH_RETAIN_RELEASE 1 #else #define PT_DISPATCH_RETAIN_RELEASE 0 #endif #if PT_DISPATCH_RETAIN_RELEASE #define PT_PRECISE_LIFETIME #define PT_PRECISE_LIFETIME_UNUSED #else #define PT_PRECISE_LIFETIME __attribute__((objc_precise_lifetime)) #define PT_PRECISE_LIFETIME_UNUSED __attribute__((objc_precise_lifetime, unused)) #endif
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \ (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8)) #define PT_DISPATCH_RETAIN_RELEASE 1 #endif #if (!defined(PT_DISPATCH_RETAIN_RELEASE)) #define PT_PRECISE_LIFETIME __attribute__((objc_precise_lifetime)) #define PT_PRECISE_LIFETIME_UNUSED __attribute__((objc_precise_lifetime, unused)) #else #define PT_PRECISE_LIFETIME #define PT_PRECISE_LIFETIME_UNUSED #endif
--- +++ @@ -1,12 +1,14 @@ #if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (!defined(__IPHONE_6_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0)) || \ (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (!defined(__MAC_10_8) || __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8)) #define PT_DISPATCH_RETAIN_RELEASE 1 +#else +#define PT_DISPATCH_RETAIN_RELEASE 0 #endif -#if (!defined(PT_DISPATCH_RETAIN_RELEASE)) +#if PT_DISPATCH_RETAIN_RELEASE +#define PT_PRECISE_LIFETIME +#define PT_PRECISE_LIFETIME_UNUSED +#else #define PT_PRECISE_LIFETIME __attribute__((objc_precise_lifetime)) #define PT_PRECISE_LIFETIME_UNUSED __attribute__((objc_precise_lifetime, unused)) -#else -#define PT_PRECISE_LIFETIME -#define PT_PRECISE_LIFETIME_UNUSED #endif
Synchronize logical grouping of defines
mit
rsms/peertalk,rsms/peertalk,rsms/peertalk
56a77a274be12217e07ca8c4b5e2dabdac3c0c2b
/** @file GUID for hardware error record variables. Copyright (c) 2007 - 2009, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. @par Revision Reference: GUID defined in UEFI 2.1. **/ #ifndef _HARDWARE_ERROR_VARIABLE_GUID_H_ #define _HARDWARE_ERROR_VARIABLE_GUID_H_ #define EFI_HARDWARE_ERROR_VARIABLE \ { \ 0x414E6BDD, 0xE47B, 0x47cc, {0xB2, 0x44, 0xBB, 0x61, 0x02, 0x0C, 0xF5, 0x16} \ } extern EFI_GUID gEfiHardwareErrorVariableGuid; #endif
/** @file GUID for hardware error record variables. Copyright (c) 2007 - 2009, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: HardwareErrorVariable.h @par Revision Reference: GUID defined in UEFI 2.1. **/ #ifndef _HARDWARE_ERROR_VARIABLE_GUID_H_ #define _HARDWARE_ERROR_VARIABLE_GUID_H_ #define EFI_HARDWARE_ERROR_VARIABLE \ { \ 0x414E6BDD, 0xE47B, 0x47cc, {0xB2, 0x44, 0xBB, 0x61, 0x02, 0x0C, 0xF5, 0x16} \ } extern EFI_GUID gEfiHardwareErrorVariableGuid; #endif
--- +++ @@ -9,8 +9,6 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - Module Name: HardwareErrorVariable.h @par Revision Reference: GUID defined in UEFI 2.1.
Remove "Module Name:" from include file headers. git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@8895 6f19259b-4bc3-4df7-8a09-765794883524
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
e412c7c88f74bd962509e1c24b1611b909b58b99
// RUN: %clang_cc1 -triple armv7-apple-darwin9 -emit-llvm -w -o - %s | FileCheck %s #include <stdint.h> #define ldrex_func(p, rl, rh) \ __asm__ __volatile__( \ "ldrexd%[_rl], %[_rh], [%[_p]]" \ : [_rl] "=&r" (rl), [_rh] "=&r" (rh) \ : [_p] "p" (p) : "memory") int64_t foo(int64_t v, volatile int64_t *p) { register uint32_t rl asm("r1"); register uint32_t rh asm("r2"); int64_t r; uint32_t t; __asm__ __volatile__( \ "ldrexd%[_rl], %[_rh], [%[_p]]" \ : [_rl] "=&r" (rl), [_rh] "=&r" (rh) \ : [_p] "p" (p) : "memory"); // CHECK: %0 = call %0 asm sideeffect "ldrexd$0, $1, [$2]", "={r1},={r2},r,~{memory}"(i64* return r; }
// RUN: %clang_cc1 -triple armv7-apple-darwin9 -emit-llvm -w -o - %s | FileCheck %s #include <stdint.h> #define ldrex_func(p, rl, rh) \ __asm__ __volatile__( \ "ldrexd%[_rl], %[_rh], [%[_p]]" \ : [_rl] "=&r" (rl), [_rh] "=&r" (rh) \ : [_p] "p" (p) : "memory") int64_t foo(int64_t v, volatile int64_t *p) { register uint32_t rl asm("r1"); register uint32_t rh asm("r2"); int64_t r; uint32_t t; __asm__ __volatile__( \ "ldrexd%[_rl], %[_rh], [%[_p]]" \ : [_rl] "=&r" (rl), [_rh] "=&r" (rh) \ : [_p] "p" (p) : "memory"); // CHECK: %0 = call %0 asm sideeffect "ldrexd$0, $1, [$2]", "={r1},={r2},r,~{memory}"(i64* %tmp) return r; }
--- +++ @@ -20,7 +20,7 @@ : [_rl] "=&r" (rl), [_rh] "=&r" (rh) \ : [_p] "p" (p) : "memory"); - // CHECK: %0 = call %0 asm sideeffect "ldrexd$0, $1, [$2]", "={r1},={r2},r,~{memory}"(i64* %tmp) + // CHECK: %0 = call %0 asm sideeffect "ldrexd$0, $1, [$2]", "={r1},={r2},r,~{memory}"(i64* return r; }
Make this test suitable for optimized builds by avoiding the name. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@133238 91177308-0d34-0410-b5e6-96231b3b80d8
apache-2.0
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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
b165ed7f282b736bb7fe9fa5e98455a437d23fa4
#ifndef INTERRUPTS_H #define INTERRUPTS_H #include "types.h" namespace interrupts { // Enable interrupts on the CPU. inline void enable() { asm volatile("sti"); } // Enable interrupts on the CPU. inline void disable() { asm volatile("cli"); } struct Registers { u32 gs, fs, es, ds; // Segment registers. u32 edi, esi, ebp, esp, ebx, edx, ecx, eax; // From 'pusha' instruction. u32 interruptNum; u32 eip, cs, eflags, useresp, ss; // Pushed by CPU on interrupt. }; using IrqHandlerFn = void (*)(Registers*); void setIrqHandler(u32 irqNum, IrqHandlerFn handlerFn); void init(); void remapPic(); extern "C" void interruptHandler(Registers* regs); } // namespace interrupts #endif
#ifndef INTERRUPTS_H #define INTERRUPTS_H #include "types.h" namespace interrupts { // Enable interrupts on the CPU. inline void enable() { asm volatile("sti"); } // Enable interrupts on the CPU. inline void disable() { asm volatile("cli"); } struct Registers { u32 gs, fs, es, ds; // Segment registers. u32 edi, esi, ebp, esp, ebx, edx, ecx, eax; // From 'pusha' instruction. u32 interruptNum; u32 eip, cs, eflags, useresp, ss; // Pushed by CPU on interrupt. }; using IrqHandlerFn = void (*)(Registers*); void setIrqHandler(u32 irqNum, IrqHandlerFn handlerFn); void init(); void initIsrs(); void initIrqs(); void remapPic(); extern "C" void interruptHandler(Registers* regs); } // namespace interrupts #endif
--- +++ @@ -26,8 +26,6 @@ void setIrqHandler(u32 irqNum, IrqHandlerFn handlerFn); void init(); -void initIsrs(); -void initIrqs(); void remapPic(); extern "C" void interruptHandler(Registers* regs);
Remove prototypes for removed functions.
isc
tsion/spideros,tsion/spideros,tsion/spideros
394d5c9d3ae0f8e3ff40ae98a3eeab43004c85e6