commit
stringlengths 40
40
| old_file
stringlengths 4
112
| new_file
stringlengths 4
112
| old_contents
stringlengths 0
2.05k
| new_contents
stringlengths 28
3.9k
| subject
stringlengths 17
736
| message
stringlengths 18
4.78k
| lang
stringclasses 1
value | license
stringclasses 13
values | repos
stringlengths 7
111k
|
---|---|---|---|---|---|---|---|---|---|
014e6504992271d144324e1fe8600c18ba84ebe7 | nrf5/boards/pca10001/nrf51_hal_conf.h | nrf5/boards/pca10001/nrf51_hal_conf.h | #ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#endif // NRF51_HAL_CONF_H__
| #ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
// #define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#endif // NRF51_HAL_CONF_H__
| Disable SPI hal from pca10001 board. | nrf5/boards: Disable SPI hal from pca10001 board.
| C | mit | adafruit/circuitpython,adafruit/circuitpython,adafruit/micropython,adafruit/circuitpython,adafruit/circuitpython,tralamazza/micropython,adafruit/micropython,adafruit/circuitpython,tralamazza/micropython,adafruit/circuitpython,adafruit/micropython,adafruit/micropython,tralamazza/micropython,adafruit/micropython,tralamazza/micropython |
5de3f975f46103e730e35a92323f9cdb15b13c9d | bot/src/plugins/tracredir.c | bot/src/plugins/tracredir.c | /*
* This file is part of the beirdobot package
* Copyright (C) 2012 Raymond Wagner
*
* This plugin uses code gratuitously stolen from the 'fart' plugin.
* See that for any real licensing information.
*/
/*HEADER---------------------------------------------------
* $Id$
*
* Copyright 2012 Raymond Wagner
* All rights reserved
*/
/* INCLUDE FILES */
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "botnet.h"
#include "environment.h"
#include "structs.h"
#include "protos.h"
#include "logging.h"
/* INTERNAL FUNCTION PROTOTYPES */
void regexpFuncTrac( IRCServer_t *server, IRCChannel_t *channel, char *who,
char *msg, IRCMsgType_t type, int *ovector, int ovecsize,
void *tag );
/* CVS generated ID string */
static char ident[] _UNUSED_ =
"$Id$";
static char *contentRegexp = "(?i)(?:\\B|\\s|^)#(\\d+)(?:\\s|\\.|,|$)";
void plugin_initialize( char *args )
{
LogPrintNoArg( LOG_NOTICE, "Initializing trac redirect..." );
regexp_add( NULL, (const char *)contentRegexp, regexpFuncTrac, NULL );
}
void plugin_shutdown( void )
{
LogPrintNoArg( LOG_NOTICE, "Removing trac redirect..." );
regexp_remove( NULL, contentRegexp );
}
void regexpFuncTrac( IRCServer_t *server, IRCChannel_t *channel, char *who,
char *msg, IRCMsgType_t type, int *ovector, int ovecsize,
void *tag )
{
char *message, *ticketid;
if( !channel ) {
return;
}
ticketid = regexp_substring( msg, ovector, ovecsize, 1 );
if (ticketid)
{
message = (char *)malloc(35+strlen(ticketid)+2);
sprintf( message, "http://code.mythtv.org/trac/ticket/%s", ticketid );
LoggedActionMessage( server, channel, message );
free(ticketid);
free(message);
}
}
/*
* vim:ts=4:sw=4:ai:et:si:sts=4
*/
| Add a new trac redirect plugin | Add a new trac redirect plugin
At this time, it is specific to mythtv use, but it can easily be extended to
use different urls per channel. Minor changes were made to make it function
properly.
Thank you, Raymond.
| C | lgpl-2.1 | Beirdo/beirdobot,Beirdo/beirdobot,Beirdo/beirdobot,Beirdo/beirdobot,Beirdo/beirdobot,Beirdo/beirdobot,Beirdo/beirdobot,Beirdo/beirdobot |
|
92ef198213e7e5881877be5d79516046cc1e59b5 | example1/Example1.h | example1/Example1.h | /*
* Copyright (C) Sometrik oy 2015
*
*/
#include <FWContextBase.h>
#include <AndroidPlatform.h>
class Example1 : public FWContextBase {
public:
Example1(AndroidPlatform * _platform) : FWContextBase(_platform), platform(_platform) { }
bool Init();
void onDraw();
void onShutdown();
private:
AndroidPlatform * platform;
};
| /*
* Copyright (C) Sometrik oy 2015
*
*/
#include <FWContextBase.h>
#include <FWPlatformBase.h>
class Example1 : public FWContextBase {
public:
Example1(FWPlatformBase * _platform) : FWContextBase(_platform), platform(_platform) { }
bool Init();
void onDraw();
void onShutdown();
private:
FWPlatformBase * platform;
};
| Change AndroidPlatform variables to FWPlatformBase, switch include | Change AndroidPlatform variables to FWPlatformBase, switch include | C | mit | Sometrik/framework,Sometrik/framework,Sometrik/framework |
b3e4a879a534add27e8435b11628d4d79d706434 | libc/sysdeps/linux/m68k/ptrace.c | libc/sysdeps/linux/m68k/ptrace.c |
#include <errno.h>
#include <asm/ptrace.h>
#include <sys/syscall.h>
int
ptrace(int request, int pid, int addr, int data)
{
long ret;
long res;
if (request > 0 && request < 4) (long *)data = &ret;
__asm__ volatile ("movel %1,%/d0\n\t"
"movel %2,%/d1\n\t"
"movel %3,%/d2\n\t"
"movel %4,%/d3\n\t"
"movel %5,%/d4\n\t"
"trap #0\n\t"
"movel %/d0,%0"
:"=g" (res)
:"i" (__NR_ptrace), "g" (request), "g" (pid),
"g" (addr), "g" (data) : "%d0", "%d1", "%d2", "%d3", "%d4");
if (res >= 0) {
if (request > 0 && request < 4) {
__set_errno(0);
return (ret);
}
return (int) res;
}
__set_errno(-res);
return -1;
}
|
#include <errno.h>
#include <asm/ptrace.h>
#include <sys/syscall.h>
int
ptrace(int request, int pid, int addr, int data)
{
long ret;
long res;
if (request > 0 && request < 4) data = (int)&ret;
__asm__ volatile ("movel %1,%/d0\n\t"
"movel %2,%/d1\n\t"
"movel %3,%/d2\n\t"
"movel %4,%/d3\n\t"
"movel %5,%/d4\n\t"
"trap #0\n\t"
"movel %/d0,%0"
:"=g" (res)
:"i" (__NR_ptrace), "g" (request), "g" (pid),
"g" (addr), "g" (data) : "%d0", "%d1", "%d2", "%d3", "%d4");
if (res >= 0) {
if (request > 0 && request < 4) {
__set_errno(0);
return (ret);
}
return (int) res;
}
__set_errno(-res);
return -1;
}
| Patch from Bernardo Innocenti: Remove use of cast-as-l-value extension, removed in GCC 3.5. | Patch from Bernardo Innocenti:
Remove use of cast-as-l-value extension, removed in GCC 3.5.
| C | lgpl-2.1 | kraj/uClibc,ysat0/uClibc,majek/uclibc-vx32,atgreen/uClibc-moxie,ffainelli/uClibc,skristiansson/uClibc-or1k,ddcc/klee-uclibc-0.9.33.2,groundwater/uClibc,skristiansson/uClibc-or1k,wbx-github/uclibc-ng,ChickenRunjyd/klee-uclibc,hjl-tools/uClibc,OpenInkpot-archive/iplinux-uclibc,ysat0/uClibc,czankel/xtensa-uclibc,kraj/uClibc,ChickenRunjyd/klee-uclibc,brgl/uclibc-ng,klee/klee-uclibc,hjl-tools/uClibc,hwoarang/uClibc,wbx-github/uclibc-ng,czankel/xtensa-uclibc,ChickenRunjyd/klee-uclibc,skristiansson/uClibc-or1k,ndmsystems/uClibc,foss-xtensa/uClibc,foss-xtensa/uClibc,hjl-tools/uClibc,brgl/uclibc-ng,waweber/uclibc-clang,hwoarang/uClibc,foss-xtensa/uClibc,groundwater/uClibc,ndmsystems/uClibc,hjl-tools/uClibc,ysat0/uClibc,hwoarang/uClibc,hwoarang/uClibc,brgl/uclibc-ng,gittup/uClibc,kraj/uclibc-ng,OpenInkpot-archive/iplinux-uclibc,ndmsystems/uClibc,majek/uclibc-vx32,OpenInkpot-archive/iplinux-uclibc,mephi42/uClibc,ffainelli/uClibc,ndmsystems/uClibc,waweber/uclibc-clang,wbx-github/uclibc-ng,wbx-github/uclibc-ng,klee/klee-uclibc,gittup/uClibc,ddcc/klee-uclibc-0.9.33.2,OpenInkpot-archive/iplinux-uclibc,kraj/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,klee/klee-uclibc,czankel/xtensa-uclibc,foss-for-synopsys-dwc-arc-processors/uClibc,m-labs/uclibc-lm32,gittup/uClibc,skristiansson/uClibc-or1k,groundwater/uClibc,kraj/uClibc,m-labs/uclibc-lm32,kraj/uClibc,groundwater/uClibc,groundwater/uClibc,kraj/uclibc-ng,mephi42/uClibc,klee/klee-uclibc,atgreen/uClibc-moxie,brgl/uclibc-ng,mephi42/uClibc,waweber/uclibc-clang,ysat0/uClibc,foss-xtensa/uClibc,ffainelli/uClibc,kraj/uclibc-ng,atgreen/uClibc-moxie,ddcc/klee-uclibc-0.9.33.2,foss-for-synopsys-dwc-arc-processors/uClibc,ffainelli/uClibc,waweber/uclibc-clang,czankel/xtensa-uclibc,m-labs/uclibc-lm32,ChickenRunjyd/klee-uclibc,majek/uclibc-vx32,foss-for-synopsys-dwc-arc-processors/uClibc,ffainelli/uClibc,hjl-tools/uClibc,atgreen/uClibc-moxie,gittup/uClibc,majek/uclibc-vx32,m-labs/uclibc-lm32,ddcc/klee-uclibc-0.9.33.2,mephi42/uClibc |
91bbb7ce560f5915715b750baa858501f505d988 | cmd/smyrna/gui/topviewsettings.c | cmd/smyrna/gui/topviewsettings.c | #include "topviewsettings.h"
#include "gui.h"
void on_settingsOKBtn_clicked (GtkWidget *widget,gpointer user_data)
{
}
void on_settingsCancelBtn_clicked (GtkWidget *widget,gpointer user_data)
{
}
int load_settings_from_graph(Agraph_t *g)
{
return 1;
}
int update_graph_from_settings(Agraph_t *g)
{
return 1;
}
int show_settings_form()
{
gtk_widget_hide(glade_xml_get_widget(xml, "dlgSettings"));
gtk_widget_show(glade_xml_get_widget(xml, "dlgSettings"));
gtk_window_set_keep_above ((GtkWindow*)glade_xml_get_widget(xml, "dlgSettings"),1);
}
| /* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp. *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Corp. *
* *
* Information and Software Systems Research *
* AT&T Research, Florham Park NJ *
**********************************************************/
#include "topviewsettings.h"
#include "gui.h"
void on_settingsOKBtn_clicked(GtkWidget * widget, gpointer user_data)
{
}
void on_settingsCancelBtn_clicked(GtkWidget * widget, gpointer user_data)
{
}
int load_settings_from_graph(Agraph_t * g)
{
return 1;
}
int update_graph_from_settings(Agraph_t * g)
{
return 1;
}
int show_settings_form()
{
gtk_widget_hide(glade_xml_get_widget(xml, "dlgSettings"));
gtk_widget_show(glade_xml_get_widget(xml, "dlgSettings"));
gtk_window_set_keep_above((GtkWindow *)
glade_xml_get_widget(xml, "dlgSettings"), 1);
}
| Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings | Clean up smyrna files:
remove unnecessary globals
modify libraries not to rely on code in cmd/smyrna
remove static declarations from .h files
remove unnecessary libraries
mark unused code and clean up warnings
| C | epl-1.0 | tkelman/graphviz,jho1965us/graphviz,pixelglow/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,ellson/graphviz,pixelglow/graphviz,BMJHayward/graphviz,ellson/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,jho1965us/graphviz,kbrock/graphviz,tkelman/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,pixelglow/graphviz,tkelman/graphviz,jho1965us/graphviz,jho1965us/graphviz,pixelglow/graphviz,kbrock/graphviz,pixelglow/graphviz,jho1965us/graphviz,BMJHayward/graphviz,tkelman/graphviz,ellson/graphviz,jho1965us/graphviz,jho1965us/graphviz,ellson/graphviz,jho1965us/graphviz,pixelglow/graphviz,kbrock/graphviz,ellson/graphviz,jho1965us/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,pixelglow/graphviz,kbrock/graphviz,kbrock/graphviz,tkelman/graphviz,kbrock/graphviz,BMJHayward/graphviz,ellson/graphviz,pixelglow/graphviz,ellson/graphviz,jho1965us/graphviz,ellson/graphviz,kbrock/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,pixelglow/graphviz,pixelglow/graphviz,ellson/graphviz,tkelman/graphviz,kbrock/graphviz,BMJHayward/graphviz,kbrock/graphviz,BMJHayward/graphviz,tkelman/graphviz,MjAbuz/graphviz,MjAbuz/graphviz,ellson/graphviz,kbrock/graphviz,MjAbuz/graphviz,tkelman/graphviz,tkelman/graphviz,MjAbuz/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,tkelman/graphviz,pixelglow/graphviz,BMJHayward/graphviz |
c1a36603d5e603828cdae9068987cc58e625fc3b | arduino/OpenROV/Settings.h | arduino/OpenROV/Settings.h |
#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"
// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#define CAMERAMOUNT_PIN 3
#define CAPE_VOLTAGE_PIN 0
#define CAPE_CURRENT_PIN 3
//After Market:
#define HAS_STD_CALIBRATIONLASERS (0)
#define CALIBRATIONLASERS_PIN 6
#define HAS_POLOLU_MINIMUV (1)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76
#define MIDPOINT 1500
#define LOGGING (1)
class Settings : public Device {
public:
static int smoothingIncriment; //How aggressive the throttle changes
static int deadZone_min;
static int deadZone_max;
static int capability_bitarray;
Settings():Device(){};
void device_setup();
void device_loop(Command cmd);
};
#endif
|
#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"
// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#define CAMERAMOUNT_PIN 3
#define CAPE_VOLTAGE_PIN 0
#define CAPE_CURRENT_PIN 3
//After Market:
#define HAS_STD_CALIBRATIONLASERS (0)
#define CALIBRATIONLASERS_PIN 6
#define HAS_POLOLU_MINIMUV (0)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76
#define MIDPOINT 1500
#define LOGGING (1)
class Settings : public Device {
public:
static int smoothingIncriment; //How aggressive the throttle changes
static int deadZone_min;
static int deadZone_max;
static int capability_bitarray;
Settings():Device(){};
void device_setup();
void device_loop(Command cmd);
};
#endif
| Reset default settings to stock kit configuration | Reset default settings to stock kit configuration
| C | mit | codewithpassion/openrov-software,codewithpassion/openrov-software,codewithpassion/openrov-software,codewithpassion/openrov-software |
63b7048e85bb947d1ef2cdd2f6a1fd6c436509c9 | src/grid.c | src/grid.c | #include <string.h>
#include "window.h"
#include "grid.h"
#include "utils.h"
extern window_settings_t win_set;
void print_grid(WINDOW *win)
{
getmaxyx(win, win_set.maxGridHeight, win_set.maxGridWidth);
// If the grid is larger than the maximum height
// or width, then set it to max height or width
if (g.y_grid > win_set.maxGridHeight)
g.y_grid = win_set.maxGridHeight;
if (g.x_grid > win_set.maxGridWidth)
g.x_grid = win_set.maxGridWidth;
int32_t y_grid_step = win_set.maxGridHeight / g.y_grid;
int32_t x_grid_step = win_set.maxGridWidth / g.x_grid;
int32_t y_max_height = y_grid_step * g.y_grid;
int32_t x_max_height = x_grid_step * g.x_grid;
for(int32_t y=0;y<=y_max_height;y+=y_grid_step)
for(int32_t x=0;x<=x_max_height;x+=x_grid_step)
color_str(win, y, x, 0, 0, "O");
wnoutrefresh(win);
}
| #include <string.h>
#include "window.h"
#include "grid.h"
#include "utils.h"
extern window_settings_t win_set;
void print_grid(WINDOW *win)
{
getmaxyx(win, win_set.maxGridHeight, win_set.maxGridWidth);
// If the grid is larger than the maximum height
// or width, then set it to max height or width
if (g.y_grid > win_set.maxGridHeight)
g.y_grid = win_set.maxGridHeight;
if (g.x_grid > win_set.maxGridWidth)
g.x_grid = win_set.maxGridWidth;
int32_t y_grid_step = win_set.maxGridHeight / g.y_grid;
int32_t x_grid_step = win_set.maxGridWidth / g.x_grid;
int32_t y_max_height = y_grid_step * g.y_grid;
int32_t x_max_height = x_grid_step * g.x_grid;
for(int32_t y=0;y<=y_max_height;y+=y_grid_step)
for(int32_t x=0;x<=x_max_height;x+=x_grid_step)
color_str(win, y, x, 0, 0, "+");
wnoutrefresh(win);
}
| Change print symbol from O to +. | Change print symbol from O to +.
| C | mit | svagionitis/gridNcurses,svagionitis/gridNcurses,svagionitis/gridNcurses |
36d168bf9dc874df19c90dccc2611b5ecf6343be | obexd/plugins/messages-tracker.c | obexd/plugins/messages-tracker.c | /*
*
* OBEX Server
*
* Copyright (C) 2010-2011 Nokia Corporation
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <errno.h>
#include "messages.h"
int messages_init(void)
{
return 0;
}
void messages_exit(void)
{
}
int messages_connect(void **s)
{
*s = NULL;
return 0;
}
void messages_disconnect(void *s)
{
}
int messages_set_notification_registration(void *session,
void (*send_event)(void *session,
struct messages_event *event, void *user_data),
void *user_data)
{
return -EINVAL;
}
int messages_set_folder(void *s, const char *name, gboolean cdup)
{
return -EINVAL;
}
int messages_get_folder_listing(void *session,
const char *name,
uint16_t max, uint16_t offset,
void (*callback)(void *session, int err, uint16_t size,
const char *name, void *user_data),
void *user_data)
{
return -EINVAL;
}
int messages_get_messages_listing(void *session,
const char *name,
uint16_t max, uint16_t offset, struct messages_filter *filter,
void (*callback)(void *session, int err, uint16_t size,
gboolean newmsg, const struct messages_message *message,
void *user_data),
void *user_data)
{
return -EINVAL;
}
int messages_get_message(void *session,
const char *handle,
unsigned long flags,
void (*callback)(void *session, int err, gboolean fmore,
const char *chunk, void *user_data),
void *user_data)
{
return -EINVAL;
}
void messages_abort(void *session)
{
}
| Add tracker backend stump for MAP | obexd: Add tracker backend stump for MAP
| C | lgpl-2.1 | silent-snowman/bluez,silent-snowman/bluez,pkarasev3/bluez,silent-snowman/bluez,pkarasev3/bluez,mapfau/bluez,pstglia/external-bluetooth-bluez,pkarasev3/bluez,pstglia/external-bluetooth-bluez,ComputeCycles/bluez,mapfau/bluez,ComputeCycles/bluez,pstglia/external-bluetooth-bluez,mapfau/bluez,silent-snowman/bluez,pkarasev3/bluez,ComputeCycles/bluez,mapfau/bluez,pstglia/external-bluetooth-bluez,ComputeCycles/bluez |
|
6f2ab9593f143abb6b517ad89da37fe9d3c5d209 | c_solutions_1-10/Euler_4.c | c_solutions_1-10/Euler_4.c | #include "euler_util.h"
#include <string.h>
#define MAX 7
int main(int argc, char *argv[])
{
float start = timeit();
char *forward = calloc(sizeof(char), sizeof(char) * MAX);
char *backward = calloc(sizeof(char), sizeof(char) * MAX);
size_t int_len;
int high = 0;
for (int x=100; x < 1000; x++) {
for (int y=100; y < 1000; y++) {
int_len = snprintf(forward, MAX, "%d", x * y);
for (int i=0, str_len=int_len-1; i < int_len; i++, str_len--)
backward[i] = forward[str_len];
if (strcmp(forward, backward) == 0 && atoi(backward) > high)
high = atoi(backward);
}
}
free(forward);
free(backward);
float stop = timeit();
printf("Answer: %d\n", high);
printf("Time: %.8f\n", stop - start);
return 0;
}
| #include "euler_util.h"
#include <string.h>
#define MAX 7
int main(int argc, char *argv[])
{
float start = timeit();
char product[MAX] = { '\0' };
int high = 0;
for (int x=100; x < 1000; x++) {
for (int y=x; y < 1000; y++) {
int canidate = x * y;
size_t int_len = snprintf(product, MAX, "%d", canidate);
int head = 0, tail = int_len - 1;
for (;head < tail && product[head] == product[tail]; head++, tail--)
;
if (head > tail && canidate > high)
high = canidate;
}
}
float stop = timeit();
printf("Answer: %d\n", high);
printf("Time: %.8f\n", stop - start);
return 0;
}
| Improve loop (avg. from ~0.15 to ~0.07) | Improve loop (avg. from ~0.15 to ~0.07)
| C | mit | tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler,tijko/Project-Euler |
fae7949017389ee7c127883fdfcd3672f98e2fc3 | event/timeout_queue.h | event/timeout_queue.h | #ifndef TIMEOUT_QUEUE_H
#define TIMEOUT_QUEUE_H
#include <map>
class TimeoutQueue {
typedef std::map<NanoTime, CallbackQueue> timeout_map_t;
LogHandle log_;
timeout_map_t timeout_queue_;
public:
TimeoutQueue(void)
: log_("/event/timeout/queue"),
timeout_queue_()
{ }
~TimeoutQueue()
{ }
bool empty(void) const
{
timeout_map_t::const_iterator it;
/*
* Since we allow elements within each CallbackQueue to be
* cancelled, we must scan them.
*
* XXX
* We really shouldn't allow this, even if it means we have
* to specialize CallbackQueue for this purpose or add
* virtual methods to it. As it is, we can return true
* for empty and for ready at the same time. And in those
* cases we have to call perform to garbage collect the
* unused CallbackQueues. We'll, quite conveniently,
* never make that call. Yikes.
*/
for (it = timeout_queue_.begin(); it != timeout_queue_.end(); ++it) {
if (it->second.empty())
continue;
return (false);
}
return (true);
}
Action *append(uintmax_t, SimpleCallback *);
uintmax_t interval(void) const;
void perform(void);
bool ready(void) const;
};
#endif /* !TIMEOUT_QUEUE_H */
| #ifndef TIMEOUT_QUEUE_H
#define TIMEOUT_QUEUE_H
#include <map>
#include <common/time/time.h>
class TimeoutQueue {
typedef std::map<NanoTime, CallbackQueue> timeout_map_t;
LogHandle log_;
timeout_map_t timeout_queue_;
public:
TimeoutQueue(void)
: log_("/event/timeout/queue"),
timeout_queue_()
{ }
~TimeoutQueue()
{ }
bool empty(void) const
{
timeout_map_t::const_iterator it;
/*
* Since we allow elements within each CallbackQueue to be
* cancelled, we must scan them.
*
* XXX
* We really shouldn't allow this, even if it means we have
* to specialize CallbackQueue for this purpose or add
* virtual methods to it. As it is, we can return true
* for empty and for ready at the same time. And in those
* cases we have to call perform to garbage collect the
* unused CallbackQueues. We'll, quite conveniently,
* never make that call. Yikes.
*/
for (it = timeout_queue_.begin(); it != timeout_queue_.end(); ++it) {
if (it->second.empty())
continue;
return (false);
}
return (true);
}
Action *append(uintmax_t, SimpleCallback *);
uintmax_t interval(void) const;
void perform(void);
bool ready(void) const;
};
#endif /* !TIMEOUT_QUEUE_H */
| Use new NanoTime location header, oops. | Use new NanoTime location header, oops.
| C | bsd-2-clause | wanproxy/wanproxy,wanproxy/wanproxy,wanproxy/wanproxy |
5d02ce6786c9b7bd1f434826c4929b4233b5ae58 | readline.h | readline.h | #ifndef READLINE_FALLBACK_H
#define READLINE_FALLBACK_H
#include <stdio.h>
#include <string.h>
char* readline(const char * prompt) {
char *result = malloc(1);
size_t n = 0;
printf("%s", prompt);
getline(&result, &n, stdin);
result[strlen(result)-1] = 0;
return result;
}
#endif /* READLINE_FALLBACK_H */
| #ifndef READLINE_FALLBACK_H
#define READLINE_FALLBACK_H
#include <stdio.h>
#include <string.h>
char* readline(const char * prompt) {
char *result = malloc(1024);
printf("%s", prompt);
fgets(result, 1023, stdin);
result[strlen(result)-1] = 0;
return result;
}
#endif /* READLINE_FALLBACK_H */
| Use fgets(3) instead of getline(3) because whilst getline(3) is POSIX, it is not in the C89 or later standards | Use fgets(3) instead of getline(3) because whilst getline(3) is POSIX, it is not in the C89 or later standards
| C | isc | lucasad/base-conv |
b7b27486d7066853dcf0fa325dd2d542167bb042 | src/lib/fmt/fmt_escapecharxml.c | src/lib/fmt/fmt_escapecharxml.c | #include "fmt.h"
size_t fmt_escapecharxml(char* dest,uint32_t ch) {
char a[FMT_LONG], b[FMT_XLONG];
const char* s;
size_t i,j;
switch (ch) {
case '&': s="&"; goto string;
case '<': s="<"; goto string;
case '>': s=">"; goto string;
case '\'': s="'"; goto string;
case '"': s="""; goto string;
default:
a[i=fmt_ulong(a,ch)]=0;
b[0]='x';
b[j=fmt_xlong(b+1,ch)+1]=0;
s=a;
if (i>j) { s=b; i=j; }
if (dest) {
dest[0]='&';
dest[1]='#';
byte_copy(dest+2,i,s);
dest[i+2]=';';
}
return i+3;
}
string:
return fmt_str(dest,s);
}
#ifdef __GNUC__
size_t fmt_escapecharhtml(char* dest,uint32_t ch) __attribute__((__alias__("fmt_escapecharxml")));
#endif
| #include "fmt.h"
size_t fmt_escapecharxml(char* dest,uint32_t ch) {
char a[FMT_LONG], b[FMT_XLONG];
const char* s;
size_t i,j;
switch (ch) {
case '&': s="&"; goto string;
case '<': s="<"; goto string;
case '>': s=">"; goto string;
case '\'': s="'"; goto string;
case '"': s="""; goto string;
default:
a[i=fmt_ulong(a,ch)]=0;
b[0]='x';
b[j=fmt_xlong(b+1,ch)+1]=0;
s=a;
if (i>j) { s=b; i=j; }
if (dest) {
dest[0]='&';
dest[1]='#';
byte_copy(dest+2,i,s);
dest[i+2]=';';
}
return i+3;
}
string:
return fmt_str(dest,s);
}
#if defined(__GNUC__) && !defined(__llvm__)
size_t fmt_escapecharhtml(char* dest,uint32_t ch) __attribute__((__alias__("fmt_escapecharxml")));
#endif
| Choose only gcc to execute a specific portion of code | fmt: Choose only gcc to execute a specific portion of code
The specific portion of the code needs to be executed by a gcc
compiler, for that reason is used the __GNUC__ macro. It appears,
that the LLVM compiler, which uses the __llvm__ macro, uses as well
the __GNUC__ macro (possible for compatibility???).
This change check if the __llvm__ is check as well, and if it is
the code is not executed.
Issue: https://github.com/svagionitis/cross-platform-code/issues/1
| C | mit | svagionitis/cross-platform-code,svagionitis/cross-platform-code |
3c2384671496172cdacf53854592ff689cfbb044 | src/swganh/scripting/python_shared_ptr.h | src/swganh/scripting/python_shared_ptr.h | // This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#pragma once
#include <memory>
namespace boost {
template<class T> const T* get_pointer(const std::shared_ptr<T>& ptr)
{
return ptr.get();
}
template<class T> T* get_pointer(std::shared_ptr<T>& ptr)
{
return ptr.get();
}
template<class T> const T* get_pointer(const std::unique_ptr<T>& ptr)
{
return ptr.get();
}
template<class T> T* get_pointer(std::unique_ptr<T>& ptr)
{
return ptr.get();
}
}
//#include <boost/python.hpp>
//namespace boost{ namespace python{
// template <class T>
// struct pointee< std::shared_ptr<T> >
// {
// typedef T type;
// };
//
//}}
| // This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#pragma once
#include <memory>
//namespace boost {
// template<class T> const T* get_pointer(const std::shared_ptr<T>& ptr)
// {
// return ptr.get();
// }
//
// template<class T> T* get_pointer(std::shared_ptr<T>& ptr)
// {
// return ptr.get();
// }
//
// template<class T> const T* get_pointer(const std::unique_ptr<T>& ptr)
// {
// return ptr.get();
// }
//
// template<class T> T* get_pointer(std::unique_ptr<T>& ptr)
// {
// return ptr.get();
// }
//}
//#include <boost/python.hpp>
//namespace boost{ namespace python{
// template <class T>
// struct pointee< std::shared_ptr<T> >
// {
// typedef T type;
// };
//
//}}
| Boost now supports std::unique_ptr/std::shared_ptr for python | Boost now supports std::unique_ptr/std::shared_ptr for python
| C | mit | anhstudios/swganh,anhstudios/swganh,anhstudios/swganh |
44bd63e4db6ac33a03b14da1a2b6e932f2947a35 | kilo.c | kilo.c | #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disable_raw_mode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enable_raw_mode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disable_raw_mode);
struct termios raw = orig_termios;
raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
raw.c_oflag &= ~(OPOST);
raw.c_cflag &= ~(CS8);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
}
int main() {
enable_raw_mode();
char c;
while (read(STDIN_FILENO, &c, 1) == 1 && c != 'q') {
if (iscntrl(c)) {
printf("%d\r\n", c);
} else {
printf("%d ('%c')\r\n", c, c);
}
}
return 0;
}
| #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disable_raw_mode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enable_raw_mode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disable_raw_mode);
struct termios raw = orig_termios;
raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
raw.c_oflag &= ~(OPOST);
raw.c_cflag &= ~(CS8);
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
raw.c_cc[VMIN] = 0;
raw.c_cc[VTIME] = 1;
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
}
int main() {
enable_raw_mode();
while (1) {
char c = '\0';
read(STDIN_FILENO, &c, 1);
if (iscntrl(c)) {
printf("%d\r\n", c);
} else {
printf("%d ('%c')\r\n", c, c);
}
if (c == 'q') {
break;
}
}
return 0;
}
| Add a timeout for read() | Add a timeout for read()
Set VMIN to 0 so read() returns as soon as there is any input to be
read.
Set VTIME to 1 so the wait time of read() is 100 milliseconds.
| C | bsd-2-clause | oldsharp/kilo,oldsharp/kilo |
c8f07441b641c3aa288ce6d8aa59eff4ab3332e6 | main.c | main.c | /* The contents of this file is in the public domain. */
#include <ipify.h>
#include <string.h>
#include <sys/socket.h>
int main(int argc, char *argv[])
{
int family = AF_UNSPEC;
char addr[256];
int i, sd;
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-h")) {
printf("ipify [-46h]\n");
return 0;
}
if (!strcmp(argv[i], "-4")) {
family = AF_INET;
continue;
}
if (!strcmp(argv[i], "-6")) {
family = AF_INET6;
continue;
}
printf("Invalid option: '%s'\n", argv[i]);
return 1;
}
sd = ipify_connect1(family);
if (sd < 0)
return 1;
if (!ipify_query(sd, addr, sizeof(addr)))
printf("%s\n", addr);
return ipify_disconnect(sd);
}
| /* The contents of this file is in the public domain. */
#include <ipify.h>
#include <string.h>
#include <sys/socket.h>
int main(int argc, char *argv[])
{
int family = AF_UNSPEC;
char addr[256];
char *host;
int i, sd;
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-h")) {
printf("ipify [-46h] [HOST]\n");
return 0;
}
if (!strcmp(argv[i], "-4")) {
family = AF_INET;
continue;
}
if (!strcmp(argv[i], "-6")) {
family = AF_INET6;
continue;
}
break;
}
if (i < argc)
host = argv[i++];
else
host = "api.ipify.org";
sd = ipify_connect2(host, family);
if (sd < 0)
return 1;
if (!ipify_query(sd, addr, sizeof(addr)))
printf("%s\n", addr);
return ipify_disconnect(sd);
}
| Use new API and expose optional host argument | Use new API and expose optional host argument
Signed-off-by: Joachim Wiberg <[email protected]>
| C | isc | troglobit/lipify |
aea67ce8c8998f99adb9d1d8d70295da6122a13a | libcpu/platform.h | libcpu/platform.h | #if defined(_WIN32)
# define __LITTLE_ENDIAN__ 1
# ifdef _M_IX86
# define __i386__ 1
# endif
# ifdef _M_X64
# define __x86_64__ 1
# endif
# if defined(_MSC_VER)
# define snprintf _snprintf
# define strtoull _strtoui64
# define __func__ __FUNCTION__
# endif /* defined(_MSC_VER) */
#endif /* defined(_WIN32) */
#if HAVE_DECLSPEC_DLLEXPORT
# ifdef LIBCPU_BUILD_CORE
# define API_FUNC __declspec(dllexport)
# else
# define API_FUNC __declspec(dllimport)
# endif
#else
# define API_FUNC /* nothing */
#endif
#if HAVE_ATTRIBUTE_PACKED
# define PACKED(x) x __attribute__((packed))
#elif HAVE_PRAGMA_PACK
# define PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop))
#else
# error Do not know how to pack structs on this platform
#endif
#if HAVE_ATTRIBUTE_ALIGNED
# define ALIGNED(x) __attribute__((aligned(x)))
#elif HAVE_DECLSPEC_ALIGN
# define ALIGNED(x) __declspec(align(x))
#else
# error Do not know how to specify alignment on this platform
#endif
| #if defined(_WIN32)
# define __LITTLE_ENDIAN__ 1
# ifdef _M_IX86
# define __i386__ 1
# endif
# ifdef _M_X64
# define __x86_64__ 1
# endif
# if defined(_MSC_VER)
# define snprintf _snprintf
# define strtoull _strtoui64
# define __func__ __FUNCTION__
# endif /* defined(_MSC_VER) */
#endif /* defined(_WIN32) */
#if HAVE_DECLSPEC_DLLEXPORT
# ifdef LIBCPU_BUILD_CORE
# define API_FUNC __declspec(dllexport)
# else
# define API_FUNC __declspec(dllimport)
# endif
#else
# define API_FUNC /* nothing */
#endif
#if HAVE_ATTRIBUTE_PACKED
# define PACKED(x) x __attribute__((packed))
#elif HAVE_PRAGMA_PACK
# define PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop))
#else
# error Do not know how to pack structs on this platform
#endif
#if HAVE_ATTRIBUTE_ALIGNED
# define ALIGNED(x) __attribute__((aligned(x)))
#elif HAVE_DECLSPEC_ALIGN
# define ALIGNED(x) __declspec(align(x))
#else
# error Do not know how to specify alignment on this platform
#endif
| Remove a Windows line-ending that was accidentally included | Remove a Windows line-ending that was accidentally included
| C | bsd-2-clause | monocasa/libcpu,ukatemi/libcpu,glguida/libcpu,curtiszimmerman/libcpu,ukatemi/libcpu,libcpu/libcpu,curtiszimmerman/libcpu,libcpu/libcpu,glguida/libcpu,monocasa/libcpu,ukatemi/libcpu,curtiszimmerman/libcpu,glguida/libcpu,monocasa/libcpu,libcpu/libcpu,glguida/libcpu,libcpu/libcpu,monocasa/libcpu,curtiszimmerman/libcpu,ukatemi/libcpu |
0daebd485c02840729740949caa429efd5cf0153 | ghighlighter/main-window.c | ghighlighter/main-window.c | #include <gtk/gtk.h>
GtkWidget *
main_window_create()
{
GtkWidget *window;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "ghighlighter");
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
return window;
}
| #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
static void
main_window_destroy(GtkAccelGroup *group, GObject *acceleratable,
guint keyval, GdkModifierType modifier, gpointer user_data)
{
gtk_widget_destroy(GTK_WIDGET(user_data));
}
void
main_window_bind_keys(GtkWidget *window)
{
GtkAccelGroup *group = gtk_accel_group_new();
GClosure *closure = g_cclosure_new(G_CALLBACK(main_window_destroy), window, NULL);
gtk_accel_group_connect(group, GDK_KEY_q, GDK_CONTROL_MASK, 0, closure);
gtk_window_add_accel_group(GTK_WINDOW(window), group);
}
GtkWidget *
main_window_create()
{
GtkWidget *window;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "ghighlighter");
main_window_bind_keys(window);
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
return window;
}
| Destroy main window on Ctrl+q | Destroy main window on Ctrl+q
| C | mit | chdorner/ghighlighter-c |
65afcdfc0e43f45578d47e4ab68bb0a81cdfd14a | src/settings/types/Duration.h | src/settings/types/Duration.h | //Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#ifndef DURATION_H
#define DURATION_H
namespace cura
{
/*
* \brief Represents a duration in seconds.
*
* This is a facade. It behaves like a double, only it can't be negative.
*/
struct Duration
{
/*
* \brief Default constructor setting the duration to 0.
*/
Duration() : value(0) {};
/*
* \brief Casts a double to a Duration instance.
*/
Duration(double value) : value(std::max(value, 0.0)) {};
/*
* \brief Casts the Duration instance to a double.
*/
operator double() const
{
return value;
};
/*
* Some operators to do arithmetic with Durations.
*/
Duration operator +(const Duration& other) const
{
return Duration(value + other.value);
};
Duration operator -(const Duration& other) const
{
return Duration(value + other.value);
};
Duration& operator +=(const Duration& other)
{
value += other.value;
return *this;
}
Duration& operator -=(const Duration& other)
{
value -= other.value;
return *this;
}
/*
* \brief The actual duration, as a double.
*/
double value = 0;
};
}
#endif //DURATION_H | //Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#ifndef DURATION_H
#define DURATION_H
namespace cura
{
/*
* \brief Represents a duration in seconds.
*
* This is a facade. It behaves like a double, only it can't be negative.
*/
struct Duration
{
/*
* \brief Default constructor setting the duration to 0.
*/
constexpr Duration() : value(0) {};
/*
* \brief Casts a double to a Duration instance.
*/
constexpr Duration(double value) : value(value > 0.0 ? value : 0.0) {};
/*
* \brief Casts the Duration instance to a double.
*/
operator double() const
{
return value;
};
/*
* Some operators to do arithmetic with Durations.
*/
Duration operator +(const Duration& other) const
{
return Duration(value + other.value);
};
Duration operator -(const Duration& other) const
{
return Duration(value + other.value);
};
Duration& operator +=(const Duration& other)
{
value += other.value;
return *this;
}
Duration& operator -=(const Duration& other)
{
value -= other.value;
return *this;
}
/*
* \brief The actual duration, as a double.
*/
double value = 0;
};
constexpr Duration operator "" _s(const long double seconds)
{
return Duration(seconds);
}
}
#endif //DURATION_H | Add _s custom literal for durations | Add _s custom literal for durations
You can indicate that something takes 5 seconds by writing 5_s now. We can't make a literal saying '5s' because custom literals need to start with an underscore because C++ reserves the rest for use in future C++ versions.
Contributes to issue CURA-4410.
| C | agpl-3.0 | Ultimaker/CuraEngine,Ultimaker/CuraEngine |
4ee4e4dcb07c5e45881179c6ec61df6381f76211 | security/nss/macbuild/NSSCommon.h | security/nss/macbuild/NSSCommon.h | /* Defines common to all versions of NSS */
#define NSPR20 1
#define MP_API_COMPATIBLE 1
| /* Defines common to all versions of NSS */
#define NSPR20 1
#define MP_API_COMPATIBLE 1
#define NSS_3_4_CODE 1 /* Remove this when we start building NSS 4.0 by default */ | Define NSS_3_4 so that we get the right code and not Stan code that isn't quite ready. | Define NSS_3_4 so that we get the right code and not Stan code that isn't quite ready.
| C | mpl-2.0 | thespooler/nss,thespooler/nss,thespooler/nss,thespooler/nss,thespooler/nss,thespooler/nss,thespooler/nss |
1815f49daf517119c71935eb4852696cbb53fc94 | operating_system/next_fit.c | operating_system/next_fit.c | #include <stdio.h>
#include <stdlib.h>
void next_fit(int blockSize[],int processSize[],int n,int m){
int allocation[m];
int i=0,j=0;
for (i=0;i<m;i++)
allocation[i]=-1;
for (i=0;i<m;i++) {
while (j<n) {
if (blockSize[j]>=processSize[i])
{
allocation[i]=j;
blockSize[j]-=processSize[i];
break;
}
j=(j+1)%n;
}
}
printf("\nProcess No.\tProcess Size\tBlock no.\n");
for (i=0;i<m;i++) {
printf("%d\t\t",i+1);
printf("%d\t\t",processSize[i]);
if (allocation[i]!=-1)
printf("%d",allocation[i]+1);
else
printf("Not Allocated\n");
printf("\n");
}
}
int main(){
int blockSize[]={10,20,300,40,500,60,100};
int i,n,m;
n=7;
printf("Give number of processes:");
scanf("%d",&m);
int processSize[m];
for (i=0;i<m;i++){
printf("Give process size for process number %d:",i+1);
scanf("%d",&processSize[i]);
}
next_fit(blockSize,processSize,n,m);
return 0;
}
| Create next fit algorithm in c | Create next fit algorithm in c | C | cc0-1.0 | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms |
|
351be023e68a713aa3ffcfae7cca21935b1f913c | test/CodeGen/builtins-arm64.c | test/CodeGen/builtins-arm64.c | // RUN: %clang_cc1 -triple arm64-apple-ios -O3 -emit-llvm -o - %s | FileCheck %s
void f0(void *a, void *b) {
__clear_cache(a,b);
// CHECK: call {{.*}} @__clear_cache
}
// CHECK: call {{.*}} @llvm.aarch64.rbit.i32(i32 %a)
unsigned rbit(unsigned a) {
return __builtin_arm_rbit(a);
}
// CHECK: call {{.*}} @llvm.aarch64.rbit.i64(i64 %a)
unsigned long long rbit64(unsigned long long a) {
return __builtin_arm_rbit64(a);
}
| // RUN: %clang_cc1 -triple arm64-apple-ios -O3 -emit-llvm -o - %s | FileCheck %s
void f0(void *a, void *b) {
__clear_cache(a,b);
// CHECK: call {{.*}} @__clear_cache
}
// CHECK: call {{.*}} @llvm.aarch64.rbit.i32(i32 %a)
unsigned rbit(unsigned a) {
return __builtin_arm_rbit(a);
}
// CHECK: call {{.*}} @llvm.aarch64.rbit.i64(i64 %a)
unsigned long long rbit64(unsigned long long a) {
return __builtin_arm_rbit64(a);
}
void hints() {
__builtin_arm_yield(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 1)
__builtin_arm_wfe(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 2)
__builtin_arm_wfi(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 3)
__builtin_arm_sev(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 4)
__builtin_arm_sevl(); //CHECK: call {{.*}} @llvm.aarch64.hint(i32 5)
}
| Add test cases for AArch64 hints codegen | Add test cases for AArch64 hints codegen
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@212909 91177308-0d34-0410-b5e6-96231b3b80d8
| C | 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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-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 |
7fa8ea867659fc32093d3acb13c1c6a061b0b7f9 | CatchFeedHelper/CTCFeedChecker.h | CatchFeedHelper/CTCFeedChecker.h | #import <Foundation/Foundation.h>
extern NSString *kCTCFeedCheckerErrorDomain;
typedef void (^CTCFeedCheckCompletionHandler)(NSArray *downloadedFeedFiles,
NSError *error);
typedef void (^CTCFeedCheckDownloadCompletionHandler)(NSError *error);
@protocol CTCFeedCheck
- (void)checkShowRSSFeed:(NSURL *)feedURL
downloadingToBookmark:(NSData *)downloadFolderBookmark
organizingByFolder:(BOOL)shouldOrganizeByFolder
skippingURLs:(NSArray *)previouslyDownloadedURLs
withReply:(CTCFeedCheckCompletionHandler)reply;
- (void)downloadFile:(NSDictionary *)fileURL
toBookmark:(NSData *)downloadFolderBookmark
organizingByFolder:(BOOL)shouldOrganizeByFolder
withReply:(CTCFeedCheckDownloadCompletionHandler)reply;
@end
@interface CTCFeedChecker : NSObject <CTCFeedCheck, NSXPCListenerDelegate>
+ (instancetype)sharedChecker;
@end
| #import <Foundation/Foundation.h>
extern NSString *kCTCFeedCheckerErrorDomain;
typedef void (^CTCFeedCheckCompletionHandler)(NSArray *downloadedFeedFiles,
NSError *error);
typedef void (^CTCFeedCheckDownloadCompletionHandler)(NSError *error);
@protocol CTCFeedCheck
- (void)checkShowRSSFeed:(NSURL *)feedURL
downloadingToBookmark:(NSData *)downloadFolderBookmark
organizingByFolder:(BOOL)shouldOrganizeByFolder
skippingURLs:(NSArray *)previouslyDownloadedURLs
withReply:(CTCFeedCheckCompletionHandler)reply;
- (void)downloadFile:(NSDictionary *)file
toBookmark:(NSData *)downloadFolderBookmark
organizingByFolder:(BOOL)shouldOrganizeByFolder
withReply:(CTCFeedCheckDownloadCompletionHandler)reply;
@end
@interface CTCFeedChecker : NSObject <CTCFeedCheck, NSXPCListenerDelegate>
+ (instancetype)sharedChecker;
@end
| Fix header out of sync | Fix header out of sync
| C | mit | mipstian/catch |
24dfd9f146f15fb5c2524369f1a750fcc6db0fca | test2/cpp/comment_backslashing.c | test2/cpp/comment_backslashing.c | // RUN: %ucc -fsyntax-only %s
int main()
{
/* comment with stray handling *\
/
/* this is a valid *\/ comment */
/* this is a valid comment *\*/
// this is a valid\
comment
return 0;
}
| Add test for multi-line commenting | Add test for multi-line commenting
| C | mit | bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler |
|
eff9830b09a84b24091c731e42701da7ee320c77 | include/cling/Interpreter/RuntimeExceptions.h | include/cling/Interpreter/RuntimeExceptions.h | //--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Vassil Vassilev <[email protected]>
//------------------------------------------------------------------------------
#ifndef CLING_RUNTIME_EXCEPTIONS_H
#define CLING_RUNTIME_EXCEPTIONS_H
namespace cling {
namespace runtime {
///\brief Exception that is thrown when a null pointer dereference is found
/// or a method taking non-null arguments is called with NULL argument.
///
class cling_null_deref_exception { };
} // end namespace runtime
} // end namespace cling
#endif // CLING_RUNTIME_EXCEPTIONS_H
| //--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Vassil Vassilev <[email protected]>
//------------------------------------------------------------------------------
#ifndef CLING_RUNTIME_EXCEPTIONS_H
#define CLING_RUNTIME_EXCEPTIONS_H
namespace clang {
class Sema;
}
namespace cling {
namespace runtime {
///\brief Exception that is thrown when a null pointer dereference is found
/// or a method taking non-null arguments is called with NULL argument.
///
class cling_null_deref_exception {
private:
unsigned m_Location;
clang::Sema* m_Sema;
public:
cling_null_deref_exception(void* Loc, clang::Sema* S);
~cling_null_deref_exception();
void what() throw();
};
} // end namespace runtime
} // end namespace cling
#endif // CLING_RUNTIME_EXCEPTIONS_H
| Add missing header method declarations. | Add missing header method declarations.
| C | lgpl-2.1 | karies/cling,root-mirror/cling,root-mirror/cling,karies/cling,karies/cling,perovic/cling,karies/cling,perovic/cling,root-mirror/cling,root-mirror/cling,marsupial/cling,marsupial/cling,marsupial/cling,marsupial/cling,perovic/cling,root-mirror/cling,root-mirror/cling,marsupial/cling,karies/cling,marsupial/cling,perovic/cling,perovic/cling,karies/cling |
e5b5dcb8aa7b85d5f873aa51120b4f685beeb145 | FDTakeExample/FDTakeController.h | FDTakeExample/FDTakeController.h | //
// FDTakeController.h
// FDTakeExample
//
// Created by Will Entriken on 8/9/12.
// Copyright (c) 2012 William Entriken. All rights reserved.
//
#import <Foundation/Foundation.h>
@class FDTakeController;
@protocol FDTakeDelegate <NSObject>
- (void)takeController:(FDTakeController *)controller gotPhoto:(UIImage *)photo withInfo:(NSDictionary *)info;
- (void)takeController:(FDTakeController *)controller gotVideo:(NSURL *)video withInfo:(NSDictionary *)info;
- (void)takeController:(FDTakeController *)controller didCancelAfterAttempting:(BOOL)madeAttempt;
@end
@interface FDTakeController : NSObject
- (void)takePhotoOrChooseFromLibrary;
- (void)takeVideoOrChooseFromLibrary;
- (void)takePhotoOrVideoOrChooseFromLibrary;
@property (strong, nonatomic) UIImagePickerController *imagePicker;
@property (weak, nonatomic) id <FDTakeDelegate> delegate;
@end
| //
// FDTakeController.h
// FDTakeExample
//
// Created by Will Entriken on 8/9/12.
// Copyright (c) 2012 William Entriken. All rights reserved.
//
#import <Foundation/Foundation.h>
@class FDTakeController;
@protocol FDTakeDelegate <NSObject>
@optional
- (void)takeController:(FDTakeController *)controller didCancelAfterAttempting:(BOOL)madeAttempt;
- (void)takeController:(FDTakeController *)controller gotPhoto:(UIImage *)photo withInfo:(NSDictionary *)info;
- (void)takeController:(FDTakeController *)controller gotVideo:(NSURL *)video withInfo:(NSDictionary *)info;
@end
@interface FDTakeController : NSObject
+ (UIImage*)imageWithImage:(UIImage*)sourceImage scaledToSizeWithSameAspectRatio:(CGSize)targetSize;
- (void)takePhotoOrChooseFromLibrary;
- (void)takeVideoOrChooseFromLibrary;
- (void)takePhotoOrVideoOrChooseFromLibrary;
@property (strong, nonatomic) UIImagePickerController *imagePicker;
@property (weak, nonatomic) id <FDTakeDelegate> delegate;
@end
| Make more usable for production | Make more usable for production
| C | mit | fulldecent/FDTake,kobim/FDTake,fulldecent/FDTake,eumlab/FDTake,eumlab/FDTake,eumlab/FDTake,Lily418/FDTake,Lily418/FDTake,masd-duc/FDTake,Lily418/FDTake,LaserPatrick/FDTake,wyszo/FDTake,fulldecent/FDTake,LaserPatrick/FDTake |
97ef11ed8bb6b0662fd9d293eb631c5d1874eeda | input/Tree.h | input/Tree.h | #include <memory>
#include <random>
static std::mt19937 mt;
static std::uniform_int_distribution<int> d(1,10);
static auto gen = []{return d(mt);};
class Tree
{
int data_;
std::shared_ptr<Tree> left_;
std::shared_ptr<Tree> right_;
public:
Tree(int levels=0)
{
data_ = gen();
if ( levels <= 0 ) return;
left_ = std::make_shared<Tree>(levels-1);
right_ = std::make_shared<Tree>(levels-1);
}
const Tree* left_subtree() const
{
return left_.get();
}
const Tree* right_subtree() const
{
return right_.get();
}
int data() const
{
return data_;
}
};
| Add tree demo to input - needed for subobjects | Add tree demo to input - needed for subobjects
| C | mit | jbcoe/C_API_generation,jbcoe/C_API_generation,FFIG/ffig,FFIG/ffig,FFIG/ffig,FFIG/ffig,jbcoe/C_API_generation,jbcoe/C_API_generation,FFIG/ffig,FFIG/ffig,FFIG/ffig,FFIG/ffig |
|
7c945ca65683fd17b029ab0748fe2359a8f71a4c | include/core/SkMilestone.h | include/core/SkMilestone.h | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 64
#endif
| /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 65
#endif
| Update Skia milestone to 65 | Update Skia milestone to 65
NOTRY=TRUE
TBR=reed
Bug: skia:
Change-Id: I3dfe04202f48068bd04e7d64fa38913906af02ce
Reviewed-on: https://skia-review.googlesource.com/78201
Reviewed-by: Heather Miller <[email protected]>
Commit-Queue: Heather Miller <[email protected]>
| C | bsd-3-clause | HalCanary/skia-hc,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,google/skia,google/skia,HalCanary/skia-hc,rubenvb/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,HalCanary/skia-hc,rubenvb/skia,google/skia,rubenvb/skia,rubenvb/skia,rubenvb/skia,google/skia |
5084aa505fc702cd78b274622c72d63969688d75 | util/bounding_box.h | util/bounding_box.h | /*
* An axis-aligned bounding box in 3D space.
* Author: Dino Wernli
*/
#ifndef BOUNDING_BOX_H_
#define BOUNDING_BOX_H_
#include "util/numeric.h"
class Point3;
class BoundingBox {
public:
BoundingBox(const Point3& point);
virtual ~BoundingBox();
// Changes the bounding box to include point.
BoundingBox& Include(const Point3& point);
private:
Scalar xmin_, xmax_, ymin_, ymax_, zmin_, zmax_;
};
#endif /* BOUNDING_BOX_H_ */
| /*
* An axis-aligned bounding box in 3D space.
* Author: Dino Wernli
*/
#ifndef BOUNDING_BOX_H_
#define BOUNDING_BOX_H_
#include "util/numeric.h"
class Point3;
class BoundingBox {
public:
BoundingBox(const Point3& point);
virtual ~BoundingBox();
// Changes the bounding box to include point.
BoundingBox& Include(const Point3& point);
private:
Scalar xmin_, xmax_, ymin_, ymax_, zmin_, zmax_;
};
template<class OStream>
OStream& operator<<(OStream& os, const BoundingBox& box) {
return os << "(box: "
"(" << box.xmin_ << ' ' << box.xmax_ << ") "
"(" << box.ymin_ << ' ' << box.ymax_ << ") "
"(" << box.zmin_ << ' ' << box.zmax_ << "))";
}
#endif /* BOUNDING_BOX_H_ */
| Add support for dumping bounding boxes. | Add support for dumping bounding boxes.
| C | mit | dinowernli/raytracer,dinowernli/raytracer,dinowernli/raytracer,dinowernli/raytracer |
dff6ed304ba6c58a273d234384ca12fd59f03b86 | code/Modules/Render/Types/PrimitiveType.h | code/Modules/Render/Types/PrimitiveType.h | #pragma once
//------------------------------------------------------------------------------
/**
@class Oryol::Render::PrimitiveType
@brief primitive type enum (triangle strips, lists, etc...)
*/
#include "Core/Types.h"
namespace Oryol {
namespace Render {
class PrimitiveType {
public:
/// primitive type enum
enum Code {
Points, ///< point list
LineStrip, ///< line strip
LineLoop, ///< closed line loop
Lines, ///< line list
TriangleStrip, ///< triangle strip
TriangleFan, ///< triangle fan
Triangles, ///< triangle list
NumPrimitiveTypes, ///< number of primitive types
InvalidPrimitiveType, ///< invalid primitive type value
};
/// convert to string
static const char* ToString(Code c);
/// convert from string
static Code FromString(const char* str);
};
} // namespace Render
} // namespace Oryol | #pragma once
//------------------------------------------------------------------------------
/**
@class Oryol::Render::PrimitiveType
@brief primitive type enum (triangle strips, lists, etc...)
*/
#include "Core/Types.h"
namespace Oryol {
namespace Render {
class PrimitiveType {
public:
/// primitive type enum (don't change order, append to end!)
enum Code {
Points = 0, ///< point list
LineStrip, ///< line strip
LineLoop, ///< closed line loop
Lines, ///< line list
TriangleStrip, ///< triangle strip
TriangleFan, ///< triangle fan
Triangles, ///< triangle list
NumPrimitiveTypes, ///< number of primitive types
InvalidPrimitiveType, ///< invalid primitive type value
};
/// convert to string
static const char* ToString(Code c);
/// convert from string
static Code FromString(const char* str);
};
} // namespace Render
} // namespace Oryol | Make sure primitive type enum starts at 0 | Make sure primitive type enum starts at 0
| C | mit | tempbottle/oryol,ejkoy/oryol,tempbottle/oryol,ejkoy/oryol,mgerhardy/oryol,tempbottle/oryol,code-disaster/oryol,wangscript/oryol,mgerhardy/oryol,waywardmonkeys/oryol,xfxdev/oryol,mgerhardy/oryol,xfxdev/oryol,wangscript/oryol,bradparks/oryol,zhakui/oryol,waywardmonkeys/oryol,code-disaster/oryol,aonorin/oryol,mgerhardy/oryol,ejkoy/oryol,xfxdev/oryol,code-disaster/oryol,aonorin/oryol,bradparks/oryol,ejkoy/oryol,floooh/oryol,floooh/oryol,ejkoy/oryol,wangscript/oryol,bradparks/oryol,zhakui/oryol,bradparks/oryol,ejkoy/oryol,wangscript/oryol,xfxdev/oryol,zhakui/oryol,zhakui/oryol,aonorin/oryol,waywardmonkeys/oryol,code-disaster/oryol,aonorin/oryol,wangscript/oryol,waywardmonkeys/oryol,waywardmonkeys/oryol,bradparks/oryol,floooh/oryol,aonorin/oryol,code-disaster/oryol,mgerhardy/oryol,tempbottle/oryol,aonorin/oryol,tempbottle/oryol,floooh/oryol,xfxdev/oryol,wangscript/oryol,floooh/oryol,tempbottle/oryol,bradparks/oryol,bradparks/oryol,code-disaster/oryol,tempbottle/oryol,waywardmonkeys/oryol,wangscript/oryol,xfxdev/oryol,code-disaster/oryol,aonorin/oryol,ejkoy/oryol,xfxdev/oryol,floooh/oryol,zhakui/oryol,mgerhardy/oryol,zhakui/oryol,zhakui/oryol,mgerhardy/oryol,waywardmonkeys/oryol |
3709f2b154a5db0500892c1d720280d54981135a | src/rtcmix/gen/floc.c | src/rtcmix/gen/floc.c | #include "../H/ugens.h"
#include <stdio.h>
/* these 3 defined in makegen.c */
extern float *farrays[];
extern int sizeof_farray[];
extern int f_goto[];
/* Returns the address of function number genno, or NULL if the
function array doesn't exist.
NOTE: It's the responsiblity of instruments to deal with a
missing gen, either by using die() or supplying a default
and alerting the user with advise().
*/
float *floc(int genno)
{
int index = f_goto[genno];
if (sizeof_farray[index] == 0)
return NULL;
return farrays[index];
}
| #include <stdio.h>
#include <ugens.h>
/* these 3 defined in makegen.c */
extern float *farrays[];
extern int sizeof_farray[];
extern int f_goto[];
/* Returns the address of function number genno, or NULL if the
function array doesn't exist.
NOTE: It's the responsiblity of instruments to deal with a
missing gen, either by using die() or supplying a default
and alerting the user with advise().
*/
float *floc(int genno)
{
int index;
if (genno < 0)
return NULL;
index = f_goto[genno];
if (sizeof_farray[index] == 0)
return NULL;
return farrays[index];
}
| Make sure gen loc is in range. | Make sure gen loc is in range.
| C | apache-2.0 | RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix |
38dc7e5f12c1fb18c292dcd2ade8f8de9102c79c | xs/APR/OS/APR__OS.h | xs/APR/OS/APR__OS.h | /* Copyright 2002-2004 The Apache Software 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.
*/
static MP_INLINE U32 mpxs_APR__OS_current_thread_id(pTHX)
{
#if APR_HAS_THREADS
return apr_os_thread_current();
#else
return 0;
#endif
}
| /* Copyright 2002-2004 The Apache Software 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.
*/
static MP_INLINE U32 mpxs_APR__OS_current_thread_id(pTHX)
{
#if APR_HAS_THREADS
return (U32)apr_os_thread_current();
#else
return 0;
#endif
}
| Make a proper case to U32 to avoid a warning | Make a proper case to U32 to avoid a warning
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: b4be4a41b2a3352907de631eb6da1671a2f7b614@71435 13f79535-47bb-0310-9956-ffa450edef68
| C | apache-2.0 | Distrotech/mod_perl,Distrotech/mod_perl,Distrotech/mod_perl,Distrotech/mod_perl |
7024cce5b4315f285d4bd44fff0e999cd6e040f0 | Modules/tkappinit.c | Modules/tkappinit.c | /* appinit.c -- Tcl and Tk application initialization. */
#include <tcl.h>
#include <tk.h>
int
Tcl_AppInit (interp)
Tcl_Interp *interp;
{
Tk_Window main;
main = Tk_MainWindow(interp);
if (Tcl_Init (interp) == TCL_ERROR)
return TCL_ERROR;
if (Tk_Init (interp) == TCL_ERROR)
return TCL_ERROR;
#ifdef WITH_MOREBUTTONS
{
extern Tcl_CmdProc studButtonCmd;
extern Tcl_CmdProc triButtonCmd;
Tcl_CreateCommand(interp, "studbutton", studButtonCmd,
(ClientData) main, NULL);
Tcl_CreateCommand(interp, "tributton", triButtonCmd,
(ClientData) main, NULL);
}
#endif
#ifdef WITH_XXX
#endif
return TCL_OK;
}
| /* appinit.c -- Tcl and Tk application initialization. */
#include <tcl.h>
#include <tk.h>
int
Tcl_AppInit (interp)
Tcl_Interp *interp;
{
Tk_Window main;
main = Tk_MainWindow(interp);
if (Tcl_Init (interp) == TCL_ERROR)
return TCL_ERROR;
if (Tk_Init (interp) == TCL_ERROR)
return TCL_ERROR;
#ifdef WITH_MOREBUTTONS
{
extern Tcl_CmdProc studButtonCmd;
extern Tcl_CmdProc triButtonCmd;
Tcl_CreateCommand(interp, "studbutton", studButtonCmd,
(ClientData) main, NULL);
Tcl_CreateCommand(interp, "tributton", triButtonCmd,
(ClientData) main, NULL);
}
#endif
#ifdef WITH_PIL /* 0.2b5 and later -- not yet released as of May 14 */
{
extern void TkImaging_Init(Tcl_Interp *interp);
TkImaging_Init(interp);
}
#endif
#ifdef WITH_PIL_OLD /* 0.2b4 and earlier */
{
extern void TkImaging_Init(void);
TkImaging_Init();
}
#endif
#ifdef WITH_XXX
#endif
return TCL_OK;
}
| Add sections for PIL (Fred Lundh). | Add sections for PIL (Fred Lundh).
| C | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator |
076eb56e244d6d1da4d8bf2c0a7a6e4cae282023 | src/libsodium/sodium/core.c | src/libsodium/sodium/core.c |
#include <stdbool.h>
#include "core.h"
#include "crypto_onetimeauth.h"
static bool initialized;
int
sodium_init(void)
{
if (initialized != 0) {
return 1;
}
initialized = 1;
if (crypto_onetimeauth_pick_best_implementation() == NULL) {
return -1;
}
return 0;
}
|
#include <stdbool.h>
#include "core.h"
#include "crypto_onetimeauth.h"
static bool initialized;
int
sodium_init(void)
{
if (initialized != 0) {
return 1;
}
if (crypto_onetimeauth_pick_best_implementation() == NULL) {
return -1;
}
initialized = 1;
return 0;
}
| Set initialized=1 when everything has actually been initialized | Set initialized=1 when everything has actually been initialized
| C | isc | mvduin/libsodium,pyparallel/libsodium,zhuqling/libsodium,GreatFruitOmsk/libsodium,paragonie-scott/libsodium,HappyYang/libsodium,eburkitt/libsodium,donpark/libsodium,eburkitt/libsodium,SpiderOak/libsodium,pyparallel/libsodium,akkakks/libsodium,pyparallel/libsodium,soumith/libsodium,rustyhorde/libsodium,rustyhorde/libsodium,kytvi2p/libsodium,JackWink/libsodium,akkakks/libsodium,GreatFruitOmsk/libsodium,tml/libsodium,netroby/libsodium,GreatFruitOmsk/libsodium,Payshare/libsodium,optedoblivion/android_external_libsodium,Payshares/libsodium,netroby/libsodium,JackWink/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,mvduin/libsodium,HappyYang/libsodium,Payshare/libsodium,optedoblivion/android_external_libsodium,paragonie-scott/libsodium,tml/libsodium,netroby/libsodium,soumith/libsodium,Payshares/libsodium,SpiderOak/libsodium,pmienk/libsodium,kytvi2p/libsodium,tml/libsodium,rustyhorde/libsodium,pmienk/libsodium,Payshares/libsodium,donpark/libsodium,eburkitt/libsodium,akkakks/libsodium,rustyhorde/libsodium,kytvi2p/libsodium,SpiderOak/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,zhuqling/libsodium,pmienk/libsodium,mvduin/libsodium,optedoblivion/android_external_libsodium,CyanogenMod/android_external_dnscrypt_libsodium,zhuqling/libsodium,SpiderOak/libsodium,paragonie-scott/libsodium,donpark/libsodium,akkakks/libsodium,soumith/libsodium,Payshare/libsodium,JackWink/libsodium,HappyYang/libsodium |
d5646a1a326b9454df20cd0675cbce65becb83ea | scene/light/sphere_light.h | scene/light/sphere_light.h | /*
* An area light with a sphere geometry.
*
* TODO(dinow): Extract a middle class called GeometryLight which contains the
* intersect code and the geometry pointer.
* Author: Dino Wernli
*/
#ifndef SPHERE_LIGHT_H_
#define SPHERE_LIGHT_H_
#include "scene/geometry/sphere.h"
#include "util/random.h"
class SphereLight : public Light {
public:
SphereLight(const Point3& center, Scalar radius, const Color3& color)
: Light(color), sphere_(new Sphere(center, radius)) {
}
virtual ~SphereLight() {};
virtual Ray GenerateRay(const Point3& target) const {
// TODO(dinow): Generate a ray from a random point on the proper half of the
// sphere to target.
return Ray;
}
// No ray ever intersects a dimensionless point light.
virtual bool Intersect(const Ray& ray, IntersectionData* data) const {
bool result = sphere_->Intersect(ray, data);
if (result) {
// Make sure the data object knows it intersected a light.
data->set_light(this);
}
return result;
}
private:
std::unique_ptr<Sphere> sphere_;
Random random_;
};
#endif /* SPHERE_LIGHT_H_ */
| Add a sphere light stub. | Add a sphere light stub.
| C | mit | dinowernli/raytracer,dinowernli/raytracer,dinowernli/raytracer,dinowernli/raytracer |
|
335f2e9da72e2d2f28ba437903f42344cf80d65d | libs/incs/ac_xstr.h | libs/incs/ac_xstr.h | /*
* Copyright 2016 Wink Saville
*
* 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 ARCH_GENERIC_INCS_AC_XSTR_H
#define ARCH_GENERIC_INCS_AC_XSTR_H
// Stringification of macro parameters
// [See](https://gcc.gnu.org/onlinedocs/cpp/Stringification.html)
#define AC_XSTR(s) AC_STR(s)
#define AC_STR(s) #s
#endif
| Add AC_XSTR and AC_STR macros. | Add AC_XSTR and AC_STR macros.
[See](https://gcc.gnu.org/onlinedocs/cpp/Stringification.html)
| C | apache-2.0 | winksaville/sadie,winksaville/sadie |
|
bbbb905e897e8dd9e59c51d1dc3f34023314295e | chrome/nacl/nacl_broker_listener.h | chrome/nacl/nacl_broker_listener.h | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_NACL_NACL_BROKER_LISTENER_H_
#define CHROME_NACL_NACL_BROKER_LISTENER_H_
#pragma once
#include "base/memory/scoped_ptr.h"
#include "base/process.h"
#include "chrome/common/nacl_types.h"
#include "ipc/ipc_channel.h"
// The BrokerThread class represents the thread that handles the messages from
// the browser process and starts NaCl loader processes.
class NaClBrokerListener : public IPC::Channel::Listener {
public:
NaClBrokerListener();
~NaClBrokerListener();
void Listen();
// IPC::Channel::Listener implementation.
virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
virtual void OnChannelError() OVERRIDE;
private:
void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id);
void OnShareBrowserHandle(int browser_handle);
void OnStopBroker();
base::ProcessHandle browser_handle_;
scoped_ptr<IPC::Channel> channel_;
DISALLOW_COPY_AND_ASSIGN(NaClBrokerListener);
};
#endif // CHROME_NACL_NACL_BROKER_LISTENER_H_
| // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_NACL_NACL_BROKER_LISTENER_H_
#define CHROME_NACL_NACL_BROKER_LISTENER_H_
#pragma once
#include "base/memory/scoped_ptr.h"
#include "base/process.h"
#include "chrome/common/nacl_types.h"
#include "ipc/ipc_channel.h"
// The BrokerThread class represents the thread that handles the messages from
// the browser process and starts NaCl loader processes.
class NaClBrokerListener : public IPC::Channel::Listener {
public:
NaClBrokerListener();
~NaClBrokerListener();
void Listen();
// IPC::Channel::Listener implementation.
virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
virtual void OnChannelError() OVERRIDE;
private:
void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id);
void OnStopBroker();
base::ProcessHandle browser_handle_;
scoped_ptr<IPC::Channel> channel_;
DISALLOW_COPY_AND_ASSIGN(NaClBrokerListener);
};
#endif // CHROME_NACL_NACL_BROKER_LISTENER_H_
| Remove declaration of non-existent method | NaCl: Remove declaration of non-existent method
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9592039
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@125431 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | gavinp/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,ropik/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,gavinp/chromium |
a426da990b999ba8a44aec739e412f7f8722df24 | erts/emulator/test/scheduler_SUITE_data/scheduler_SUITE.c | erts/emulator/test/scheduler_SUITE_data/scheduler_SUITE.c | #include <unistd.h>
#include "erl_nif.h"
static int
load(ErlNifEnv* env, void** priv, ERL_NIF_TERM info)
{
ErlNifSysInfo sys_info;
enif_system_info(&sys_info, sizeof(ErlNifSysInfo));
if (!sys_info.smp_support || !sys_info.dirty_scheduler_support)
return 1;
return 0;
}
static ERL_NIF_TERM
dirty_sleeper(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
#ifdef ERL_NIF_DIRTY_SCHEDULER_SUPPORT
sleep(3);
#endif
return enif_make_atom(env, "ok");
}
static ErlNifFunc funcs[] = {
#ifdef ERL_NIF_DIRTY_SCHEDULER_SUPPORT
{"dirty_sleeper", 0, dirty_sleeper, ERL_NIF_DIRTY_JOB_IO_BOUND}
#else
{"dirty_sleeper", 0, dirty_sleeper, 0}
#endif
};
ERL_NIF_INIT(scheduler_SUITE, funcs, &load, NULL, NULL, NULL);
| #ifndef __WIN32__
#include <unistd.h>
#endif
#include "erl_nif.h"
static int
load(ErlNifEnv* env, void** priv, ERL_NIF_TERM info)
{
ErlNifSysInfo sys_info;
enif_system_info(&sys_info, sizeof(ErlNifSysInfo));
if (!sys_info.smp_support || !sys_info.dirty_scheduler_support)
return 1;
return 0;
}
static ERL_NIF_TERM
dirty_sleeper(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
#ifdef ERL_NIF_DIRTY_SCHEDULER_SUPPORT
#ifdef __WIN32__
Sleep(3000);
#else
sleep(3);
#endif
#endif
return enif_make_atom(env, "ok");
}
static ErlNifFunc funcs[] = {
#ifdef ERL_NIF_DIRTY_SCHEDULER_SUPPORT
{"dirty_sleeper", 0, dirty_sleeper, ERL_NIF_DIRTY_JOB_IO_BOUND}
#else
{"dirty_sleeper", 0, dirty_sleeper, 0}
#endif
};
ERL_NIF_INIT(scheduler_SUITE, funcs, &load, NULL, NULL, NULL);
| Fix dirty scheduler tc on windows | Fix dirty scheduler tc on windows
| C | apache-2.0 | neeraj9/otp,legoscia/otp,dumbbell/otp,mikpe/otp,bjorng/otp,uabboli/otp,saleyn/otp,bugs-erlang-org/otp,matwey/otp,lemenkov/otp,aboroska/otp,fenollp/otp,mikpe/otp,potatosalad/otp,basho/otp,emile/otp,kvakvs/otp,neeraj9/otp,vladdu/otp,lemenkov/otp,bernardd/otp,jj1bdx/otp,fenollp/otp,mikpe/otp,aboroska/otp,erlang/otp,uabboli/otp,basho/otp,massemanet/otp,rlipscombe/otp,basho/otp,RaimoNiskanen/otp,emile/otp,bernardd/otp,vinoski/otp,mikpe/otp,isvilen/otp,kvakvs/otp,lightcyphers/otp,kvakvs/otp,ferd/otp,fenollp/otp,legoscia/otp,dgud/otp,RoadRunnr/otp,lightcyphers/otp,rlipscombe/otp,dgud/otp,rlipscombe/otp,lightcyphers/otp,RaimoNiskanen/otp,weisslj/otp,erlang/otp,jj1bdx/otp,bernardd/otp,dgud/otp,emacsmirror/erlang,neeraj9/otp,falkevik/otp,emile/otp,rlipscombe/otp,goertzenator/otp,lrascao/otp,massemanet/otp,cobusc/otp,bernardd/otp,weisslj/otp,massemanet/otp,isvilen/otp,legoscia/otp,massemanet/otp,lemenkov/otp,bjorng/otp,erlang/otp,uabboli/otp,bjorng/otp,falkevik/otp,electricimp/otp,lrascao/otp,bernardd/otp,emile/otp,release-project/otp,electricimp/otp,vinoski/otp,g-andrade/otp,bjorng/otp,goertzenator/otp,jj1bdx/otp,bsmr-erlang/otp,mikpe/otp,vladdu/otp,getong/otp,vinoski/otp,kvakvs/otp,goertzenator/otp,emacsmirror/erlang,neeraj9/otp,rlipscombe/otp,legoscia/otp,g-andrade/otp,RoadRunnr/otp,rlipscombe/otp,RaimoNiskanen/otp,matwey/otp,dgud/otp,basho/otp,basho/otp,g-andrade/otp,bernardd/otp,falkevik/otp,ahmedshafeeq/otp,potatosalad/otp,dgud/otp,bernardd/otp,lrascao/otp,lemenkov/otp,matwey/otp,lrascao/otp,goertzenator/otp,tuncer/otp,bugs-erlang-org/otp,legoscia/otp,emacsmirror/erlang,fenollp/otp,aboroska/otp,tuncer/otp,isvilen/otp,jj1bdx/otp,potatosalad/otp,RoadRunnr/otp,g-andrade/otp,emile/otp,bsmr-erlang/otp,neeraj9/otp,lrascao/otp,vladdu/otp,bugs-erlang-org/otp,isvilen/otp,vladdu/otp,ferd/otp,erlang/otp,RaimoNiskanen/otp,matwey/otp,rlipscombe/otp,falkevik/otp,release-project/otp,dumbbell/otp,neeraj9/otp,lightcyphers/otp,tuncer/otp,jj1bdx/otp,RoadRunnr/otp,getong/otp,erlang/otp,legoscia/otp,uabboli/otp,release-project/otp,matwey/otp,goertzenator/otp,weisslj/otp,cobusc/otp,lrascao/otp,saleyn/otp,emacsmirror/erlang,dumbbell/otp,bugs-erlang-org/otp,lrascao/otp,bsmr-erlang/otp,neeraj9/otp,aboroska/otp,cobusc/otp,bjorng/otp,lemenkov/otp,bsmr-erlang/otp,lightcyphers/otp,g-andrade/otp,jj1bdx/otp,kvakvs/otp,bsmr-erlang/otp,mikpe/otp,vinoski/otp,vladdu/otp,bugs-erlang-org/otp,tuncer/otp,jj1bdx/otp,getong/otp,cobusc/otp,erlang/otp,bjorng/otp,release-project/otp,isvilen/otp,ahmedshafeeq/otp,massemanet/otp,ferd/otp,vinoski/otp,tuncer/otp,electricimp/otp,weisslj/otp,ahmedshafeeq/otp,RoadRunnr/otp,cobusc/otp,vinoski/otp,g-andrade/otp,psyeugenic/otp,uabboli/otp,kvakvs/otp,bsmr-erlang/otp,fenollp/otp,dumbbell/otp,rlipscombe/otp,dumbbell/otp,aboroska/otp,psyeugenic/otp,aboroska/otp,fenollp/otp,saleyn/otp,ahmedshafeeq/otp,potatosalad/otp,goertzenator/otp,weisslj/otp,electricimp/otp,weisslj/otp,bjorng/otp,ahmedshafeeq/otp,vinoski/otp,dgud/otp,RoadRunnr/otp,mikpe/otp,emacsmirror/erlang,matwey/otp,isvilen/otp,tuncer/otp,ahmedshafeeq/otp,legoscia/otp,basho/otp,uabboli/otp,potatosalad/otp,electricimp/otp,cobusc/otp,electricimp/otp,vladdu/otp,bugs-erlang-org/otp,tuncer/otp,falkevik/otp,matwey/otp,ferd/otp,basho/otp,release-project/otp,ferd/otp,saleyn/otp,tuncer/otp,g-andrade/otp,weisslj/otp,lrascao/otp,lightcyphers/otp,matwey/otp,bernardd/otp,emile/otp,legoscia/otp,ferd/otp,lightcyphers/otp,cobusc/otp,RaimoNiskanen/otp,ahmedshafeeq/otp,saleyn/otp,massemanet/otp,fenollp/otp,kvakvs/otp,emile/otp,emile/otp,RoadRunnr/otp,potatosalad/otp,getong/otp,legoscia/otp,bugs-erlang-org/otp,massemanet/otp,emile/otp,bjorng/otp,vladdu/otp,dgud/otp,release-project/otp,ahmedshafeeq/otp,dumbbell/otp,psyeugenic/otp,electricimp/otp,uabboli/otp,getong/otp,erlang/otp,ferd/otp,psyeugenic/otp,RoadRunnr/otp,bugs-erlang-org/otp,isvilen/otp,jj1bdx/otp,kvakvs/otp,goertzenator/otp,saleyn/otp,ferd/otp,emacsmirror/erlang,vladdu/otp,falkevik/otp,kvakvs/otp,saleyn/otp,mikpe/otp,emacsmirror/erlang,ahmedshafeeq/otp,dgud/otp,lemenkov/otp,cobusc/otp,release-project/otp,RaimoNiskanen/otp,bsmr-erlang/otp,falkevik/otp,electricimp/otp,dgud/otp,potatosalad/otp,falkevik/otp,aboroska/otp,basho/otp,potatosalad/otp,mikpe/otp,aboroska/otp,emacsmirror/erlang,emacsmirror/erlang,psyeugenic/otp,lemenkov/otp,psyeugenic/otp,isvilen/otp,psyeugenic/otp,getong/otp,tuncer/otp,RoadRunnr/otp,vinoski/otp,vinoski/otp,dumbbell/otp,RaimoNiskanen/otp,jj1bdx/otp,jj1bdx/otp,goertzenator/otp,lrascao/otp,getong/otp,neeraj9/otp,bjorng/otp,aboroska/otp,g-andrade/otp,rlipscombe/otp,RaimoNiskanen/otp,dumbbell/otp,dumbbell/otp,erlang/otp,weisslj/otp,basho/otp,massemanet/otp,bsmr-erlang/otp,g-andrade/otp,vinoski/otp,ferd/otp,massemanet/otp,getong/otp,erlang/otp,erlang/otp,lightcyphers/otp,vladdu/otp,emacsmirror/erlang,uabboli/otp,bjorng/otp,bsmr-erlang/otp,mikpe/otp,release-project/otp,goertzenator/otp,isvilen/otp,potatosalad/otp,saleyn/otp,lemenkov/otp,fenollp/otp,uabboli/otp,getong/otp,falkevik/otp,psyeugenic/otp,isvilen/otp,dgud/otp,rlipscombe/otp,release-project/otp,saleyn/otp,matwey/otp,dumbbell/otp,RaimoNiskanen/otp,g-andrade/otp,weisslj/otp,electricimp/otp,potatosalad/otp,fenollp/otp,bernardd/otp,getong/otp |
1bc8d2a0c5d005f2470aabf3df3f0bfc8f7c34a5 | rosserial_mbed/src/ros_lib/MbedHardware.h | rosserial_mbed/src/ros_lib/MbedHardware.h | /*
* MbedHardware
*
* Created on: Aug 17, 2011
* Author: nucho
*/
#ifndef ROS_MBED_HARDWARE_H_
#define ROS_MBED_HARDWARE_H_
#include "mbed.h"
#include "MODSERIAL.h"
#define ROSSERIAL_BAUDRATE 57600
class MbedHardware {
public:
MbedHardware(MODSERIAL* io , long baud= ROSSERIAL_BAUDRATE)
:iostream(*io){
baud_ = baud;
t.start();
}
MbedHardware()
:iostream(USBTX, USBRX) {
baud_ = ROSSERIAL_BAUDRATE;
t.start();
}
MbedHardware(MbedHardware& h)
:iostream(h.iostream) {
this->baud_ = h.baud_;
t.start();
}
void setBaud(long baud){
this->baud_= baud;
}
int getBaud(){return baud_;}
void init(){
iostream.baud(baud_);
}
int read(){
if (iostream.readable()) {
return iostream.getc();
} else {
return -1;
}
};
void write(uint8_t* data, int length) {
for (int i=0; i<length; i++)
iostream.putc(data[i]);
}
unsigned long time(){return t.read_ms();}
protected:
MODSERIAL iostream;
long baud_;
Timer t;
};
#endif /* ROS_MBED_HARDWARE_H_ */
| /*
* MbedHardware
*
* Created on: Aug 17, 2011
* Author: nucho
*/
#ifndef ROS_MBED_HARDWARE_H_
#define ROS_MBED_HARDWARE_H_
#include "mbed.h"
#include "MODSERIAL.h"
class MbedHardware {
public:
MbedHardware(PinName tx, PinName rx, long baud = 57600)
:iostream(tx, rx){
baud_ = baud;
t.start();
}
MbedHardware()
:iostream(USBTX, USBRX) {
baud_ = 57600;
t.start();
}
void setBaud(long baud){
this->baud_= baud;
}
int getBaud(){return baud_;}
void init(){
iostream.baud(baud_);
}
int read(){
if (iostream.readable()) {
return iostream.getc();
} else {
return -1;
}
};
void write(uint8_t* data, int length) {
for (int i=0; i<length; i++)
iostream.putc(data[i]);
}
unsigned long time(){return t.read_ms();}
protected:
MODSERIAL iostream;
long baud_;
Timer t;
};
#endif /* ROS_MBED_HARDWARE_H_ */
| Fix unnderlying issue with Stream class being private | Fix unnderlying issue with Stream class being private
| C | mit | GeodesicCarbon/protopaja-sick,GeodesicCarbon/protopaja-sick,GeodesicCarbon/protopaja-sick,GeodesicCarbon/protopaja-sick,GeodesicCarbon/protopaja-sick,GeodesicCarbon/protopaja-sick,GeodesicCarbon/protopaja-sick |
879fdecdf38a2647c9a4793fbffedeaf150adfbd | src/utils/image_persister.h | src/utils/image_persister.h | #ifndef SRC_UTILS_IMAGE_PERSISTER_H_
#define SRC_UTILS_IMAGE_PERSISTER_H_
#include <string>
#include <vector>
#include <Magick++.h>
#include <Eigen/Core>
/**
* \brief Provides static functions to load and save images
*
*/
class ImagePersister
{
public:
template <class T>
static void saveRGBA32F(T *data, int width, int height, std::string filename)
{
Magick::InitializeMagick("");
Magick::Image image(width, height, "RGBA", Magick::StorageType::FloatPixel,
data);
image.write(filename);
}
static std::vector<Eigen::Vector4f> loadRGBA32F(std::string filename)
{
Magick::Image image(filename);
std::vector<Eigen::Vector4f> result(image.columns() * image.rows());
image.write(0, 0, image.columns(), image.rows(), "RGBA",
Magick::StorageType::FloatPixel, result.data());
return result;
}
};
#endif // SRC_UTILS_IMAGE_PERSISTER_H_
| #ifndef SRC_UTILS_IMAGE_PERSISTER_H_
#define SRC_UTILS_IMAGE_PERSISTER_H_
#include <string>
#include <vector>
#include <Magick++.h>
#include <Eigen/Core>
/**
* \brief Provides static functions to load and save images
*
*/
class ImagePersister
{
public:
template <class T>
static void saveRGBA32F(T *data, int width, int height, std::string filename)
{
Magick::InitializeMagick("");
Magick::Image image(width, height, "RGBA", Magick::StorageType::FloatPixel,
data);
image.write(filename);
}
static void saveR32F(float *data, int width, int height, std::string filename)
{
Magick::InitializeMagick("");
Magick::Image image(width, height, "R", Magick::StorageType::FloatPixel,
data);
image.write(filename);
}
static std::vector<Eigen::Vector4f> loadRGBA32F(std::string filename)
{
Magick::Image image(filename);
std::vector<Eigen::Vector4f> result(image.columns() * image.rows());
image.write(0, 0, image.columns(), image.rows(), "RGBA",
Magick::StorageType::FloatPixel, result.data());
return result;
}
};
#endif // SRC_UTILS_IMAGE_PERSISTER_H_
| Add method to save a single component float image. | Add method to save a single component float image.
| C | mit | Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller,Christof/voly-labeller |
746d16a24272b06f866634934403dbef9d59fa28 | include/Athena-Scripting/Utils.h | include/Athena-Scripting/Utils.h | /** @file Utils.h
@author Philip Abbet
Declaration of some utilities related to scripting
*/
#ifndef _ATHENA_SCRIPTING_UTILS_H_
#define _ATHENA_SCRIPTING_UTILS_H_
#include <Athena-Scripting/Prerequisites.h>
#include <v8.h>
namespace Athena {
namespace Scripting {
//------------------------------------------------------------------------------------
/// @brief Convert an JavaScript Object to a C++ one
//------------------------------------------------------------------------------------
template<typename T>
T* CastJSObject(v8::Handle<v8::Value> const &h)
{
if (!h->IsObject())
return 0;
v8::Local<v8::Object> obj = h->ToObject();
if (obj->InternalFieldCount() != 1)
return 0;
v8::Local<v8::External> external = v8::Local<v8::External>::Cast(obj->GetInternalField(0));
return static_cast<T*>(external->Value());
}
}
}
#endif
| Add an utility function (CastJSObject) | Add an utility function (CastJSObject)
| C | mit | Kanma/Athena-Scripting,Kanma/Athena-Scripting,Kanma/Athena-Scripting |
|
8dc65c6cdce9d25b827eb893849dec36270aaa5c | drivers/scsi/qla4xxx/ql4_version.h | drivers/scsi/qla4xxx/ql4_version.h | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k10"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k11"
| Update driver version to 5.03.00-k11 | [SCSI] qla4xxx: Update driver version to 5.03.00-k11
Signed-off-by: Adheer Chandravanshi <[email protected]>
Signed-off-by: Vikas Chaudhary <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
b7573553c881851d4b27382be707bdff08e14bce | exercises/002-blinking-led/main.c | exercises/002-blinking-led/main.c | #include <inc/hw_types.h>
#include <driverlib/sysctl.h>
#include <stdio.h>
#include <string.h>
#include <inc/hw_memmap.h>
#include <inc/hw_sysctl.h>
#include <driverlib/gpio.h>
#include <driverlib/debug.h>
int UP=0;
int i;
int main(){
SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
GPIOPinTypeGPIOInput(GPIO_PORTE_BASE,GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);
GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_0);
GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
while(1){
UP = GPIOPinRead(GPIO_PORTE_BASE,(GPIO_PIN_0));
UP = UP&0x01;
if (UP== 0x01)
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, 0x00);
else
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, 0xFF);
}
}
| Add blinking led example for TI Kit | Add blinking led example for TI Kit | C | mit | marceloboeira/unisinos-microprocessors |
|
93cc322e16e5876c4d2236a91982ad483f392266 | chapter1/1-10/external-longest.c | chapter1/1-10/external-longest.c | //
// Created by matti on 16.9.2015.
//
#include <stdio.h>
#define MAXLINE 1000
int max;
char line[MAXLINE];
char longest[MAXLINE];
int getline(void);
void copy(void);
int main() {
int len;
extern int max;
extern char longest[];
max = 0;
while((len = getline()) > 0) {
if (len > max) {
max = len;
copy();
}
if (max > 0) {
printf("%s", longest);
}
return 0;
}
}
int getline(void) {
int c, i;
extern char line[];
for(i = 0; i < MAXLINE - 1 && (c=getchar()) != EOF && c != '\n'; ++i) {
line[i] = c;
if (c == '\n') {
line[i] = c;
++i;
}
line[i] = '\0';
return i;
}
} | Add unfinished 1-10 external example | Add unfinished 1-10 external example
| C | mit | melonmanchan/k-and-r |
|
f187f7b6f2ca4b719c88199e65a8ac298f5164fe | test/cases/__attribute__/ctor_dtor_warn.c | test/cases/__attribute__/ctor_dtor_warn.c | // RUN: %check %s
int x __attribute((constructor)); // CHECK: warning: constructor attribute on non-function
int main()
{
void f() __attribute((constructor)); // CHECK: warning: constructor attribute on non-global function
}
| // RUN: %check %s
int x __attribute((constructor)); // CHECK: warning: constructor attribute on non-function
struct Q {
int x __attribute((constructor)); // CHECK: warning: constructor attribute on non-function
};
int main()
{
void f() __attribute((constructor)); // CHECK: warning: constructor attribute on non-global function
}
| Check ctor/dtor attribute on members | Check ctor/dtor attribute on members
| C | mit | bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler |
5c4046786151a99e098a02b576cf036ecce32db4 | scripts/sharedMainLayoutScripts/closeWindowHaltScript.c | scripts/sharedMainLayoutScripts/closeWindowHaltScript.c | sharedMainLayoutScripts: closeWindowHaltScript
Close Window [ Current Window ]
Halt Script
February 9, 平成26 10:24:51 Imagination Quality Management.fp7 - closeWindowHaltScript -1- | Create window closing script with halt command. | Create window closing script with halt command.
I was selecting Halt command from the button options, but felt it is
better practice to put all commands in scripts, not buttons for better
transparency.
| C | apache-2.0 | HelpGiveThanks/Library,HelpGiveThanks/Library |
|
acd3a4a5b459b405418b1651f59c38bca4fa0050 | TDTHotChocolate/FoundationAdditions/NSString+TDTAdditions.h | TDTHotChocolate/FoundationAdditions/NSString+TDTAdditions.h | #import <Foundation/Foundation.h>
@interface NSString (TDTAdditions)
/**
@return a string representing a newly generated version 4 random UUID
*/
+ (instancetype)randomUUID;
/**
@return The SHA1 of the receiver
*/
- (NSString *)sha1Digest;
/**
@return a new string by trimming non alphanumeric characters from the receiver
*/
- (NSString *)stringByTrimmingNonAlphaNumericCharacters;
/**
@return `nil` if the receiver is blank, otherwise returns the receiver.
*/
- (NSString *)stringByNillingBlanks;
/**
There is no platform agnostic format specifier for an `NSUInteger`. Ergo this.
*/
+ (NSString *)stringWithUnsignedInteger:(NSUInteger)uInteger;
@end
| #import <Foundation/Foundation.h>
@interface NSString (TDTAdditions)
/**
@return A string representing a newly generated version 4 random UUID
*/
+ (instancetype)randomUUID;
/**
@return The SHA1 of the receiver
*/
- (NSString *)sha1Digest;
/**
@return A new string by trimming non alphanumeric characters from the receiver
*/
- (NSString *)stringByTrimmingNonAlphaNumericCharacters;
/**
@return `nil` if the receiver is blank, otherwise returns the receiver.
*/
- (NSString *)stringByNillingBlanks;
/**
There is no platform agnostic format specifier for an `NSUInteger`. Ergo this.
*/
+ (NSString *)stringWithUnsignedInteger:(NSUInteger)uInteger;
@end
| Fix initial case for header documentation sentences | Fix initial case for header documentation sentences
| C | bsd-3-clause | talk-to/Chocolate,talk-to/Chocolate |
a9fe5d311909b20ea275fb985a7b12eb794180e6 | source/common/halfling_sys.h | source/common/halfling_sys.h | /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_HALFLING_SYS_H
#define COMMON_HALFLING_SYS_H
#include "common/typedefs.h"
// Only include the base windows libraries
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <comip.h>
// GDI+
#include <gdiplus.h>
// Un-define min and max from the windows headers
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
#endif
| /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_HALFLING_SYS_H
#define COMMON_HALFLING_SYS_H
#include "common/typedefs.h"
// Only include the base windows libraries
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <comip.h>
// GDI+
#include <gdiplus.h>
// Un-define min and max from the windows headers
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
#define AssertMsg(condition, message) \
do { \
if (!(condition)) { \
std::cerr << "Assertion `" #condition "` failed in " << __FILE__ \
<< " line " << __LINE__ << ": " << message << std::endl; \
std::exit(EXIT_FAILURE); \
} \
} while (false)
#endif
| Create define for asserting with a message | COMMON: Create define for asserting with a message
| C | apache-2.0 | RichieSams/thehalflingproject,RichieSams/thehalflingproject,RichieSams/thehalflingproject |
3b85da737e88a6139139f79dd6466f32d7309f68 | TableGen/CodeGenRegisters.h | TableGen/CodeGenRegisters.h | //===- CodeGenRegisters.h - Register and RegisterClass Info -----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines structures to encapsulate information gleaned from the
// target register and register class definitions.
//
//===----------------------------------------------------------------------===//
#ifndef CODEGEN_REGISTERS_H
#define CODEGEN_REGISTERS_H
#include <string>
namespace llvm {
class Record;
/// CodeGenRegister - Represents a register definition.
struct CodeGenRegister {
Record *TheDef;
const std::string &getName() const;
CodeGenRegister(Record *R) : TheDef(R) {}
};
struct CodeGenRegisterClass {
};
}
#endif
| Add initial support for register and register class representation. Obviously this is not done. | Add initial support for register and register class representation.
Obviously this is not done.
git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@15804 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-3-clause | lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx,lodyagin/bare_cxx |
|
31f937755d32d1b6d6b2c30cecc6398f2aa00b3a | md5.h | md5.h | /* File: connection.h
*
* Description: See "md.h"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __MD5_H__
#define __MD5_H__
#include "psqlodbc.h"
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#define MD5_ODBC
#define FRONTEND
#endif
#define MD5_PASSWD_LEN 35
/* From c.h */
#ifndef __BEOS__
#ifndef __cplusplus
#ifndef bool
typedef char bool;
#endif
#ifndef true
#define true ((bool) 1)
#endif
#ifndef false
#define false ((bool) 0)
#endif
#endif /* not C++ */
#endif /* __BEOS__ */
/* Also defined in include/c.h */
#if SIZEOF_UINT8 == 0
typedef unsigned char uint8; /* == 8 bits */
typedef unsigned short uint16; /* == 16 bits */
typedef unsigned int uint32; /* == 32 bits */
#endif /* SIZEOF_UINT8 == 0 */
extern bool md5_hash(const void *buff, size_t len, char *hexsum);
extern bool EncryptMD5(const char *passwd, const char *salt,
size_t salt_len, char *buf);
#endif
| /* File: md5.h
*
* Description: See "md5.c"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __MD5_H__
#define __MD5_H__
#include "psqlodbc.h"
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#define MD5_ODBC
#define FRONTEND
#endif
#define MD5_PASSWD_LEN 35
/* From c.h */
#ifndef __BEOS__
#ifndef __cplusplus
#ifndef bool
typedef char bool;
#endif
#ifndef true
#define true ((bool) 1)
#endif
#ifndef false
#define false ((bool) 0)
#endif
#endif /* not C++ */
#endif /* __BEOS__ */
/* Also defined in include/c.h */
#if SIZEOF_UINT8 == 0
typedef unsigned char uint8; /* == 8 bits */
typedef unsigned short uint16; /* == 16 bits */
typedef unsigned int uint32; /* == 32 bits */
#endif /* SIZEOF_UINT8 == 0 */
extern bool md5_hash(const void *buff, size_t len, char *hexsum);
extern bool EncryptMD5(const char *passwd, const char *salt,
size_t salt_len, char *buf);
#endif
| Fix comment at top of file to match file name. | Fix comment at top of file to match file name.
| C | lgpl-2.1 | gavioto/psqlodbc,treasure-data/prestogres-odbc,Distrotech/psqlodbc,hlinnaka/psqlodbc,treasure-data/prestogres-odbc,treasure-data/prestogres-odbc,Distrotech/psqlodbc,hlinnaka/psqlodbc,Distrotech/psqlodbc,gavioto/psqlodbc,hlinnaka/psqlodbc,gavioto/psqlodbc |
df008fe115c9c2ce79cf1a412f598101ee3788c4 | tests/feature_tests/error_bool.c | tests/feature_tests/error_bool.c | int main() {
struct A {} a;
// error: '&&' operator requires scalar operands
a && a;
// error: '||' operator requires scalar operands
a || a;
// error: '!' operator requires scalar operand
!a;
}
| int main() {
struct A {} a;
// error: '&&' operator requires scalar operands
a && a;
// error: '||' operator requires scalar operands
1 || a;
// error: '||' operator requires scalar operands
a || 1;
// error: '!' operator requires scalar operand
!a;
}
| Improve tests for boolean operators | Improve tests for boolean operators
| C | mit | ShivamSarodia/ShivyC,ShivamSarodia/ShivyC,ShivamSarodia/ShivyC |
1534a6d6d9baddc9904cc160bb24cf716e1b5c94 | tests/syscalls/sysconf_pagesize.c | tests/syscalls/sysconf_pagesize.c | /*
* Copyright (c) 2012 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.
*/
#include <stdio.h>
#if defined(__GLIBC__)
#include <unistd.h>
#else
/*
* TODO(bsy): remove when newlib toolchain catches up
* http://code.google.com/p/nativeclient/issues/detail?id=2714
*/
#include "native_client/src/trusted/service_runtime/include/sys/unistd.h"
#endif
int main(void) {
#if defined(__GLIBC__)
long rv = sysconf(_SC_PAGESIZE);
#else
long rv = sysconf(NACL_ABI__SC_PAGESIZE);
#endif
printf("%ld\n", rv);
return rv != (1<<16);
}
| /*
* Copyright (c) 2012 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.
*/
#include <stdio.h>
#include <unistd.h>
int main(void) {
long rv = sysconf(_SC_PAGESIZE);
printf("%ld\n", rv);
return rv != (1<<16);
}
| Clean up sysconf() test to address a TODO that depended on a toolchain roll | Clean up sysconf() test to address a TODO that depended on a toolchain roll
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3909
BUG=https://code.google.com/p/nativeclient/issues/detail?id=2714
TEST=run_sysconf_pagesize_test
Review URL: https://codereview.chromium.org/655963003
git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@13915 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
| C | bsd-3-clause | sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client |
2041a58c8754e626666f6014b7dcae9b3513d20a | include/nme/NmeApi.h | include/nme/NmeApi.h | #ifndef NME_NME_API_H
#define NME_NME_API_H
#include "Pixel.h"
namespace nme
{
enum { NME_API_VERSION = 100 };
class NmeApi
{
public:
virtual int getApiVersion() { return NME_API_VERSION; }
virtual bool getC0IsRed() { return gC0IsRed; }
};
extern NmeApi gNmeApi;
} // end namespace nme
#endif
| Put ImageBuffer into separate header | Put ImageBuffer into separate header
| C | mit | madrazo/nme,thomasuster/NME,madrazo/nme,madrazo/nme,nmehost/nme,nmehost/nme,thomasuster/NME,thomasuster/NME,thomasuster/NME,thomasuster/NME,haxenme/nme,nmehost/nme,haxenme/nme,haxenme/nme,thomasuster/NME,madrazo/nme,madrazo/nme,madrazo/nme,haxenme/nme,haxenme/nme |
|
2ab77e34c2e175d90c79dde9b708e3c5beff64de | include/sys/dirent.h | include/sys/dirent.h | /*
* Copyright (c) 2007, 2008, 2009, ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
* If you do not find this file, copies can be found by writing to:
* ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
*/
#ifndef DIRENT_H_
#define DIRENT_H_
#include <sys/cdefs.h>
#define NAME_MAX 512
struct dirent {
// long d_ino;
// off_t d_off;
// unsigned short d_reclen;
char d_name[NAME_MAX + 1];
};
typedef struct {
struct dirent dirent;
void *vh; // really a vfs_handle_t
} DIR;
__BEGIN_DECLS
DIR *opendir(const char *pathname);
struct dirent *readdir(DIR* dir);
int closedir(DIR *dir);
__END_DECLS
#endif
| /*
* Copyright (c) 2007, 2008, 2009, ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
* If you do not find this file, copies can be found by writing to:
* ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
*/
#ifndef DIRENT_H_
#define DIRENT_H_
#include <sys/cdefs.h>
// Depending on header include order, this may collide with the definition in
// newlib's <dirent.h> See open issue: https://code.systems.ethz.ch/T58#1169
#ifndef NAME_MAX
#define NAME_MAX 512
#endif
struct dirent {
// long d_ino;
// off_t d_off;
// unsigned short d_reclen;
char d_name[NAME_MAX + 1];
};
typedef struct {
struct dirent dirent;
void *vh; // really a vfs_handle_t
} DIR;
__BEGIN_DECLS
DIR *opendir(const char *pathname);
struct dirent *readdir(DIR* dir);
int closedir(DIR *dir);
__END_DECLS
#endif
| Duplicate definition of NAME_MAX macro | Duplicate definition of NAME_MAX macro
I broke the build in rBFIaee0075101b1; this is just a temporary band-aid and
only masks the more general issue described in T58. If you have an idea for a
better fix, please let me know.
Signed-off-by: Zaheer Chothia <[email protected]>
| C | mit | BarrelfishOS/barrelfish,BarrelfishOS/barrelfish,BarrelfishOS/barrelfish,8l/barrelfish,kishoredbn/barrelfish,BarrelfishOS/barrelfish,kishoredbn/barrelfish,kishoredbn/barrelfish,BarrelfishOS/barrelfish,kishoredbn/barrelfish,BarrelfishOS/barrelfish,8l/barrelfish,kishoredbn/barrelfish,8l/barrelfish,kishoredbn/barrelfish,BarrelfishOS/barrelfish,8l/barrelfish,8l/barrelfish,BarrelfishOS/barrelfish,8l/barrelfish,BarrelfishOS/barrelfish |
e76435c6c60bf1247d6bb91fe8cf5e57a896da55 | src/main/c/emulator/src/config.h | src/main/c/emulator/src/config.h | #ifndef CONFIG_H
#define CONFIG_H
//#define QEMU
#define SIM
#define OS_CALL 0xC0000000
#define DTB 0xC3000000
#endif
| #ifndef CONFIG_H
#define CONFIG_H
//#define QEMU
#define SIM
#ifndef OS_CALL
#define OS_CALL 0xC0000000
#endif
#ifndef DTB
#define DTB 0xC3000000
#endif
#endif
| Allow to set custom DTB/OS_CALL addresses | Allow to set custom DTB/OS_CALL addresses
Setting those from command line during compilation allows
to create a custom setup without the need of modifying the
sources.
| C | mit | SpinalHDL/VexRiscv,SpinalHDL/VexRiscv,SpinalHDL/VexRiscv,SpinalHDL/VexRiscv,SpinalHDL/VexRiscv |
d1808f380aed0fa19573909ada3e26233c80f87c | test/CodeGen/microsoft-call-conv.c | test/CodeGen/microsoft-call-conv.c | // RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
void __fastcall f1(void);
void __stdcall f2(void);
void __thiscall f3(void);
void __fastcall f4(void) {
// CHECK: define x86_fastcallcc void @f4()
f1();
// CHECK: call x86_fastcallcc void @f1()
}
void __stdcall f5(void) {
// CHECK: define x86_stdcallcc void @f5()
f2();
// CHECK: call x86_stdcallcc void @f2()
}
void __thiscall f6(void) {
// CHECK: define x86_thiscallcc void @f6()
f3();
// CHECK: call x86_thiscallcc void @f3()
}
// PR5280
void (__fastcall *pf1)(void) = f1;
void (__stdcall *pf2)(void) = f2;
void (__thiscall *pf3)(void) = f3;
void (__fastcall *pf4)(void) = f4;
void (__stdcall *pf5)(void) = f5;
void (__thiscall *pf6)(void) = f6;
int main(void) {
f4(); f5(); f6();
// CHECK: call x86_fastcallcc void @f4()
// CHECK: call x86_stdcallcc void @f5()
// CHECK: call x86_thiscallcc void @f6()
pf1(); pf2(); pf3(); pf4(); pf5(); pf6();
// CHECK: call x86_fastcallcc void %{{.*}}()
// CHECK: call x86_stdcallcc void %{{.*}}()
// CHECK: call x86_thiscallcc void %{{.*}}()
// CHECK: call x86_fastcallcc void %{{.*}}()
// CHECK: call x86_stdcallcc void %{{.*}}()
// CHECK: call x86_thiscallcc void %{{.*}}()
return 0;
}
// PR7117
void __stdcall f7(foo) int foo; {}
void f8(void) {
f7(0);
// CHECK: call x86_stdcallcc void (...)* bitcast
}
| Add missing test case, provided by Steven Watanabe. | Add missing test case, provided by Steven Watanabe.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@104037 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-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 |
|
5db8b0845e766877bebc23ad823c1681e2218624 | vendor/brightray/browser/net_log.h | vendor/brightray/browser/net_log.h | // Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef BROWSER_NET_LOG_H_
#define BROWSER_NET_LOG_H_
#include "base/files/scoped_file.h"
#include "net/log/net_log.h"
#include "net/log/file_net_log_observer.h"
namespace brightray {
class NetLog : public net::NetLog {
public:
NetLog();
~NetLog() override;
void StartLogging(net::URLRequestContext* url_request_context);
private:
base::ScopedFILE log_file_;
net::FileNetLogObserver write_to_file_observer_;
DISALLOW_COPY_AND_ASSIGN(NetLog);
};
} // namespace brightray
#endif // BROWSER_NET_LOG_H_
| // Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef BROWSER_NET_LOG_H_
#define BROWSER_NET_LOG_H_
#include "base/files/scoped_file.h"
#include "net/log/net_log.h"
#include "net/log/file_net_log_observer.h"
#include "net/url_request/url_request_context.h"
namespace brightray {
class NetLog : public net::NetLog {
public:
NetLog();
~NetLog() override;
void StartLogging(net::URLRequestContext* url_request_context);
private:
base::ScopedFILE log_file_;
net::FileNetLogObserver write_to_file_observer_;
DISALLOW_COPY_AND_ASSIGN(NetLog);
};
} // namespace brightray
#endif // BROWSER_NET_LOG_H_
| Add missing explicit include of net/url_request/url_request_context.h | Add missing explicit include of net/url_request/url_request_context.h
| C | mit | brave/muon,brave/electron,brave/electron,brave/electron,brave/muon,brave/muon,brave/electron,brave/muon,brave/electron,brave/muon,brave/muon,brave/electron |
711b144ed5c1bb22def8f0d7a46eb58a0bbc9bb6 | test/tools/llvm-symbolizer/print_context.c | test/tools/llvm-symbolizer/print_context.c | // REQUIRES: x86_64-linux
// RUN: %host_cc -O0 -g %s -o %t 2>&1
// RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s
//
// See PR31870 for more details on the XFAIL
// XFAIL: avr
#include <stdio.h>
int inc(int a) {
return a + 1;
}
int main() {
printf("%p\n", inc);
return 0;
}
// CHECK: inc
// CHECK: print_context.c:7
// CHECK: 5 : #include
// CHECK: 6 :
// CHECK: 7 >: int inc
// CHECK: 8 : return
// CHECK: 9 : }
| // REQUIRES: x86_64-linux
// RUN: %host_cc -O0 -g %s -o %t 2>&1
// RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s
#include <stdio.h>
int inc(int a) {
return a + 1;
}
int main() {
printf("%p\n", inc);
return 0;
}
// CHECK: inc
// CHECK: print_context.c:7
// CHECK: 5 : #include
// CHECK: 6 :
// CHECK: 7 >: int inc
// CHECK: 8 : return
// CHECK: 9 : }
| Revert "[AVR] Mark a failing symbolizer test as XFAIL" | Revert "[AVR] Mark a failing symbolizer test as XFAIL"
This reverts commit 83a0e876349adb646ba858eb177b22b0b4bfc59a.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@309515 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm |
6bf6d60fb44205bab201688d949e3937ee8dbd26 | include/net/RestrictMacro.h | include/net/RestrictMacro.h | #ifndef RESTRICTMACRO_H_
#define RESTRICTMACRO_H_
#ifdef COBRA_RESTRICT
#define COBRA_RESTRICT_BREAK \
break; \
#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM ) \
if (EXP > NUM) \
break; \
#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM ) \
if ( EXP > NUM ) \
return false; \
#else
#define COBRA_RESTRICT_BREAK
#define COBRA_RESTRICT_N_BREAK( EXP, NUM )
#define COBRA_RESTRICT_N_RETURN_FALSE( EXP, NUM )
#endif
#endif /*RESTRICTMACRO_H_*/
| #ifndef RESTRICTMACRO_H_
#define RESTRICTMACRO_H_
#ifdef COBRA_RESTRICT
#define COBRA_RESTRICT_BREAK \
break; \
#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM ) \
if (EXP > NUM) \
break; \
#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM ) \
if ( EXP > NUM ) \
return false; \
#else
#define COBRA_RESTRICT_BREAK
#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM )
#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM )
#endif
#endif /*RESTRICTMACRO_H_*/
| Fix compilation error of RestrictionMacro.h in sf1 if COBRA_RESTRICT is not defined. | Fix compilation error of RestrictionMacro.h in sf1 if COBRA_RESTRICT is not defined.
| C | apache-2.0 | izenecloud/izenelib,izenecloud/izenelib,pombredanne/izenelib,pombredanne/izenelib,izenecloud/izenelib,izenecloud/izenelib,pombredanne/izenelib,pombredanne/izenelib |
9b1a95eb03798b3b6d969eca13fbbf6a9b0156b0 | vk_default_loader.c | vk_default_loader.c | #include "vk_default_loader.h"
#include "vulkan/vulkan.h"
#if defined(_WIN32)
#elif defined(unix) || defined(__unix__) || defined(__unix)
#include <dlfcn.h>
static void* (*loadSym)(void* lib, const char* procname);
static void* loadSymWrap(VkInstance instance, const char* vkproc) {
return (*loadSym)(instance, vkproc);
}
#endif
void* getDefaultProcAddr() {
#if defined(_WIN32)
// TODO: WIN32 Vulkan loader
#elif defined(__APPLE__) && defined(__MACH__)
// TODO: Darwin Vulkan loader (via MoltenVK)
#elif defined(unix) || defined(__unix__) || defined(__unix)
void* libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
if (libvulkan == NULL) {
return NULL;
}
loadSym = dlsym(libvulkan, "vkGetInstanceProcAddr");
if (loadSym == NULL) {
return NULL;
}
return &loadSymWrap;
#else
// Unknown operating system
#endif
} | #include "vk_default_loader.h"
#include "vulkan/vulkan.h"
#if defined(_WIN32)
#elif defined(unix) || defined(__unix__) || defined(__unix)
#include <dlfcn.h>
static void* (*symLoader)(void* lib, const char* procname);
static void* loaderWrap(VkInstance instance, const char* vkproc) {
return (*symLoader)(instance, vkproc);
}
#elif defined(__APPLE__) && defined(__MACH__)
// #include <GLFW/glfw3.h>
// static void* loaderWrap(VkInstance instance, const char* vkproc) {
// return glfwGetInstanceProcAddress(instance, vkproc);
// }
#endif
void* getDefaultProcAddr() {
#if defined(_WIN32)
// TODO: WIN32 Vulkan loader
return NULL;
#elif defined(__APPLE__) && defined(__MACH__)
// return &loaderWrap;
return NULL;
#elif defined(unix) || defined(__unix__) || defined(__unix)
void* libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
if (libvulkan == NULL) {
return NULL;
}
symLoader = dlsym(libvulkan, "vkGetInstanceProcAddr");
if (symLoader == NULL) {
return NULL;
}
return &loaderWrap;
#else
// Unknown operating system
return NULL;
#endif
}
| Fix no-return warning in loader, also change the internal variable names. | Fix no-return warning in loader, also change the internal variable names.
| C | mit | vulkan-go/vulkan,vulkan-go/vulkan |
21a451d7f90a7953e0eb64101188b136d076ad23 | ouzel/RenderTarget.h | ouzel/RenderTarget.h | // Copyright (C) 2016 Elviss Strazdins
// This file is part of the Ouzel engine.
#pragma once
#include <algorithm>
#include <memory>
#include "Types.h"
#include "Noncopyable.h"
#include "Size2.h"
namespace ouzel
{
namespace graphics
{
class Renderer;
class Texture;
class RenderTarget: public Noncopyable
{
friend Renderer;
public:
virtual ~RenderTarget();
virtual bool init(const Size2& newSize, bool useDepthBuffer);
TexturePtr getTexture() const { return texture; }
protected:
RenderTarget();
Size2 size;
bool depthBuffer = false;
TexturePtr texture;
};
} // namespace graphics
} // namespace ouzel
| // Copyright (C) 2016 Elviss Strazdins
// This file is part of the Ouzel engine.
#pragma once
#include <algorithm>
#include <memory>
#include "Types.h"
#include "Noncopyable.h"
#include "Size2.h"
#include "Color.h"
namespace ouzel
{
namespace graphics
{
class Renderer;
class Texture;
class RenderTarget: public Noncopyable
{
friend Renderer;
public:
virtual ~RenderTarget();
virtual bool init(const Size2& newSize, bool useDepthBuffer);
virtual void setClearColor(Color color) { clearColor = color; }
virtual Color getClearColor() const { return clearColor; }
TexturePtr getTexture() const { return texture; }
protected:
RenderTarget();
Size2 size;
bool depthBuffer = false;
Color clearColor;
TexturePtr texture;
};
} // namespace graphics
} // namespace ouzel
| Add clear color to render target | Add clear color to render target
| C | unlicense | Hotspotmar/ouzel,elnormous/ouzel,elnormous/ouzel,elvman/ouzel,elvman/ouzel,elnormous/ouzel,Hotspotmar/ouzel,Hotspotmar/ouzel |
4977c30315dca68e18a8605f235803380b2644dc | Source/SuggestionView/Source/SuggestionView/IMSuggestionView.h | Source/SuggestionView/Source/SuggestionView/IMSuggestionView.h | //
// ImojiSDKUI
//
// Created by Nima Khoshini
// Copyright (C) 2015 Imoji
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
#import <Foundation/Foundation.h>
@class IMCollectionView;
@class IMImojiSession;
@interface IMSuggestionView : UIView
@property(nonatomic, strong, readonly) IMCollectionView *collectionView;
/**
* @abstract Creates a collection view with the specified Imoji session
*/
+ (nonnull instancetype)imojiSuggestionViewWithSession:(nonnull IMImojiSession *)session;
@end
| //
// ImojiSDKUI
//
// Created by Nima Khoshini
// Copyright (C) 2015 Imoji
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
#import <Foundation/Foundation.h>
@class IMCollectionView;
@class IMImojiSession;
@interface IMSuggestionView : UIView
@property(nonatomic, strong, readonly, nonnull) IMCollectionView *collectionView;
/**
* @abstract Creates a collection view with the specified Imoji session
*/
+ (nonnull instancetype)imojiSuggestionViewWithSession:(nonnull IMImojiSession *)session;
@end
| Fix warning with nonnull member for SuggetionView | Fix warning with nonnull member for SuggetionView
| C | mit | imojiengineering/imoji-ios-sdk-ui,imojiengineering/imoji-ios-sdk-ui,alex-hoang/imoji-ios-sdk-ui,alex-hoang/imoji-ios-sdk-ui,kbot/imoji-ios-sdk-ui,imojiengineering/imoji-ios-sdk-ui,kbot/imoji-ios-sdk-ui,kbot/imoji-ios-sdk-ui,alex-hoang/imoji-ios-sdk-ui,imojiengineering/imoji-ios-sdk-ui,alex-hoang/imoji-ios-sdk-ui |
25852400ccb5d7e35904cc3d270be741784ec22e | drivers/scsi/qla2xxx/qla_version.h | drivers/scsi/qla2xxx/qla_version.h | /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.04.00.07-k"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 4
#define QLA_DRIVER_PATCH_VER 0
#define QLA_DRIVER_BETA_VER 0
| /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.04.00.08-k"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 4
#define QLA_DRIVER_PATCH_VER 0
#define QLA_DRIVER_BETA_VER 0
| Update the driver version to 8.04.00.08-k. | [SCSI] qla2xxx: Update the driver version to 8.04.00.08-k.
Signed-off-by: Giridhar Malavali <[email protected]>
Signed-off-by: Saurav Kashyap <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
| C | mit | KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas |
a96d949d521ea368bee3060dfe430fed5a631450 | ProcessLauncher/ProcessNative.h | ProcessLauncher/ProcessNative.h | #pragma once
#include "ProcessPlatform.h"
namespace ugly
{
namespace process
{
class ProcessNative : public ProcessPlatform
{
public:
ProcessNative(const std::string& path, const std::string& arguments);
const std::string& GetFullCommandLine() const override { return commandLine; }
private:
const std::string& commandLine;
};
}
} | #pragma once
#include "ProcessPlatform.h"
namespace ugly
{
namespace process
{
class ProcessNative : public ProcessPlatform
{
public:
ProcessNative(const std::string& path, const std::string& arguments);
const std::string& GetFullCommandLine() const override { return commandLine; }
private:
std::string commandLine;
};
}
} | Fix memory corruption, trailing & in member variable type. | Fix memory corruption, trailing & in member variable type.
| C | mit | Ilod/ugly,Ilod/ugly,Ilod/ugly |
3ecfe194476fbead8cf8be9ccce138140945ce74 | copasi/output/CUDFunctionDB.h | copasi/output/CUDFunctionDB.h | /*****************************************************************************
* PROGRAM NAME: CUDFunctionDB.h
* PROGRAMMER: Wei Sun [email protected]
* PURPOSE: Define the user defined function DB object to hold all the user
* defined function
*****************************************************************************/
#ifndef COPASI_CUDFunctionDB
#define COPASI_CUDFunctionDB
#include <string>
#include "copasi.h"
#include "output/output.h"
#include "utilities/utilities.h"
class CUDFunctionDB
{
private:
/**
* "User-defined functions" string in gps file
*/
string mNameStr;
/**
* The number of user defined function
*/
C_INT16 mItems;
/**
* Vector of user defined functions
*/
CCopasiVectorN < CBaseFunction > mUDFunctions;
public:
/**
*
*/
CUDFunctionDB();
/**
*
*/
~CUDFunctionDB();
/**
*
*/
void cleanup();
/**
* Loads an object with data coming from a CReadConfig object.
* (CReadConfig object reads an input stream)
* @param pconfigbuffer reference to a CReadConfig object.
* @return mFail
*/
C_INT32 load(CReadConfig & configbuffer);
/**
* Saves the contents of the object to a CWriteConfig object.
* (Which usually has a file attached but may also have socket)
* @param pconfigbuffer reference to a CWriteConfig object.
* @return mFail
*/
C_INT32 save(CWriteConfig & configbuffer);
/**
* Add the function to the database
* @param CUDFunction &function
* @return C_INT32 Fail
*/
void add(CUDFunction & function);
/**
* Get the number of user defined functions
*/
C_INT16 getItems() const;
/**
* Set the number of user defined funcstion
*/
void setItems(const C_INT16 items);
/**
* Get the "User-defined functions" string
*/
string getNameStr() const;
};
#endif | Define a vector to hold user defined functions | Define a vector to hold user defined functions
| C | artistic-2.0 | jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,copasi/COPASI,copasi/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,copasi/COPASI,jonasfoe/COPASI,copasi/COPASI,copasi/COPASI,copasi/COPASI,copasi/COPASI,copasi/COPASI,copasi/COPASI |
|
57041b6f3337f733eff945ca0c43434eb20c8410 | test/FrontendC/2010-03-5-LexicalScope.c | test/FrontendC/2010-03-5-LexicalScope.c | // RUN: %llvmgcc -S -O0 -g %s -o - | grep DW_TAG_lexical_block | count 3
int foo(int i) {
if (i) {
int j = 2;
}
else {
int j = 3;
}
return i;
}
| // RUN: %llvmgcc -S -O0 -g %s -o - | grep DW_TAG_lexical_block | count 2
int foo(int i) {
if (i) {
int j = 2;
}
else {
int j = 3;
}
return i;
}
| Adjust test case for lexical block pruning. Follow-on to r104842 and Radar 7424645. | Adjust test case for lexical block pruning. Follow-on to r104842 and Radar 7424645.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@104876 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm |
ca9976d6fea556430cdb1dd92dc69f0fc257ea96 | test/CFrontend/2007-09-26-Alignment.c | test/CFrontend/2007-09-26-Alignment.c | // RUN: %llvmgcc -S %s -o - | grep {align 16}
extern p(int *);
int q(void) {
int x __attribute__ ((aligned (16)));
p(&x);
return x;
}
| Test that local variables are aligned as the user requested. | Test that local variables are aligned as the user requested.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@42338 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm |
|
f779b0dc0bb152e1d1e9d4cab5de36c1ab1bf13e | libyaul/scu/bus/b/vdp1/vdp1/map.h | libyaul/scu/bus/b/vdp1/vdp1/map.h | /*
* Copyright (c) 2012-2014 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <[email protected]>
*/
#ifndef _VDP1_MAP_H_
#define _VDP1_MAP_H_
#include <scu-internal.h>
/* Macros specific for processor */
#define VDP1(x) (0x25D00000 + (x))
/* Helpers specific to this processor */
#define TVMR 0x0000
#define FBCR 0x0002
#define PTMR 0x0004
#define EWDR 0x0006
#define EWLR 0x0008
#define EWRR 0x000A
#define ENDR 0x000C
#define EDSR 0x000E
#define LOPR 0x0010
#define COPR 0x0012
#define MODR 0x0014
#endif /* !_VDP1_MAP_H_ */
| /*
* Copyright (c) 2012-2014 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <[email protected]>
*/
#ifndef _VDP1_MAP_H_
#define _VDP1_MAP_H_
#include <scu-internal.h>
/* Macros specific for processor */
#define VDP1(x) (0x25D00000 + (x))
/* Helpers specific to this processor */
#define TVMR 0x0000
#define FBCR 0x0002
#define PTMR 0x0004
#define EWDR 0x0006
#define EWLR 0x0008
#define EWRR 0x000A
#define ENDR 0x000C
#define EDSR 0x0010
#define LOPR 0x0012
#define COPR 0x0014
#define MODR 0x0016
#endif /* !_VDP1_MAP_H_ */
| Fix offsets to VDP1 registers | Fix offsets to VDP1 registers
| C | mit | ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul |
6da70aa62048e85e652464e7a7dfe3d705c505e3 | backend.native/tests/interop/kt43502/main.c | backend.native/tests/interop/kt43502/main.c | #include "libinterop_kt43502_api.h"
int main() {
libinterop_kt43502_symbols()->kotlin.root.printExternPtr();
} | #include "testlib_api.h"
int main() {
testlib_symbols()->kotlin.root.printExternPtr();
} | Fix KT-43502 testcase on windows | Fix KT-43502 testcase on windows
| C | apache-2.0 | JetBrains/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native,JetBrains/kotlin-native |
9497abecbfcb29dc2c7daa90c98c7d4d23fedc29 | tests/auto/common/declarativewebutils.h | tests/auto/common/declarativewebutils.h | /****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <[email protected]>
**
****************************************************************************/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef DECLARATIVEWEBUTILS_H
#define DECLARATIVEWEBUTILS_H
#include <QObject>
#include <QString>
#include <QColor>
#include <qqml.h>
class DeclarativeWebUtils : public QObject
{
Q_OBJECT
Q_PROPERTY(QString homePage READ homePage NOTIFY homePageChanged FINAL)
Q_PROPERTY(bool firstUseDone READ firstUseDone NOTIFY firstUseDoneChanged FINAL)
public:
explicit DeclarativeWebUtils(QObject *parent = 0);
Q_INVOKABLE int getLightness(QColor color) const;
Q_INVOKABLE QString displayableUrl(QString fullUrl) const;
static DeclarativeWebUtils *instance();
QString homePage() const;
bool firstUseDone() const;
void setFirstUseDone(bool firstUseDone);
signals:
void homePageChanged();
void firstUseDoneChanged();
private:
QString m_homePage;
bool m_firstUseDone;
};
QML_DECLARE_TYPE(DeclarativeWebUtils)
#endif
| /****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <[email protected]>
**
****************************************************************************/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef DECLARATIVEWEBUTILS_H
#define DECLARATIVEWEBUTILS_H
#include <QObject>
#include <QString>
#include <QColor>
#include <qqml.h>
class DeclarativeWebUtils : public QObject
{
Q_OBJECT
Q_PROPERTY(QString homePage READ homePage NOTIFY homePageChanged FINAL)
Q_PROPERTY(bool firstUseDone READ firstUseDone NOTIFY firstUseDoneChanged FINAL)
public:
explicit DeclarativeWebUtils(QObject *parent = 0);
Q_INVOKABLE int getLightness(QColor color) const;
Q_INVOKABLE QString displayableUrl(QString fullUrl) const;
static DeclarativeWebUtils *instance();
QString homePage() const;
bool firstUseDone() const;
void setFirstUseDone(bool firstUseDone);
signals:
void homePageChanged();
void firstUseDoneChanged();
void beforeShutdown();
private:
QString m_homePage;
bool m_firstUseDone;
};
QML_DECLARE_TYPE(DeclarativeWebUtils)
#endif
| Add beforeShutdown signal to mock object | Add beforeShutdown signal to mock object
| C | mpl-2.0 | rojkov/sailfish-browser,alinelena/sailfish-browser,sailfishos/sailfish-browser,alinelena/sailfish-browser,sailfishos/sailfish-browser,sailfishos/sailfish-browser,sailfishos/sailfish-browser,sailfishos/sailfish-browser,alinelena/sailfish-browser,alinelena/sailfish-browser,rojkov/sailfish-browser,rojkov/sailfish-browser |
51bd503c3429ee5522bd065c71f6f5dbbfb0a876 | Classes/xkcdAppDelegate.h | Classes/xkcdAppDelegate.h | //
// xkcdAppDelegate.h
// xkcd
//
// Created by Joshua Bleecher Snyder on 8/25/09.
// Copyright Treeline Labs 2009. All rights reserved.
//
#define GENERATE_DEFAULT_PNG 0
#define AppDelegate ((xkcdAppDelegate *)[UIApplication sharedApplication].delegate)
#define kUseragent @"xkcd iPhone app ([email protected]; http://bit.ly/rZtDq). Thank you for the API!"
@class ComicListViewController;
@interface xkcdAppDelegate : NSObject<UIApplicationDelegate> {
UINavigationController *navigationController;
ComicListViewController *listViewController;
NSManagedObjectModel *managedObjectModel;
NSManagedObjectContext *managedObjectContext;
NSPersistentStoreCoordinator *persistentStoreCoordinator;
NSUserDefaults *userDefaults;
UIWindow *window;
}
- (void)save;
- (BOOL)rotate;
- (BOOL)downloadNewComics;
- (BOOL)openZoomedOut;
- (BOOL)openAfterDownload;
@property(nonatomic, strong, readonly) NSManagedObjectModel *managedObjectModel;
@property(nonatomic, strong, readonly) NSManagedObjectContext *managedObjectContext;
@property(nonatomic, strong, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@property(weak, nonatomic, readonly) NSString *applicationDocumentsDirectory;
@property(nonatomic, strong) IBOutlet UIWindow *window;
@end
| //
// xkcdAppDelegate.h
// xkcd
//
// Created by Joshua Bleecher Snyder on 8/25/09.
// Copyright Treeline Labs 2009. All rights reserved.
//
#define GENERATE_DEFAULT_PNG 0
#define AppDelegate ((xkcdAppDelegate *)[UIApplication sharedApplication].delegate)
#define kUseragent @"xkcd iPhone app ([email protected]; http://bit.ly/xkcdapp). Thank you for the API!"
@class ComicListViewController;
@interface xkcdAppDelegate : NSObject<UIApplicationDelegate> {
UINavigationController *navigationController;
ComicListViewController *listViewController;
NSManagedObjectModel *managedObjectModel;
NSManagedObjectContext *managedObjectContext;
NSPersistentStoreCoordinator *persistentStoreCoordinator;
NSUserDefaults *userDefaults;
UIWindow *window;
}
- (void)save;
- (BOOL)rotate;
- (BOOL)downloadNewComics;
- (BOOL)openZoomedOut;
- (BOOL)openAfterDownload;
@property(nonatomic, strong, readonly) NSManagedObjectModel *managedObjectModel;
@property(nonatomic, strong, readonly) NSManagedObjectContext *managedObjectContext;
@property(nonatomic, strong, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@property(weak, nonatomic, readonly) NSString *applicationDocumentsDirectory;
@property(nonatomic, strong) IBOutlet UIWindow *window;
@end
| Update the useragent a bit | Update the useragent a bit | C | mit | paulrehkugler/xkcd,paulrehkugler/xkcd,nameloCmaS/xkcd,nameloCmaS/xkcd |
1866eb90a92ad4cd9956073d778b38e943b6edbd | NSBezierPath_CoreImageExtensions.h | NSBezierPath_CoreImageExtensions.h | //
// NSBezierPath_CoreImageExtensions.h
// Bibdesk
//
// Created by Adam Maxwell on 10/26/05.
/*
This software is Copyright (c) 2005,2007
Adam Maxwell. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
- Neither the name of Adam Maxwell nor the names of any
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
@interface NSBezierPath (BDSKGradientExtensions)
- (void)fillPathVertically:(BOOL)isVertical withStartColor:(CIColor *)startColor endColor:(CIColor *)endColor;
- (void)fillPathVerticallyWithStartColor:(CIColor *)inStartColor endColor:(CIColor *)inEndColor;
- (void)fillPathWithHorizontalGradientFromColor:(CIColor *)fgStartColor toColor:(CIColor *)fgEndColor blendedAtTop:(BOOL)top ofVerticalGradientFromColor:(CIColor *)bgStartColor toColor:(CIColor *)bgEndColor;
- (void)fillPathWithVerticalGradientFromColor:(CIColor *)inFgStartColor toColor:(CIColor *)inFgEndColor blendedAtRight:(BOOL)right ofHorizontalGradientFromColor:(CIColor *)inBgStartColor toColor:(CIColor *)inBgEndColor;
- (void)fillPathWithColor:(CIColor *)inFgColor blendedAtRight:(BOOL)right ofVerticalGradientFromColor:(CIColor *)inBgStartColor toColor:(CIColor *)inBgEndColor;
@end
| Copy bezier path category from bibdesk to skim | Copy bezier path category from bibdesk to skim
| C | bsd-3-clause | JackieXie168/skim,JackieXie168/skim,JackieXie168/skim,JackieXie168/skim,JackieXie168/skim |
|
6b6a6f81adf148e75ad847b4bae40f54aa2e46cb | src/exercise120.c | src/exercise120.c | /* Exercise 1-20: Write a program "detab" that replaces tabs in the input with
* the proper number of blanks to space to the next tab stop. Assume a fixed
* set of tab stops, say every "n" columns. Should "n" be a variable or a
* symbolic parameter? */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int32_t character = 0;
uint32_t line_length = 0;
uint32_t tab_width = 8;
while ((character = getchar()) != EOF) {
if (character == '\t') {
uint32_t spaces_to_add = tab_width - (line_length % tab_width);
printf("%*c", spaces_to_add, ' ');
line_length += spaces_to_add;
} else {
putchar(character);
line_length = (character != '\n') ? ++line_length : 0;
}
}
return EXIT_SUCCESS;
}
| Add solution to Exercise 1-20. | Add solution to Exercise 1-20.
| C | unlicense | damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions |
|
ef62a17b0e154377a38d58e0913b8b5d6471e36b | src/expanduino/expanduino.h | src/expanduino/expanduino.h | #pragma once
#include "expanduino-subdevice.h"
#include "classes/meta.h"
#define EXPANDUINO_MAX_RESPONSE_SIZE 128
class ExpanduinoInterruption {
public:
ExpanduinoSubdevice* source;
ExpanduinoInterruption* next;
};
class Expanduino {
MetaExpanduinoSubdevice metaSubdevice;
const char* vendorName;
const char* productName;
const char* serialNumber;
const char* shortName;
ExpanduinoInterruption* nextInterruption;
friend class ExpanduinoSubdevice;
friend class MetaExpanduinoSubdevice;
public:
Expanduino();
uint8_t getNumSubdevices();
ExpanduinoSubdevice* getDevice(uint8_t devNumber);
void dispatch(uint8_t cmd, Stream& request, Print& response);
void getVendorName(Print& out);
void getProductName(Print& out);
void getSerialNumber(Print& out);
void getShortName(Print& out);
void beginSubdevices();
void endSubdevices();
void reset();
virtual bool readInterruptionData(Print& response);
virtual bool requestInterruption(ExpanduinoSubdevice* dev);
};
| #pragma once
#include "expanduino-subdevice.h"
#include "classes/meta.h"
#define EXPANDUINO_MAX_RESPONSE_SIZE 128
class ExpanduinoInterruption {
public:
ExpanduinoSubdevice* source;
ExpanduinoInterruption* next;
};
class Expanduino {
protected:
MetaExpanduinoSubdevice metaSubdevice;
ExpanduinoInterruption* nextInterruption;
friend class ExpanduinoSubdevice;
friend class MetaExpanduinoSubdevice;
public:
Expanduino();
uint8_t getNumSubdevices();
ExpanduinoSubdevice* getDevice(uint8_t devNumber);
void dispatch(uint8_t cmd, Stream& request, Print& response);
void getVendorName(Print& out);
void getProductName(Print& out);
void getSerialNumber(Print& out);
void getShortName(Print& out);
void beginSubdevices();
void endSubdevices();
void reset();
virtual bool readInterruptionData(Print& response);
virtual bool requestInterruption(ExpanduinoSubdevice* dev);
const char* vendorName;
const char* productName;
const char* serialNumber;
const char* shortName;
};
| Make public some attributes of Expanduino | Make public some attributes of Expanduino
| C | unlicense | Expanduino/Expanduino-Arduino,Expanduino/Expanduino-Arduino |
b9ace4e896cf2c070053a179a5e092dcb79e7d9c | MAGDebugKit/Classes/Logging/MAGLogging.h | MAGDebugKit/Classes/Logging/MAGLogging.h | #import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h>
extern DDLogLevel magDebugKitLogLevel;
extern BOOL magDebugKitAsyncLogs;
#define LOG_ASYNC_ENABLED magDebugKitAsyncLogs
#define LOG_LEVEL_DEF magDebugKitLogLevel
@interface MAGLogging : NSObject
+ (instancetype)sharedInstance;
@property (nonatomic) DDLogLevel logLevel;
@property (nonatomic) BOOL fileLoggingEnabled;
@property (nonatomic) BOOL ttyLoggingEnabled;
@property (nonatomic) BOOL aslLoggingEnabled;
// Send logs via TCP socket.
@property (nonatomic) NSNumber *remoteLoggingEnabled;
@property (nonatomic, copy) NSString *remoteLoggingHost;
@property (nonatomic) NSNumber *remoteLoggingPort;
@property (nonatomic, copy) NSDictionary *remoteLoggingDictionary;
@end
| #import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h>
extern DDLogLevel magDebugKitLogLevel;
extern BOOL magDebugKitAsyncLogs;
#ifdef LOG_ASYNC_ENABLED
#undef LOG_ASYNC_ENABLED
#endif
#define LOG_ASYNC_ENABLED magDebugKitAsyncLogs
#ifdef LOG_LEVEL_DEF
#undef LOG_LEVEL_DEF
#endif
#define LOG_LEVEL_DEF magDebugKitLogLevel
@interface MAGLogging : NSObject
+ (instancetype)sharedInstance;
@property (nonatomic) DDLogLevel logLevel;
@property (nonatomic) BOOL fileLoggingEnabled;
@property (nonatomic) BOOL ttyLoggingEnabled;
@property (nonatomic) BOOL aslLoggingEnabled;
// Send logs via TCP socket.
@property (nonatomic) NSNumber *remoteLoggingEnabled;
@property (nonatomic, copy) NSString *remoteLoggingHost;
@property (nonatomic) NSNumber *remoteLoggingPort;
@property (nonatomic, copy) NSDictionary *remoteLoggingDictionary;
@end
| Fix some warnings (redefined macro definitions) | Fix some warnings (redefined macro definitions)
| C | apache-2.0 | Magora-IOS/MAGDebugKit,Magora-IOS/MAGDebugKit |
b0a039d70ab17fb7b68afc498ae635825c8300cd | Source/LuminoCore/Include/LuminoMath.h | Source/LuminoCore/Include/LuminoMath.h |
#ifndef LUMINO_MATH_H
#define LUMINO_MATH_H
#include "Lumino/Math/MathUtils.h"
#include "Lumino/Math/Vector2.h"
#include "Lumino/Math/Vector3.h"
#include "Lumino/Math/Vector4.h"
#include "Lumino/Math/Matrix.h"
#include "Lumino/Math/Quaternion.h"
#include "Lumino/Math/AttitudeTransform.h"
#include "Lumino/Math/Geometries.h"
#include "Lumino/Math/Plane.h"
#include "Lumino/Math/ViewFrustum.h"
#include "Lumino/Math/Random.h"
#endif // LUMINO_MATH_H
|
#ifndef LUMINO_MATH_H
#define LUMINO_MATH_H
#pragma push_macro("min")
#pragma push_macro("max")
#undef min
#undef max
#include "Lumino/Math/MathUtils.h"
#include "Lumino/Math/Vector2.h"
#include "Lumino/Math/Vector3.h"
#include "Lumino/Math/Vector4.h"
#include "Lumino/Math/Matrix.h"
#include "Lumino/Math/Quaternion.h"
#include "Lumino/Math/AttitudeTransform.h"
#include "Lumino/Math/Geometries.h"
#include "Lumino/Math/Plane.h"
#include "Lumino/Math/ViewFrustum.h"
#include "Lumino/Math/Random.h"
#pragma pop_macro("min")
#pragma pop_macro("max")
#endif // LUMINO_MATH_H
| Improve windows min max macro for MFC | Improve windows min max macro for MFC
| C | mit | lriki/Lumino,lriki/Lumino,lriki/Lumino,lriki/Lumino,lriki/Lumino,lriki/Lumino,lriki/Lumino |
d19925f48fcbad32755c4cf0dca845a6487fe3c8 | test/FrontendC/2007-02-16-WritableStrings.c | test/FrontendC/2007-02-16-WritableStrings.c | // Test the -fwritable-strings option.
// RUN: %llvmgcc -O3 -S -o - -emit-llvm -fwritable-strings %s | \
// RUN: grep {private global}
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {private constant}
char *X = "foo";
| // Test the -fwritable-strings option.
// RUN: %llvmgcc -O3 -S -o - -emit-llvm -fwritable-strings %s | \
// RUN: grep {internal global}
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {private constant}
char *X = "foo";
| Update test to match 95961. | Update test to match 95961.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@95971 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap |
1255e1b35e2133bc286dc205c6f1718914f50b81 | test/Index/annotate-comments-unterminated.c | test/Index/annotate-comments-unterminated.c | // RUN: c-index-test -test-load-source all %s | FileCheck %s
// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=ERR %s
// CHECK: annotate-comments-unterminated.c:9:5: VarDecl=x:{{.*}} RawComment=[/** Aaa. */]{{.*}} BriefComment=[ Aaa. \n]
// CHECK: annotate-comments-unterminated.c:11:5: VarDecl=y:{{.*}} RawComment=[/**< Bbb. */]{{.*}} BriefComment=[ Bbb. \n]
// CHECK-ERR: error: unterminated
/** Aaa. */
int x;
int y; /**< Bbb. */
/**< Ccc.
* Ddd.
| Add a test for unterminated /* comments. | Add a test for unterminated /* comments.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@159267 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
|
1f2f31493e8bc97cdb9a9ff36c788503aec5718d | test/FrontendC/2009-03-09-WeakDeclarations-1.c | test/FrontendC/2009-03-09-WeakDeclarations-1.c | // RUN: $llvmgcc $test -c -o /dev/null |& \
// RUN: egrep {(14|15|22): warning:} | \
// RUN: wc -l | grep --quiet 3
// TARGET: *-*-darwin
// XFAIL: alpha|ia64|sparc
// END.
// Insist upon warnings for inappropriate weak attributes.
// Note the line numbers (14|15|22) embedded in the check.
// O.K.
extern int ext_weak_import __attribute__ ((__weak_import__));
// These are inappropriate, and should generate warnings:
int decl_weak_import __attribute__ ((__weak_import__));
int decl_initialized_weak_import __attribute__ ((__weak_import__)) = 13;
// O.K.
extern int ext_f(void) __attribute__ ((__weak_import__));
// These are inappropriate, and should generate warnings:
int def_f(void) __attribute__ ((__weak_import__));
int __attribute__ ((__weak_import__)) decl_f(void) {return 0;};
| Check for warnings about inappropriate weak_imports. Darwin-specific; marked XFAIL for others. | Check for warnings about inappropriate weak_imports.
Darwin-specific; marked XFAIL for others.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@66514 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap |
|
a5070fe2e9a42563db382217c27c6e4d75a26458 | tests/regression/06-symbeq/33-symb_accfun.c | tests/regression/06-symbeq/33-symb_accfun.c | // PARAM: --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
#include <stdlib.h>
#include <pthread.h>
typedef struct { int myint; pthread_mutex_t mymutex; } mystruct;
void acc(mystruct *s) { s->myint=s->myint+1; } // NORACE
void *foo(void *arg) {
mystruct *s = (mystruct *) arg;
pthread_mutex_lock(&s->mymutex);
acc(s);
pthread_mutex_unlock(&s->mymutex);
return NULL;
}
int main() {
mystruct *s = (mystruct *) malloc(sizeof(*s));
pthread_mutex_init(&s->mymutex, NULL);
pthread_t id1, id2;
pthread_create(&id1, NULL, foo, s);
pthread_create(&id2, NULL, foo, s);
pthread_join(id1, NULL);
pthread_join(id2, NULL);
}
| Add symb_locks test for access in function | Add symb_locks test for access in function
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
d0fbd28a7230f6500a19f5cf6216f18eef07d1d9 | src/scenarios/base.h | src/scenarios/base.h | #pragma once
#include <vector>
#include <memory>
#include <boost/noncopyable.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/iterator/transform_iterator.hpp>
#include "../factory.h"
#include "../visualisation.h"
#include "../agents.h"
namespace scenarios {
class base : public boost::noncopyable {
public:
virtual ~base() {};
virtual agents apply(const agents& source) const = 0;
};
template<typename DERIVED>
class scenario : public base {
public:
scenario(const boost::property_tree::ptree& config);
virtual ~scenario() override;
protected:
private:
static factory<base, boost::property_tree::ptree>::registration<DERIVED> s_factory;
};
//////////////////////////////////
template<typename DERIVED>
factory<base, boost::property_tree::ptree>::registration<DERIVED> scenario<DERIVED>::s_factory;
template<typename DERIVED>
scenario<DERIVED>::scenario(const boost::property_tree::ptree& config) {
}
template<typename DERIVED>
scenario<DERIVED>::~scenario() {
// a dummy statement to make sure the factory doesn't get optimized away by GCC
boost::lexical_cast<std::string>(&s_factory);
}
}
| #pragma once
#include <vector>
#include <memory>
#include <boost/noncopyable.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/iterator/transform_iterator.hpp>
#include "../factory.h"
#include "../visualisation.h"
#include "../agents.h"
namespace scenarios {
class base : public boost::noncopyable {
public:
base(const boost::property_tree::ptree& config) {}
virtual ~base() {};
virtual agents apply(const agents& source) const = 0;
};
template<typename DERIVED, typename BASE = base>
class scenario : public BASE {
public:
scenario(const boost::property_tree::ptree& config);
virtual ~scenario() override;
protected:
private:
static factory<base, boost::property_tree::ptree>::registration<DERIVED> s_factory;
};
//////////////////////////////////
template<typename DERIVED, typename BASE>
factory<base, boost::property_tree::ptree>::registration<DERIVED> scenario<DERIVED, BASE>::s_factory;
template<typename DERIVED, typename BASE>
scenario<DERIVED, BASE>::scenario(const boost::property_tree::ptree& config) : BASE(config) {
}
template<typename DERIVED, typename BASE>
scenario<DERIVED, BASE>::~scenario() {
// a dummy statement to make sure the factory doesn't get optimized away by GCC
boost::lexical_cast<std::string>(&s_factory);
}
}
| Allow scenarios inheritance for scenarios::scenario template | Allow scenarios inheritance for scenarios::scenario template
| C | mit | martin-pr/group_motion_editing,martin-pr/group_motion_editing |
3a50d847e098f36e3bf8bc14eea07a6cc35f7803 | test/FixIt/fixit-errors-1.c | test/FixIt/fixit-errors-1.c | // RUN: cp %s %t
// RUN: %clang_cc1 -pedantic -fixit %t
// RUN: echo %clang_cc1 -pedantic -Werror -x c %t
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
warnings will be fixed by -fixit, and the resulting file should
compile cleanly with -Werror -pedantic. */
// FIXME: If you put a space at the end of the line, it doesn't work yet!
char *s = "hi\
there";
// The following line isn't terminated, don't fix it.
int i; // expected-error{{no newline at end of file}}
| // RUN: cp %s %t
// RUN: %clang_cc1 -pedantic -fixit %t
// RUN: %clang_cc1 -pedantic -Werror -x c %t
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
warnings will be fixed by -fixit, and the resulting file should
compile cleanly with -Werror -pedantic. */
// FIXME: If you put a space at the end of the line, it doesn't work yet!
char *s = "hi\
there";
// The following line isn't terminated, don't fix it.
int i; // expected-error{{no newline at end of file}}
| Fix test to actually check the FixIt-applied code | Fix test to actually check the FixIt-applied code
r102230 added an 'echo' making this a no-op.
Also fixes FAIL on native Windows with no shell/GnuWin32.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@193938 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/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,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
bdb6a9aeec6ae5f94d7a9abe17fc78f6eefa0dc0 | gst/glib-compat-private.h | gst/glib-compat-private.h | /*
* glib-compat.c
* Functions copied from glib 2.10
*
* Copyright 2005 David Schleef <[email protected]>
*/
#ifndef __GLIB_COMPAT_PRIVATE_H__
#define __GLIB_COMPAT_PRIVATE_H__
#include <glib.h>
G_BEGIN_DECLS
#if !GLIB_CHECK_VERSION(2,25,0)
typedef struct stat GStatBuf;
#endif
#if GLIB_CHECK_VERSION(2,26,0)
#define GLIB_HAS_GDATETIME
#endif
/* copies */
/* adaptations */
G_END_DECLS
#endif
| /*
* glib-compat.c
* Functions copied from glib 2.10
*
* Copyright 2005 David Schleef <[email protected]>
*/
#ifndef __GLIB_COMPAT_PRIVATE_H__
#define __GLIB_COMPAT_PRIVATE_H__
#include <glib.h>
G_BEGIN_DECLS
#if !GLIB_CHECK_VERSION(2,25,0)
#if defined (_MSC_VER) && !defined(_WIN64)
typedef struct _stat32 GStatBuf;
#else
typedef struct stat GStatBuf;
#endif
#endif
#if GLIB_CHECK_VERSION(2,26,0)
#define GLIB_HAS_GDATETIME
#endif
/* copies */
/* adaptations */
G_END_DECLS
#endif
| Fix GStatBuf definition for win32 when building against older glib. Now matches upstream glib definition. | Fix GStatBuf definition for win32 when building against older glib.
Now matches upstream glib definition.
| C | lgpl-2.1 | Distrotech/gstreamer,ensonic/gstreamer,magcius/gstreamer,shelsonjava/gstreamer,jpakkane/gstreamer,mparis/gstreamer,ahmedammar/platform_external_gst_gstreamer,justinjoy/gstreamer,cablelabs/gstreamer,Lachann/gstreamer,justinjoy/gstreamer,ylatuya/gstreamer,magcius/gstreamer,magcius/gstreamer,Distrotech/gstreamer,StreamUtils/gstreamer,collects/gstreamer,krieger-od/gstreamer,mparis/gstreamer,ensonic/gstreamer,jpxiong/gstreamer,ylatuya/gstreamer,cfoch/gstreamer,surround-io/gstreamer,ensonic/gstreamer,surround-io/gstreamer,lubosz/gstreamer,mrchapp/gstreamer,lubosz/gstreamer,Lachann/gstreamer,jpxiong/gstreamer,justinjoy/gstreamer,drothlis/gstreamer,StreamUtils/gstreamer,centricular/gstreamer,krichter722/gstreamer,lovebug356/gstreamer,drothlis/gstreamer,collects/gstreamer,cfoch/gstreamer,Distrotech/gstreamer,ensonic/gstreamer,surround-io/gstreamer,lubosz/gstreamer,shelsonjava/gstreamer,lovebug356/gstreamer,mparis/gstreamer,centricular/gstreamer,justinjoy/gstreamer,ahmedammar/platform_external_gst_gstreamer,krieger-od/gstreamer,cablelabs/gstreamer,StreamUtils/gstreamer,ylatuya/gstreamer,cfoch/gstreamer,centricular/gstreamer,StreamUtils/gstreamer,centricular/gstreamer,jpakkane/gstreamer,lovebug356/gstreamer,cablelabs/gstreamer,mrchapp/gstreamer,ahmedammar/platform_external_gst_gstreamer,krichter722/gstreamer,ylatuya/gstreamer,drothlis/gstreamer,cfoch/gstreamer,krieger-od/gstreamer,mparis/gstreamer,surround-io/gstreamer,drothlis/gstreamer,ylatuya/gstreamer,surround-io/gstreamer,lovebug356/gstreamer,Lachann/gstreamer,shelsonjava/gstreamer,jpxiong/gstreamer,ahmedammar/platform_external_gst_gstreamer,collects/gstreamer,mrchapp/gstreamer,StreamUtils/gstreamer,krieger-od/gstreamer,mparis/gstreamer,Lachann/gstreamer,lovebug356/gstreamer,cfoch/gstreamer,mrchapp/gstreamer,collects/gstreamer,cablelabs/gstreamer,jpxiong/gstreamer,lubosz/gstreamer,magcius/gstreamer,krieger-od/gstreamer,lubosz/gstreamer,Lachann/gstreamer,shelsonjava/gstreamer,collects/gstreamer,drothlis/gstreamer,krichter722/gstreamer,ahmedammar/platform_external_gst_gstreamer,ensonic/gstreamer,krichter722/gstreamer,mrchapp/gstreamer,krichter722/gstreamer,jpxiong/gstreamer,Distrotech/gstreamer,magcius/gstreamer,shelsonjava/gstreamer,jpakkane/gstreamer,jpakkane/gstreamer,cablelabs/gstreamer,jpakkane/gstreamer,Distrotech/gstreamer,centricular/gstreamer,justinjoy/gstreamer |
ffc1ab98c729f425243bc5e3cab8110f2c5abc32 | tests/ctests/error_large_literal.c | tests/ctests/error_large_literal.c | int main() {
// Issue: 3: error: integer literal too large to be represented by any integer type
1000000000000000000000000000;
}
| Add test for large integers | Add test for large integers
| C | mit | ShivamSarodia/ShivyC,ShivamSarodia/ShivyC,ShivamSarodia/ShivyC |
|
d85f6007cddb22af28640298a9c73a3a6bb4d514 | include/ofp/actionid.h | include/ofp/actionid.h | // Copyright 2014-present Bill Fisher. All rights reserved.
#ifndef OFP_ACTIONID_H_
#define OFP_ACTIONID_H_
#include "ofp/constants.h"
#include "ofp/actiontype.h"
namespace ofp {
class ActionID {
public:
public:
enum {
ProtocolIteratorSizeOffset = sizeof(OFPActionType),
ProtocolIteratorAlignment = 4
};
explicit ActionID(OFPActionType type = OFPAT_OUTPUT, UInt32 experimenter = 0)
: type_(type, type == OFPAT_EXPERIMENTER ? 8U : 4U),
experimenter_{experimenter} {}
explicit ActionID(ActionType type, UInt32 experimenter = 0)
: ActionID{type.enumType(), experimenter} {}
ActionType type() const { return type_.zeroLength(); }
UInt32 experimenter() const { return experimenter_; }
private:
ActionType type_;
Big32 experimenter_;
size_t length() const { return type_.length(); }
friend class ActionIDList;
};
} // namespace ofp
#endif // OFP_ACTIONID_H_
| // Copyright 2014-present Bill Fisher. All rights reserved.
#ifndef OFP_ACTIONID_H_
#define OFP_ACTIONID_H_
#include "ofp/constants.h"
#include "ofp/actiontype.h"
namespace ofp {
class ActionID {
public:
enum {
ProtocolIteratorSizeOffset = sizeof(OFPActionType),
ProtocolIteratorAlignment = 4
};
explicit ActionID(OFPActionType type = OFPAT_OUTPUT, UInt32 experimenter = 0)
: type_(type, type == OFPAT_EXPERIMENTER ? 8U : 4U),
experimenter_{experimenter} {}
explicit ActionID(ActionType type, UInt32 experimenter = 0)
: ActionID{type.enumType(), experimenter} {}
ActionType type() const { return type_.zeroLength(); }
UInt32 experimenter() const { return experimenter_; }
private:
ActionType type_;
Big32 experimenter_;
size_t length() const { return type_.length(); }
friend class ActionIDList;
};
} // namespace ofp
#endif // OFP_ACTIONID_H_
| Remove extra public access modifier. | Remove extra public access modifier.
| C | mit | byllyfish/libofp,byllyfish/libofp,byllyfish/oftr,byllyfish/oftr,byllyfish/libofp,byllyfish/oftr,byllyfish/oftr,byllyfish/oftr |
95d84862445bd79fe523ffd1091d1bd55b7024af | UIforETW/Version.h | UIforETW/Version.h | #pragma once
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
const float kCurrentVersion = 1.44f;
// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// increment that won't trigger the new-version checks, handy for minor
// releases that I don't want to bother users about.
//#define VERSION_SUFFIX 'b'
| #pragma once
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
const float kCurrentVersion = 1.45f;
// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// increment that won't trigger the new-version checks, handy for minor
// releases that I don't want to bother users about.
//#define VERSION_SUFFIX 'b'
| Increase version to 1.44 in preparation for new release | Increase version to 1.44 in preparation for new release
| C | apache-2.0 | ariccio/UIforETW,ariccio/UIforETW,MikeMarcin/UIforETW,MikeMarcin/UIforETW,google/UIforETW,mwinterb/UIforETW,google/UIforETW,ariccio/UIforETW,mwinterb/UIforETW,google/UIforETW,google/UIforETW,mwinterb/UIforETW,ariccio/UIforETW,MikeMarcin/UIforETW |
af0b5cf70b1f96c329ef66c654d69847d8029c02 | platform/stm32/templates/f3/stm32f3-discovery/board.conf.h | platform/stm32/templates/f3/stm32f3-discovery/board.conf.h | #include <stm32f3discovery.conf.h>
CONFIG {
uarts[1].status = ENABLED;
}
| #include <stm32f3discovery.conf.h>
CONFIG {
uarts[1].status = ENABLED;
leds[0].status = ENABLED;
leds[1].status = ENABLED;
leds[2].status = ENABLED;
leds[3].status = ENABLED;
leds[4].status = ENABLED;
leds[5].status = ENABLED;
leds[6].status = ENABLED;
leds[7].status = ENABLED;
}
| Add LEDs enable to platform/stm32/f3/stm32f3-discovery/ | templates: Add LEDs enable to platform/stm32/f3/stm32f3-discovery/
| C | bsd-2-clause | embox/embox,embox/embox,embox/embox,embox/embox,embox/embox,embox/embox |
dfa3930196159638c475d37a89a7e0e5b395d92a | include/mgmt/mcumgr/zephyr_groups.h | include/mgmt/mcumgr/zephyr_groups.h | /*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_
#define ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_
#include <kernel.h>
#ifdef __cplusplus
extern "C" {
#endif
/* The file contains definitions of Zephyr specific mgmt commands */
#define ZEPHYR_MGMT_GRP_BASE MGMT_GROUP_ID_PERUSER
/* Basic group */
#define ZEPHYR_MGMT_GRP_BASIC ZEPHYR_MGMT_GRP_BASE
#define ZEPHYR_MGMT_GRP_BASIC_CMD_ERASE_STORAGE 0 /* Command to erase storage partition */
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ */
| /*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_
#define ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_
#include <kernel.h>
#ifdef __cplusplus
extern "C" {
#endif
/* The file contains definitions of Zephyr specific mgmt commands. The group numbers decrease
* from PERUSER to avoid collision with user defined groups.
*/
#define ZEPHYR_MGMT_GRP_BASE (MGMT_GROUP_ID_PERUSER - 1)
/* Basic group */
#define ZEPHYR_MGMT_GRP_BASIC ZEPHYR_MGMT_GRP_BASE
#define ZEPHYR_MGMT_GRP_BASIC_CMD_ERASE_STORAGE 0 /* Command to erase storage partition */
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ */
| Fix collision with user defined groups | subsys/mgmt/mcumgr: Fix collision with user defined groups
The commit moves definition of Zephyr specific mcumgr basic group to
PERUSER - 1. This has been done to avoid collision with application
specific groups, defined by users.
Signed-off-by: Dominik Ermel <[email protected]>
| C | apache-2.0 | galak/zephyr,finikorg/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,finikorg/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,galak/zephyr,galak/zephyr,galak/zephyr |
802af5afb6b869036b2bd46b8e0704f1ea2b1e47 | ExternData/Resources/Include/ED_XMLFile.h | ExternData/Resources/Include/ED_XMLFile.h | #if !defined(ED_XMLFILE_H)
#define ED_XMLFILE_H
void* ED_createXML(const char* fileName);
void ED_destroyXML(void* _xml);
double ED_getDoubleFromXML(void* _xml, const char* varName);
const char* ED_getStringFromXML(void* _xml, const char* varName);
int ED_getIntFromXML(void* _xml, const char* varName);
void ED_getDoubleArray1DFromXML(void* _xml, const char* varName, double* a, size_t n);
void ED_getDoubleArray2DFromXML(void* _xml, const char* varName, double* a, size_t m, size_t n);
#endif
| #if !defined(ED_XMLFILE_H)
#define ED_XMLFILE_H
#include <stdlib.h>
void* ED_createXML(const char* fileName);
void ED_destroyXML(void* _xml);
double ED_getDoubleFromXML(void* _xml, const char* varName);
const char* ED_getStringFromXML(void* _xml, const char* varName);
int ED_getIntFromXML(void* _xml, const char* varName);
void ED_getDoubleArray1DFromXML(void* _xml, const char* varName, double* a, size_t n);
void ED_getDoubleArray2DFromXML(void* _xml, const char* varName, double* a, size_t m, size_t n);
#endif
| Fix missing include (for size_t) | Fix missing include (for size_t)
| C | bsd-2-clause | modelica-3rdparty/ExternData,modelica-3rdparty/ExternData,modelica-3rdparty/ExternData,modelica-3rdparty/ExternData |
c85f8eafe16e04213d16b2ff55e7bbe7ed911d98 | nofork.c | nofork.c | /*
* preventfork.c
* Copyright (C) 2010 Adrian Perez <[email protected]>
*
* Distributed under terms of the MIT license.
*/
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
pid_t
fork (void)
{
return 0;
}
int
daemon (int nochdir, int noclose)
{
if (!nochdir == 0) {
if (chdir ("/"))
return -1;
}
if (!noclose) {
close (0);
if (open ("/dev/null", O_RDONLY, 0) != 0)
return -1;
close (1);
if (open ("/dev/null", O_WRONLY, 0) != 1)
return -1;
close (2);
if (dup (1) != 2)
return -1;
}
return 0;
}
| /*
* nofork.c
* Copyright (C) 2010 Adrian Perez <[email protected]>
*
* Distributed under terms of the MIT license.
*/
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
pid_t
fork (void)
{
return 0;
}
int
daemon (int nochdir, int noclose)
{
if (!nochdir == 0) {
if (chdir ("/"))
return -1;
}
if (!noclose) {
close (0);
if (open ("/dev/null", O_RDONLY, 0) != 0)
return -1;
close (1);
if (open ("/dev/null", O_WRONLY, 0) != 1)
return -1;
close (2);
if (dup (1) != 2)
return -1;
}
return 0;
}
| Fix file name in comment header | Fix file name in comment header
| C | mit | aperezdc/dmon |
e170f2bff908bd06dcbcc1b113e9365098c337f9 | cint/include/iosfwd.h | cint/include/iosfwd.h | #ifndef G__IOSFWD_H
#define G__IOSFWD_H
#include <iostream.h>
typedef basic_streambuf<char, char_traits<char> > streambuf;
#endif
| #ifndef G__IOSFWD_H
#define G__IOSFWD_H
#include <iostream.h>
#endif
| Undo change proposed by Philippe. Too many side effects. | Undo change proposed by Philippe. Too many side effects.
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@5468 27541ba8-7e3a-0410-8455-c3a389f83636
| C | lgpl-2.1 | sawenzel/root,veprbl/root,root-mirror/root,buuck/root,0x0all/ROOT,pspe/root,simonpf/root,perovic/root,Duraznos/root,zzxuanyuan/root,esakellari/my_root_for_test,sbinet/cxx-root,mkret2/root,smarinac/root,jrtomps/root,0x0all/ROOT,sirinath/root,ffurano/root5,mattkretz/root,satyarth934/root,mhuwiler/rootauto,agarciamontoro/root,pspe/root,thomaskeck/root,mattkretz/root,jrtomps/root,agarciamontoro/root,davidlt/root,nilqed/root,thomaskeck/root,cxx-hep/root-cern,ffurano/root5,mhuwiler/rootauto,satyarth934/root,beniz/root,CristinaCristescu/root,BerserkerTroll/root,dfunke/root,beniz/root,dfunke/root,esakellari/root,sawenzel/root,karies/root,strykejern/TTreeReader,bbockelm/root,gganis/root,evgeny-boger/root,BerserkerTroll/root,sbinet/cxx-root,dfunke/root,georgtroska/root,evgeny-boger/root,dfunke/root,agarciamontoro/root,lgiommi/root,sawenzel/root,krafczyk/root,omazapa/root-old,esakellari/root,olifre/root,alexschlueter/cern-root,simonpf/root,CristinaCristescu/root,satyarth934/root,sawenzel/root,jrtomps/root,omazapa/root-old,krafczyk/root,cxx-hep/root-cern,davidlt/root,root-mirror/root,davidlt/root,mkret2/root,veprbl/root,sbinet/cxx-root,vukasinmilosevic/root,strykejern/TTreeReader,agarciamontoro/root,abhinavmoudgil95/root,mkret2/root,zzxuanyuan/root-compressor-dummy,karies/root,buuck/root,zzxuanyuan/root,Y--/root,davidlt/root,thomaskeck/root,sbinet/cxx-root,omazapa/root,gganis/root,krafczyk/root,lgiommi/root,davidlt/root,Duraznos/root,smarinac/root,krafczyk/root,Duraznos/root,esakellari/root,zzxuanyuan/root,abhinavmoudgil95/root,gganis/root,sawenzel/root,agarciamontoro/root,ffurano/root5,beniz/root,zzxuanyuan/root-compressor-dummy,gbitzes/root,strykejern/TTreeReader,mhuwiler/rootauto,smarinac/root,beniz/root,karies/root,mkret2/root,davidlt/root,arch1tect0r/root,Y--/root,esakellari/root,0x0all/ROOT,abhinavmoudgil95/root,omazapa/root-old,cxx-hep/root-cern,smarinac/root,agarciamontoro/root,omazapa/root,pspe/root,omazapa/root,gganis/root,sawenzel/root,davidlt/root,bbockelm/root,esakellari/my_root_for_test,esakellari/root,bbockelm/root,bbockelm/root,esakellari/my_root_for_test,Dr15Jones/root,sawenzel/root,karies/root,sawenzel/root,veprbl/root,mattkretz/root,krafczyk/root,simonpf/root,veprbl/root,kirbyherm/root-r-tools,0x0all/ROOT,kirbyherm/root-r-tools,cxx-hep/root-cern,veprbl/root,georgtroska/root,thomaskeck/root,esakellari/my_root_for_test,jrtomps/root,root-mirror/root,arch1tect0r/root,nilqed/root,gganis/root,mkret2/root,vukasinmilosevic/root,esakellari/root,gbitzes/root,omazapa/root-old,buuck/root,pspe/root,BerserkerTroll/root,mattkretz/root,ffurano/root5,gbitzes/root,evgeny-boger/root,vukasinmilosevic/root,CristinaCristescu/root,tc3t/qoot,esakellari/root,perovic/root,zzxuanyuan/root-compressor-dummy,buuck/root,alexschlueter/cern-root,pspe/root,tc3t/qoot,CristinaCristescu/root,sbinet/cxx-root,bbockelm/root,olifre/root,evgeny-boger/root,sbinet/cxx-root,buuck/root,esakellari/my_root_for_test,simonpf/root,buuck/root,esakellari/my_root_for_test,beniz/root,pspe/root,ffurano/root5,buuck/root,vukasinmilosevic/root,mattkretz/root,Dr15Jones/root,bbockelm/root,sbinet/cxx-root,pspe/root,abhinavmoudgil95/root,evgeny-boger/root,karies/root,mattkretz/root,karies/root,olifre/root,beniz/root,abhinavmoudgil95/root,karies/root,arch1tect0r/root,root-mirror/root,sirinath/root,Duraznos/root,gganis/root,gbitzes/root,tc3t/qoot,kirbyherm/root-r-tools,mkret2/root,CristinaCristescu/root,CristinaCristescu/root,zzxuanyuan/root,georgtroska/root,jrtomps/root,zzxuanyuan/root-compressor-dummy,esakellari/root,abhinavmoudgil95/root,0x0all/ROOT,mattkretz/root,beniz/root,smarinac/root,mhuwiler/rootauto,agarciamontoro/root,BerserkerTroll/root,sbinet/cxx-root,BerserkerTroll/root,sirinath/root,krafczyk/root,arch1tect0r/root,georgtroska/root,agarciamontoro/root,zzxuanyuan/root,omazapa/root,tc3t/qoot,georgtroska/root,buuck/root,satyarth934/root,dfunke/root,pspe/root,mkret2/root,0x0all/ROOT,Duraznos/root,mattkretz/root,pspe/root,mkret2/root,olifre/root,perovic/root,zzxuanyuan/root-compressor-dummy,strykejern/TTreeReader,dfunke/root,gbitzes/root,omazapa/root-old,sawenzel/root,simonpf/root,karies/root,omazapa/root-old,sbinet/cxx-root,olifre/root,mhuwiler/rootauto,jrtomps/root,gganis/root,perovic/root,krafczyk/root,lgiommi/root,alexschlueter/cern-root,satyarth934/root,ffurano/root5,0x0all/ROOT,davidlt/root,olifre/root,simonpf/root,zzxuanyuan/root,beniz/root,BerserkerTroll/root,CristinaCristescu/root,smarinac/root,perovic/root,Duraznos/root,sirinath/root,lgiommi/root,kirbyherm/root-r-tools,CristinaCristescu/root,Y--/root,Duraznos/root,veprbl/root,simonpf/root,smarinac/root,root-mirror/root,olifre/root,krafczyk/root,arch1tect0r/root,BerserkerTroll/root,thomaskeck/root,pspe/root,karies/root,simonpf/root,root-mirror/root,satyarth934/root,vukasinmilosevic/root,smarinac/root,omazapa/root,abhinavmoudgil95/root,perovic/root,evgeny-boger/root,kirbyherm/root-r-tools,zzxuanyuan/root,simonpf/root,omazapa/root,krafczyk/root,Y--/root,zzxuanyuan/root,root-mirror/root,dfunke/root,alexschlueter/cern-root,arch1tect0r/root,zzxuanyuan/root-compressor-dummy,gganis/root,root-mirror/root,arch1tect0r/root,thomaskeck/root,gbitzes/root,esakellari/my_root_for_test,vukasinmilosevic/root,esakellari/my_root_for_test,alexschlueter/cern-root,thomaskeck/root,jrtomps/root,smarinac/root,dfunke/root,alexschlueter/cern-root,evgeny-boger/root,perovic/root,nilqed/root,nilqed/root,agarciamontoro/root,Y--/root,ffurano/root5,karies/root,vukasinmilosevic/root,dfunke/root,vukasinmilosevic/root,omazapa/root,0x0all/ROOT,Y--/root,root-mirror/root,tc3t/qoot,buuck/root,Y--/root,zzxuanyuan/root-compressor-dummy,omazapa/root-old,mkret2/root,cxx-hep/root-cern,esakellari/root,BerserkerTroll/root,tc3t/qoot,esakellari/my_root_for_test,Y--/root,beniz/root,nilqed/root,davidlt/root,gganis/root,simonpf/root,mattkretz/root,simonpf/root,zzxuanyuan/root-compressor-dummy,Y--/root,tc3t/qoot,arch1tect0r/root,nilqed/root,zzxuanyuan/root,bbockelm/root,satyarth934/root,davidlt/root,sbinet/cxx-root,georgtroska/root,mhuwiler/rootauto,strykejern/TTreeReader,lgiommi/root,Dr15Jones/root,omazapa/root-old,bbockelm/root,bbockelm/root,mattkretz/root,dfunke/root,agarciamontoro/root,evgeny-boger/root,BerserkerTroll/root,georgtroska/root,georgtroska/root,gbitzes/root,kirbyherm/root-r-tools,zzxuanyuan/root-compressor-dummy,evgeny-boger/root,zzxuanyuan/root-compressor-dummy,0x0all/ROOT,nilqed/root,thomaskeck/root,strykejern/TTreeReader,abhinavmoudgil95/root,zzxuanyuan/root,karies/root,nilqed/root,omazapa/root,lgiommi/root,alexschlueter/cern-root,evgeny-boger/root,mhuwiler/rootauto,pspe/root,sirinath/root,bbockelm/root,sirinath/root,omazapa/root-old,nilqed/root,beniz/root,zzxuanyuan/root,arch1tect0r/root,Duraznos/root,dfunke/root,cxx-hep/root-cern,mattkretz/root,evgeny-boger/root,abhinavmoudgil95/root,Dr15Jones/root,olifre/root,thomaskeck/root,vukasinmilosevic/root,beniz/root,Y--/root,smarinac/root,root-mirror/root,esakellari/root,veprbl/root,gbitzes/root,Y--/root,bbockelm/root,sawenzel/root,lgiommi/root,lgiommi/root,Dr15Jones/root,esakellari/my_root_for_test,CristinaCristescu/root,sirinath/root,jrtomps/root,gbitzes/root,omazapa/root,sirinath/root,gbitzes/root,BerserkerTroll/root,satyarth934/root,root-mirror/root,arch1tect0r/root,sirinath/root,gbitzes/root,omazapa/root-old,sirinath/root,lgiommi/root,veprbl/root,thomaskeck/root,mhuwiler/rootauto,olifre/root,perovic/root,gganis/root,omazapa/root-old,olifre/root,buuck/root,georgtroska/root,tc3t/qoot,mkret2/root,BerserkerTroll/root,davidlt/root,zzxuanyuan/root,satyarth934/root,agarciamontoro/root,strykejern/TTreeReader,abhinavmoudgil95/root,mhuwiler/rootauto,satyarth934/root,CristinaCristescu/root,nilqed/root,kirbyherm/root-r-tools,veprbl/root,perovic/root,tc3t/qoot,Duraznos/root,mhuwiler/rootauto,krafczyk/root,Duraznos/root,gganis/root,omazapa/root,arch1tect0r/root,Dr15Jones/root,georgtroska/root,mhuwiler/rootauto,lgiommi/root,veprbl/root,veprbl/root,Dr15Jones/root,vukasinmilosevic/root,Duraznos/root,abhinavmoudgil95/root,lgiommi/root,cxx-hep/root-cern,perovic/root,zzxuanyuan/root-compressor-dummy,omazapa/root,sawenzel/root,olifre/root,sirinath/root,perovic/root,nilqed/root,jrtomps/root,CristinaCristescu/root,buuck/root,vukasinmilosevic/root,jrtomps/root,esakellari/root,georgtroska/root,tc3t/qoot,krafczyk/root,jrtomps/root,satyarth934/root,mkret2/root,cxx-hep/root-cern,sbinet/cxx-root |
fbf9f480bc7faebf123213c2932022c7e0ba4321 | wangle/concurrent/NamedThreadFactory.h | wangle/concurrent/NamedThreadFactory.h | /*
* Copyright (c) 2017, 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.
*
*/
#pragma once
#include <atomic>
#include <string>
#include <thread>
#include <wangle/concurrent/ThreadFactory.h>
#include <folly/Conv.h>
#include <folly/Range.h>
#include <folly/ThreadName.h>
namespace wangle {
class NamedThreadFactory : public ThreadFactory {
public:
explicit NamedThreadFactory(folly::StringPiece prefix)
: prefix_(prefix.str()), suffix_(0) {}
std::thread newThread(folly::Func&& func) override {
auto thread = std::thread(std::move(func));
folly::setThreadName(
thread.native_handle(),
folly::to<std::string>(prefix_, suffix_++));
return thread;
}
void setNamePrefix(folly::StringPiece prefix) {
prefix_ = prefix.str();
}
std::string getNamePrefix() {
return prefix_;
}
private:
std::string prefix_;
std::atomic<uint64_t> suffix_;
};
} // namespace wangle
| /*
* Copyright (c) 2017, 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.
*
*/
#pragma once
#include <atomic>
#include <string>
#include <thread>
#include <wangle/concurrent/ThreadFactory.h>
#include <folly/Conv.h>
#include <folly/Range.h>
#include <folly/ThreadName.h>
namespace wangle {
class NamedThreadFactory : public ThreadFactory {
public:
explicit NamedThreadFactory(folly::StringPiece prefix)
: prefix_(prefix.str()), suffix_(0) {}
std::thread newThread(folly::Func&& func) override {
auto thread = std::thread([&](folly::Func&& funct) {
folly::setThreadName(folly::to<std::string>(prefix_, suffix_++));
funct();
}, std::move(func));
return thread;
}
void setNamePrefix(folly::StringPiece prefix) {
prefix_ = prefix.str();
}
std::string getNamePrefix() {
return prefix_;
}
private:
std::string prefix_;
std::atomic<uint64_t> suffix_;
};
} // namespace wangle
| Switch various calls to folly::setThreadName to set the current thread's name | Switch various calls to folly::setThreadName to set the current thread's name
Summary: This is in preparation for killing the pthread_t overload of folly::setThreadName.
Reviewed By: yfeldblum
Differential Revision: D5012627
fbshipit-source-id: a4e6e2c2cb5bd02b1ebea85c305eac59355a7d42
| C | apache-2.0 | facebook/wangle,facebook/wangle,facebook/wangle |
1210d9a9faf1f60edd489b74c9b74414fcacb6c2 | src/Application.h | src/Application.h | //
// Created by Dawid Drozd aka Gelldur on 05.02.16.
//
#pragma once
#include <string>
#include <memory>
#include <api/ApiThreadPool.h>
#include <data/Preferences.h>
#include <platform/Bridge.h>
#include <screen/ScreenCreator.h>
#include "UILoop.h"
class Application
{
public:
Application(CrossMobile::Platform::Bridge* bridge, ScreenCreator* screenCreator);
virtual ~Application() = default;
virtual void onCreate();
virtual void startScreen(const std::string& screenName);
UILoop& getUILoop()
{
return _uiLoop;
}
ApiThreadPool& getApiThreadPool()
{
return *_apiThreadPool;
}
Preferences& getPreferences()
{
return _preferences;
}
const std::unique_ptr<ScreenCreator>& getScreenCreator() const;
CrossMobile::Platform::Bridge& getBridge();
static Application* getInstance();
private:
UILoop _uiLoop;
std::unique_ptr<ApiThreadPool> _apiThreadPool;
Preferences _preferences;
std::unique_ptr<CrossMobile::Platform::Bridge> _bridge;
std::unique_ptr<ScreenCreator> _screenCreator;
};
| //
// Created by Dawid Drozd aka Gelldur on 05.02.16.
//
#pragma once
#include <string>
#include <memory>
#include <api/ApiThreadPool.h>
#include <data/Preferences.h>
#include <platform/Bridge.h>
#include <screen/ScreenCreator.h>
#include "UILoop.h"
class Application
{
public:
Application(CrossMobile::Platform::Bridge* bridge, ScreenCreator* screenCreator);
virtual ~Application() = default;
virtual void onCreate();
virtual void startScreen(const std::string& screenName);
UILoop& getUILoop()
{
return _uiLoop;
}
ApiThreadPool& getApiThreadPool()
{
return _apiThreadPool;
}
Preferences& getPreferences()
{
return _preferences;
}
const std::unique_ptr<ScreenCreator>& getScreenCreator() const;
CrossMobile::Platform::Bridge& getBridge();
static Application* getInstance();
private:
UILoop _uiLoop;
ApiThreadPool _apiThreadPool;
Preferences _preferences;
std::unique_ptr<CrossMobile::Platform::Bridge> _bridge;
std::unique_ptr<ScreenCreator> _screenCreator;
};
| Fix ApiThreadPool after android changes | Fix ApiThreadPool after android changes
| C | apache-2.0 | gelldur/DexodeEngine,gelldur/DexodeEngine,gelldur/DexodeEngine |
cb7e078f9a6dcb0762ee5a006f40253e6e510879 | TLKSocketIOSignalingDelegate.h | TLKSocketIOSignalingDelegate.h | //
// TLKSocketIOSignalingDelegate.h
// Copyright (c) 2014 &yet, LLC and TLKWebRTC contributors
//
#import <Foundation/Foundation.h>
@class TLKSocketIOSignaling;
@protocol TLKSocketIOSignalingDelegate <NSObject>
@optional
// Called when a connect request has failed due to a bad room key. Delegate is expected to
// get the room key from the user, and then call connect again with the correct key
-(void)serverRequiresPassword:(TLKSocketIOSignaling*)server;
-(void)addedStream:(TLKMediaStreamWrapper*)stream;
-(void)removedStream:(TLKMediaStreamWrapper*)stream;
-(void)peer:(NSString*)peer toggledAudioMute:(BOOL)mute;
-(void)peer:(NSString*)peer toggledVideoMute:(BOOL)mute;
-(void)lockChange:(BOOL)locked;
@end
| //
// TLKSocketIOSignalingDelegate.h
// Copyright (c) 2014 &yet, LLC and TLKWebRTC contributors
//
#import <Foundation/Foundation.h>
@class TLKSocketIOSignaling;
@class TLKMediaStreamWrapper;
@protocol TLKSocketIOSignalingDelegate <NSObject>
@optional
// Called when a connect request has failed due to a bad room key. Delegate is expected to
// get the room key from the user, and then call connect again with the correct key
-(void)serverRequiresPassword:(TLKSocketIOSignaling*)server;
-(void)addedStream:(TLKMediaStreamWrapper*)stream;
-(void)removedStream:(TLKMediaStreamWrapper*)stream;
-(void)peer:(NSString*)peer toggledAudioMute:(BOOL)mute;
-(void)peer:(NSString*)peer toggledVideoMute:(BOOL)mute;
-(void)lockChange:(BOOL)locked;
@end
| Fix missing class forward declaration that could cause build errors with some include orders. | Fix missing class forward declaration that could cause build errors with some include orders. | C | mit | otalk/TLKSimpleWebRTC,martinkubat/TLKSimpleWebRTC |
e3e136ee56fdb815e408b5764cf0f1e54fe7ad17 | sbr/seq_setprev.c | sbr/seq_setprev.c |
/*
* seq_setprev.c -- set the Previous-Sequence
*
* 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 <h/mh.h>
/*
* Add all the messages currently SELECTED to
* the Previous-Sequence. This way, when the next
* command is given, there is a convenient way to
* selected all the messages used in the previous
* command.
*/
void
seq_setprev (struct msgs *mp)
{
char **ap, *cp, *dp;
/*
* Get the list of sequences for Previous-Sequence
* and split them.
*/
if ((cp = context_find (psequence))) {
dp = getcpy (cp);
if (!(ap = brkstring (dp, " ", "\n")) || !*ap) {
free (dp);
return;
}
} else {
return;
}
/* Now add all SELECTED messages to each sequence */
for (; *ap; ap++)
seq_addsel (mp, *ap, -1, 1);
free (dp);
}
|
/*
* seq_setprev.c -- set the Previous-Sequence
*
* 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 <h/mh.h>
#include <h/utils.h>
/*
* Add all the messages currently SELECTED to
* the Previous-Sequence. This way, when the next
* command is given, there is a convenient way to
* selected all the messages used in the previous
* command.
*/
void
seq_setprev (struct msgs *mp)
{
char **ap, *cp, *dp;
/*
* Get the list of sequences for Previous-Sequence
* and split them.
*/
if ((cp = context_find (psequence))) {
dp = mh_xstrdup(cp);
if (!(ap = brkstring (dp, " ", "\n")) || !*ap) {
free (dp);
return;
}
} else {
return;
}
/* Now add all SELECTED messages to each sequence */
for (; *ap; ap++)
seq_addsel (mp, *ap, -1, 1);
free (dp);
}
| Replace getcpy() with mh_xstrdup() where the string isn't NULL. | Replace getcpy() with mh_xstrdup() where the string isn't NULL.
| C | bsd-3-clause | mcr/nmh,mcr/nmh |
f98fbd91e74a366419c67071b39519b28c0e112c | cbits/honk-windows.c | cbits/honk-windows.c | /*
* Copyright 2011 Chris Wong.
*
* 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 "honk-windows.h"
#if !(defined(_WIN32))
# error This file can only be used on Microsoft Windows systems.
#endif
#include <windows.h>
/**
* Windows doesn't need a handle to the console,
* so we just use an arbitrary value instead
*/
static const int default_handle = 42;
int
beep_open() {
return default_handle;
}
int
beep_do(handle_t handle, double freq, double len) {
/* Check the user passed in the same handle we gave them earlier */
if (handle != default_handle)
FAIL;
/* Perform the beep */
Beep((DWORD) freq, (DWORD) (len * 1000));
/* Return the handle */
return handle;
}
void
beep_close(handle_t handle) {
/* Turn off the speaker, if it is running */
Beep(0, 0);
}
| /*
* Copyright 2011 Chris Wong.
*
* 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 "honk.h"
#if !(defined(_WIN32))
# error This file can only be used on Microsoft Windows systems.
#endif
#include <windows.h>
/**
* Windows doesn't need a handle to the console,
* so we just use an arbitrary value instead
*/
static const int default_handle = 42;
int
beep_open() {
return default_handle;
}
int
beep_do(handle_t handle, double freq, double len) {
/* Check the user passed in the same handle we gave them earlier */
if (handle != default_handle)
FAIL;
/* Perform the beep */
Beep((DWORD) freq, (DWORD) (len * 1000));
/* Return the handle */
return handle;
}
void
beep_close(handle_t handle) {
/* Turn off the speaker, if it is running */
Beep(0, 0);
}
| Fix typo in header name | Fix typo in header name
| C | apache-2.0 | lfairy/honk |
33e867ba6f31305b4591c77bfee8118fc3b4a349 | chrome/browser/cocoa/objc_zombie.h | chrome/browser/cocoa/objc_zombie.h | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
#define CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
#pragma once
#import <Foundation/Foundation.h>
// You should think twice every single time you use anything from this
// namespace.
namespace ObjcEvilDoers {
// Enable zombies. Returns NO if it fails to enable.
//
// When |zombieAllObjects| is YES, all objects inheriting from
// NSObject become zombies on -dealloc. If NO, -shouldBecomeCrZombie
// is queried to determine whether to make the object a zombie.
//
// |zombieCount| controls how many zombies to store before freeing the
// oldest. Set to 0 to free objects immediately after making them
// zombies.
BOOL ZombieEnable(BOOL zombieAllObjects, size_t zombieCount);
// Disable zombies.
void ZombieDisable();
} // namespace ObjcEvilDoers
@interface NSObject (CrZombie)
- (BOOL)shouldBecomeCrZombie;
@end
#endif // CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
| // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
#define CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
#pragma once
#import <Foundation/Foundation.h>
// You should think twice every single time you use anything from this
// namespace.
namespace ObjcEvilDoers {
// Enable zombie object debugging. This implements a variant of Apple's
// NSZombieEnabled which can help expose use-after-free errors where messages
// are sent to freed Objective-C objects in production builds.
//
// Returns NO if it fails to enable.
//
// When |zombieAllObjects| is YES, all objects inheriting from
// NSObject become zombies on -dealloc. If NO, -shouldBecomeCrZombie
// is queried to determine whether to make the object a zombie.
//
// |zombieCount| controls how many zombies to store before freeing the
// oldest. Set to 0 to free objects immediately after making them
// zombies.
BOOL ZombieEnable(BOOL zombieAllObjects, size_t zombieCount);
// Disable zombies.
void ZombieDisable();
} // namespace ObjcEvilDoers
@interface NSObject (CrZombie)
- (BOOL)shouldBecomeCrZombie;
@end
#endif // CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
| Add link to explanation of what we mean by zombie The person triaging / debugging a zombie crash may never have heard of this before. | Add link to explanation of what we mean by zombie
The person triaging / debugging a zombie crash may never have heard of this before.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/3763002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@62723 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,ropik/chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,ropik/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium |
79278824c6433ef6634532a1b5192961acc248a4 | libqimessaging/c/qimessaging/c/object_c.h | libqimessaging/c/qimessaging/c/object_c.h | /*
**
** Author(s):
** - Cedric GESTES <[email protected]>
**
** Copyright (C) 2012 Aldebaran Robotics
*/
#ifndef _QIMESSAGING_OBJECT_H_
#define _QIMESSAGING_OBJECT_H_
#include <qimessaging/c/api_c.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct qi_object_t_s {} qi_object_t;
//forward declaration
typedef struct qi_message_t_s qi_message_t;
typedef struct qi_future_t_s qi_future_t;
QIMESSAGING_API typedef void (*qi_object_method_t)(const char *complete_signature, qi_message_t *msg, qi_message_t *ret, void *data);
QIMESSAGING_API qi_object_t *qi_object_create(const char *name);
QIMESSAGING_API void qi_object_destroy(qi_object_t *object);
QIMESSAGING_API int qi_object_register_method(qi_object_t *object, const char *complete_signature, qi_object_method_t func, void *data);
QIMESSAGING_API qi_future_t *qi_object_call(qi_object_t *object, const char *signature, qi_message_t *message);
#ifdef __cplusplus
}
#endif
#endif
| /*
**
** Author(s):
** - Cedric GESTES <[email protected]>
**
** Copyright (C) 2012 Aldebaran Robotics
*/
#ifndef _QIMESSAGING_OBJECT_H_
#define _QIMESSAGING_OBJECT_H_
#include <qimessaging/c/api_c.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct qi_object_t_s {} qi_object_t;
//forward declaration
typedef struct qi_message_t_s qi_message_t;
typedef struct qi_future_t_s qi_future_t;
typedef void (*qi_object_method_t)(const char *complete_signature, qi_message_t *msg, qi_message_t *ret, void *data);
QIMESSAGING_API qi_object_t *qi_object_create(const char *name);
QIMESSAGING_API void qi_object_destroy(qi_object_t *object);
QIMESSAGING_API int qi_object_register_method(qi_object_t *object, const char *complete_signature, qi_object_method_t func, void *data);
QIMESSAGING_API qi_future_t *qi_object_call(qi_object_t *object, const char *signature, qi_message_t *message);
#ifdef __cplusplus
}
#endif
#endif
| Remove unnecessary API export on typedef | Remove unnecessary API export on typedef
Change-Id: Id9b225ad5a7a645763f4377c7f949e9c9bd4f890
Reviewed-on: http://gerrit.aldebaran.lan:8080/4588
Reviewed-by: llec <[email protected]>
Tested-by: llec <[email protected]>
| C | bsd-3-clause | bsautron/libqi,aldebaran/libqi,aldebaran/libqi,aldebaran/libqi-java,aldebaran/libqi-java,aldebaran/libqi,aldebaran/libqi-java,vbarbaresi/libqi |
2efca45c3c1e2186386bb713d4b0b37eb3adee61 | autowiring/C++11/boost_tuple.h | autowiring/C++11/boost_tuple.h | // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#pragma once
#include <boost/tuple/tuple.hpp>
namespace std {
template<typename... Ts>
class tuple {
public:
tuple(const Ts&... ele):
m_tuple(ele...)
{}
virtual ~tuple(void){}
bool operator==(const tuple<Ts...>& other) const {
return m_tuple == other.m_tuple;
}
bool operator<(const tuple<Ts...>& other) const {
return m_tuple < other.m_tuple;
}
boost::tuple<Ts...> m_tuple;
};
template<int I, typename... Ts>
auto get(const ::std::tuple<Ts...>& tup) -> decltype(boost::get<I>(tup.m_tuple)) {
return boost::get<I>(tup.m_tuple);
}
template<typename... Ts>
::std::tuple<Ts...> make_tuple(const Ts&... ele) {
return ::std::tuple<Ts...>(ele...);
}
}//namespace std
| // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#pragma once
#include <boost/tuple/tuple.hpp>
#include "boost/tuple/tuple_comparison.hpp"
namespace std {
template<typename... Ts>
class tuple {
public:
tuple(const Ts&... ele):
m_tuple(ele...)
{}
virtual ~tuple(void){}
bool operator==(const tuple<Ts...>& other) const {
return m_tuple == other.m_tuple;
}
bool operator<(const tuple<Ts...>& other) const {
return m_tuple < other.m_tuple;
}
boost::tuple<Ts...> m_tuple;
};
template<int I, typename... Ts>
auto get(const ::std::tuple<Ts...>& tup) -> decltype(boost::get<I>(tup.m_tuple)) {
return boost::get<I>(tup.m_tuple);
}
template<typename... Ts>
::std::tuple<Ts...> make_tuple(const Ts&... ele) {
return ::std::tuple<Ts...>(ele...);
}
}//namespace std
| Add boost tuple comparison header | Add boost tuple comparison header
| C | apache-2.0 | codemercenary/autowiring,leapmotion/autowiring,codemercenary/autowiring,leapmotion/autowiring,codemercenary/autowiring,codemercenary/autowiring,leapmotion/autowiring,leapmotion/autowiring,leapmotion/autowiring,leapmotion/autowiring,codemercenary/autowiring,codemercenary/autowiring |
3dbfb109ef1ee964a95c283076821be2bcaa896e | include/visionaray/math/ray.h | include/visionaray/math/ray.h | // This file is distributed under the MIT license.
// See the LICENSE file for details.
#pragma once
#ifndef VSNRAY_MATH_RAY_H
#define VSNRAY_MATH_RAY_H 1
#include "config.h"
#include "vector.h"
namespace MATH_NAMESPACE
{
template <typename T>
class basic_ray
{
public:
typedef T scalar_type;
typedef vector<3, T> vec_type;
public:
vec_type ori;
vec_type dir;
basic_ray() = default;
MATH_FUNC basic_ray(vector<3, T> const& o, vector<3, T> const& d);
};
} // MATH_NAMESPACE
#include "detail/ray.inl"
#endif // VSNRAY_MATH_RAY_H
| // This file is distributed under the MIT license.
// See the LICENSE file for details.
#pragma once
#ifndef VSNRAY_MATH_RAY_H
#define VSNRAY_MATH_RAY_H 1
#include "config.h"
#include "vector.h"
namespace MATH_NAMESPACE
{
template <typename T>
class basic_ray
{
public:
typedef T scalar_type;
typedef vector<3, T> vec_type;
public:
vec_type ori;
vec_type dir;
MATH_FUNC basic_ray() = default;
MATH_FUNC basic_ray(vector<3, T> const& o, vector<3, T> const& d);
};
} // MATH_NAMESPACE
#include "detail/ray.inl"
#endif // VSNRAY_MATH_RAY_H
| Mark default ctor host/device for hcc | Mark default ctor host/device for hcc
| C | mit | szellmann/visionaray,szellmann/visionaray |
ce298391eaa951a637d4155212e4927ea576e003 | tensorflow/c/experimental/filesystem/plugins/posix/posix_filesystem.h | tensorflow/c/experimental/filesystem/plugins/posix/posix_filesystem.h | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_C_EXPERIMENTAL_FILESYSTEM_PLUGINS_POSIX_POSIX_FILESYSTEM_H_
#define TENSORFLOW_C_EXPERIMENTAL_FILESYSTEM_PLUGINS_POSIX_POSIX_FILESYSTEM_H_
// Initialize the POSIX filesystem.
//
// In general, the `TF_InitPlugin` symbol doesn't need to be exposed in a header
// file, since the plugin registration will look for the symbol in the DSO file
// that provides the filesystem functionality. However, the POSIX filesystem
// needs to be statically registered in some tests and utilities for building
// the API files at the time of creating the pip package. Hence, we need to
// expose this function so that this filesystem can be statically registered
// when needed.
void TF_InitPlugin(TF_FilesystemPluginInfo* info);
#endif // TENSORFLOW_C_EXPERIMENTAL_FILESYSTEM_MODULAR_FILESYSTEM_H_
| Add a header file for the POSIX filesystem. | Add a header file for the POSIX filesystem.
This header only exposes `TF_InitPlugin` as we need to call this
function when registering the local filesystems statically.
| C | apache-2.0 | petewarden/tensorflow,petewarden/tensorflow,gunan/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,annarev/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-pywrap_saved_model,annarev/tensorflow,Intel-Corporation/tensorflow,paolodedios/tensorflow,frreiss/tensorflow-fred,aldian/tensorflow,paolodedios/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,gunan/tensorflow,sarvex/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,aam-at/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,karllessard/tensorflow,Intel-Corporation/tensorflow,Intel-Corporation/tensorflow,Intel-tensorflow/tensorflow,davidzchen/tensorflow,Intel-tensorflow/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,gunan/tensorflow,freedomtan/tensorflow,karllessard/tensorflow,karllessard/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-pywrap_saved_model,cxxgtxy/tensorflow,gunan/tensorflow,yongtang/tensorflow,freedomtan/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,freedomtan/tensorflow,karllessard/tensorflow,aldian/tensorflow,yongtang/tensorflow,aldian/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,sarvex/tensorflow,davidzchen/tensorflow,sarvex/tensorflow,tensorflow/tensorflow,gunan/tensorflow,cxxgtxy/tensorflow,paolodedios/tensorflow,cxxgtxy/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,aam-at/tensorflow,annarev/tensorflow,Intel-tensorflow/tensorflow,aldian/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,frreiss/tensorflow-fred,davidzchen/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,annarev/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,gunan/tensorflow,Intel-Corporation/tensorflow,gunan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,petewarden/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,davidzchen/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,sarvex/tensorflow,Intel-Corporation/tensorflow,gautam1858/tensorflow,annarev/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,petewarden/tensorflow,aldian/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,davidzchen/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,cxxgtxy/tensorflow,gautam1858/tensorflow,annarev/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,gunan/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,aam-at/tensorflow,tensorflow/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,annarev/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,yongtang/tensorflow,karllessard/tensorflow,freedomtan/tensorflow,gunan/tensorflow,Intel-tensorflow/tensorflow,petewarden/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,aam-at/tensorflow,aldian/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow,paolodedios/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,gunan/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,aam-at/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,aam-at/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-Corporation/tensorflow,davidzchen/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,cxxgtxy/tensorflow,frreiss/tensorflow-fred,gautam1858/tensorflow,annarev/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,aldian/tensorflow,frreiss/tensorflow-fred,cxxgtxy/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,sarvex/tensorflow,gunan/tensorflow,petewarden/tensorflow,Intel-Corporation/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,davidzchen/tensorflow,aam-at/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,annarev/tensorflow,frreiss/tensorflow-fred,gautam1858/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,frreiss/tensorflow-fred,karllessard/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,paolodedios/tensorflow,frreiss/tensorflow-fred,freedomtan/tensorflow,tensorflow/tensorflow,cxxgtxy/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,aldian/tensorflow,davidzchen/tensorflow |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.