Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add recipe for tftp-hpa package | #
# base recipe: http://cgit.openembedded.org/cgit.cgi/meta-openembedded/tree/\
# meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb?
# base branch: master
# base commit: 98842e4e9f53f5f8614dd583dde9f5e898aadbb2
#
SUMMARY = "Client for the Trivial File Transfer Protocol"
DESCRIPTION = \
"The Trivial F... | |
Upgrade to latest version with HEVC content. | DESCRIPTION = "AMSDK multimedia support files"
HOMEPAGE = "https://gforge.ti.com/gf/project/am_multimedia/"
LICENSE = "CC-BY-NC-ND-3.0 & CC-BY-3.0"
SECTION = "multimedia"
LIC_FILES_CHKSUM = "file://Multimedia_Data_Files_Manifest.doc;md5=9254447a504d2179d83a6bc9e2c28142"
PR = "r0"
COMPATIBLE_MACHINE = "(omap3|ti33x|ti4... | |
Add a bitbake recipe to build logutils | SUMMARY = "Go package that augments the standard library "log" package"
HOMEPAGE = "https://github.com/hashicorp/logutils"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b278a92d2c1509760384428817710378"
PKG_NAME = "github.com/hashicorp/logutils"
SRC_URI = "git://${PKG_NAME}.git"
SRCREV = "0dc08b1671f34c42... | |
Add recipe for python-setuptools package. | # base recipe: meta/recipes-devtools/python/python-setuptools_40.8.0.bb
# base branch: warrior
DESCRITPION = "Python Distutils Enhancements"
SUMMARY = "Extensions to the python-distutils for large or complex distributions."
require recipes-devtools/python/python-setuptools.inc
inherit debian-package
require recipes-... | |
Add new release if gpe-mixer. | LICENSE = "GPL"
PR = "r0"
inherit gpe pkgconfig
DESCRIPTION = "GPE audio mixer"
DEPENDS = "gtk+ libgpewidget"
SECTION = "gpe"
PRIORITY = "optional"
| |
Add recipe for Azure IoT device python SDK | SUMMARY = "Microsoft Azure IoT Device Library"
AUTHOR = "Microsoft Corporation"
HOMEPAGE = "https://github.com/Azure/azure-iot-sdk-python/tree/master/azure-iot-device"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit pypi setuptools3
RDEPENDS_$... | |
Add cryptography example C applications | DESCRIPTION = "TI Cryptography Example Applications"
HOMEPAGE = "http://arago-project.org/git/projects/?p=crypto-example-apps.git;a=summary"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://AES/aes_256.c;beginline=9;endline=35;md5=8edbb4dee965d2f2eb5ca2822addcae5"
SECTION = "console"
PR = "r0"
BRANCH ?= "master"
SRCREV = "... | |
Revert "[assassin] Remove curl in DEPENDS of assassin" | DESCRIPTION = "Action GUI for Installer"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
LICENSE = "GPL"
DEPENDS = "dbus (>= 1.1.1) glib-2.0 e-wm packagekit etk edbus eet"
RDEPENDS = "etk-theme-ninja"
PV = "0.2+svnr${SRCREV}"
PR = "r6.03"
SRC_URI = "svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=ht... | DESCRIPTION = "Action GUI for Installer"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
LICENSE = "GPL"
DEPENDS = "dbus (>= 1.1.1) glib-2.0 e-wm packagekit etk edbus eet curl"
RDEPENDS = "etk-theme-ninja"
PV = "0.2+svnr${SRCREV}"
PR = "r6.02"
SRC_URI = "svn://svn.projects.openmoko.org/svnroot/;module=assassin;pro... |
Remove curl in DEPENDS of assassin | DESCRIPTION = "Action GUI for Installer"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
LICENSE = "GPL"
DEPENDS = "dbus (>= 1.1.1) glib-2.0 e-wm packagekit etk edbus eet curl"
RDEPENDS = "etk-theme-ninja"
PV = "0.2+svnr${SRCREV}"
PR = "r6.02"
SRC_URI = "svn://svn.projects.openmoko.org/svnroot/;module=assassin;pro... | DESCRIPTION = "Action GUI for Installer"
HOMEPAGE = "http://assassin.projects.openmoko.org/"
LICENSE = "GPL"
DEPENDS = "dbus (>= 1.1.1) glib-2.0 e-wm packagekit etk edbus eet"
RDEPENDS = "etk-theme-ninja"
PV = "0.2+svnr${SRCREV}"
PR = "r6.03"
SRC_URI = "svn://svn.projects.openmoko.org/svnroot/;module=assassin;proto=ht... |
Add recipe for libdshconfig package | DESCRIPTION = "\
Runtime library for configuration file parser,required for running \
programs with dsh config file support. \
dsh uses this library to parse configuration files."
PR = "r0"
inherit debian-package
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
inherit a... | |
Add recipe for libdatetime-perl package | SUMMARY = "module for manipulating dates, times and timestamps"
DESCRIPTION = "\
DateTime is a Perl module which aims to provide a complete, correct, and easy \
to use date/time object implementation. It provides an easy way to manipulate \
dates and times, including date calculations (even addition and subtraction) \
... | |
Add recipe for libjson-perl package | SUMMARY = "module for manipulating JSON-formatted data"
PR = "r0"
inherit debian-package
LICENSE = "GPL-1+"
LIC_FILES_CHKSUM = "file://README;md5=309aa8b91686700797df6e79ceb678f0"
inherit cpan
FILES_${PN} += "${datadir}"
BBCLASSEXTEND = "native nativesdk"
| |
Add PSP version for ti816x devices. | require u-boot-omap3.inc
COMPATIBLE_MACHINE = "ti816x"
BRANCH = "master"
# Use literal tags in SRCREV, when available, instead of commit IDs
SRCREV = "v2010.06_TI816XPSP_04.00.00.10"
UVER = "2010.06"
PSPREL = "04.00.00.10"
PR = "r1"
| |
Add recipe for target, native and nativesdk use | SUMMARY = "UpdateHub utilities for update package management and server"
SECTION = "devel/python"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=d7d0c756730e640e1731676efa6782e9"
SRC_URI = "git://github.com/UpdateHub/uhu.git;protocol=https"
SRCREV = "fed71af14f79fdc8db8da90f63b8b3d59ea93174"
PV = "1.0.0+${SRC... | |
Use increment-able PV format as other git version recipes do. | LICENSE = "BSD-X"
SECTION = "x11/libs"
PRIORITY = "optional"
DEPENDS = "virtual/libx11 xcalibrateext libxext"
DESCRIPTION = "XCalibrate client-side library"
PV = "0.0+git4be232e30cd33a44a1ce6d3ec429ee6101540c62"
SRC_URI = "git://anongit.freedesktop.org/git/xorg/lib/libXCalibrate;protocol=git;tag=4be232e30cd33a44a1ce6... | LICENSE = "BSD-X"
SECTION = "x11/libs"
PRIORITY = "optional"
DEPENDS = "virtual/libx11 xcalibrateext libxext"
DESCRIPTION = "XCalibrate client-side library"
PR = "r0"
PV = "0.0+${PR}+gitr4be232e30cd33a44a1ce6d3ec429ee6101540c62"
SRC_URI = "git://anongit.freedesktop.org/git/xorg/lib/libXCalibrate;protocol=git;tag=4be2... |
Test application for OMAP DRM interface | DESCRIPTION = "Test applications for OMAP DRM interface"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://viddec3test.c;beginline=1;endline=16;md5=c391f44e40a29096285e3121923041df"
DEPENDS += "libdrm libdce libav"
inherit autotools pkgconfig
PR = "r3"
SRCREV = "64e4e389dd8be4947c107a057f34556a4280281a"
SRC_URI = "git:/... | |
Add new release of gpe-filemanager. |
inherit gpe
PR = "r0"
LICENSE = "GPL"
DESCRIPTION = "GPE file manager"
DEPENDS = "libgpewidget gnome-vfs dbus"
SECTION = "gpe"
RDEPENDS = "gpe-icons"
RRECOMMENDS = "gnome-vfs-plugin-file"
FILES_${PN} += " ${datadir}/gpe"
| |
Refresh the GUI when mxLoggerObserverGUI updates text of a TGadget | Type mxLoggerObserverGUI
Field m_output:Object
Method Reset()
If TGadget(m_output)
SetGadgetText(TGadget(m_output), "")
End If
End Method
Method SendMessage:Object(message:Object, context:Object)
Local msg:String = String(message)
If String(context) = "error"
Notify(msg, True)
Else If TGadget(m_... | Type mxLoggerObserverGUI
Field m_output:Object
Method Reset()
If TGadget(m_output)
SetGadgetText(TGadget(m_output), "")
End If
End Method
Method SendMessage:Object(message:Object, context:Object)
Local msg:String = String(message)
If String(context) = "error"
Notify(msg, True)
Else If TGadget(m_... |
Implement toHex supporting don't-care bits | function String toHex(Bit#(s) num);
function String f(Bit#(s) n);
String dig[16] = {"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"};
return (n == 0) ? "" : f(n / 16) + dig[n % 16];
endfunction
return (num == 0) ? "0" : f(num);
endfunction
| function Bit#(n) removeDontCares(Bit#(n) num);
Bit#(n) res = 0;
for(Integer i = 0; i < valueOf(n); i = i + 1)
res[i] = (num[i] == 1'b1) ? 1'b1 : 1'b0;
return res;
endfunction
function String toHex(Bit#(n) num)
provisos (
Div#(n , 4, ndig),
Mul#(ndig, 4, nadj),
Add#(pad , n, nadj)
);
... |
Fix "Attempt to use this undetermined clock" Error | import Ethernet::*;
(* always_ready, always_enabled *)
interface DE5Pins;
method Action osc_50(Bit#(1) b3d, Bit#(1) b4a, Bit#(1) b4d, Bit#(1) b7a, Bit#(1) b7d, Bit#(1) b8a, Bit#(1) b8d);
method Action sfp(Bit#(1) refclk);
method Action buttons(Bit#(4) v);
// method Bit#(4) serial_tx_data;
// method Action... | import Ethernet::*;
(* always_ready, always_enabled *)
interface DE5Pins;
method Action osc_50(Bit#(1) b3d, Bit#(1) b4a, Bit#(1) b4d, Bit#(1) b7a, Bit#(1) b7d, Bit#(1) b8a, Bit#(1) b8d);
method Action sfp(Bit#(1) refclk);
method Action buttons(Bit#(4) v);
// method Bit#(4) serial_tx_data;
// method Action... |
Make sure Goto is only processed once | namespace BooJs.Compiler.Steps
import Boo.Lang.Compiler.Ast
import Boo.Lang.Compiler.Steps
class ProcessGoto(AbstractTransformerCompilerStep):
"""
Process labels and goto statements
The supported uses are very limited. It's only possible to jump to a label
previously defined in the same function. No jump... | namespace BooJs.Compiler.Steps
import Boo.Lang.Compiler.Ast
import Boo.Lang.Compiler.Steps
class ProcessGoto(AbstractTransformerCompilerStep):
"""
Process labels and goto statements
The supported uses are very limited. It's only possible to jump to a label
previously defined in the same function. No jump... |
Use sequence instead of self execution functions | namespace BooJs.Compiler.Steps
import Boo.Lang.Compiler.Ast
import Boo.Lang.Compiler.Steps
class NormalizeGeneratorExpression(AbstractTransformerCompilerStep):
"""
Converts generator expressions to a simpler format:
( i*2 for i in range(3) )
---
{ __gen = []; for i in range(3): __gen.push... | namespace BooJs.Compiler.Steps
import Boo.Lang.Compiler.Ast
import Boo.Lang.Compiler.Steps
class NormalizeGeneratorExpression(AbstractTransformerCompilerStep):
"""
Converts generator expressions to a simpler format:
( i*2 for i in range(3) )
---
{ __gen = []; for i in range(3): __gen.push... |
Save the correct hyphy materials |
global w;
global t;
global k;
LIKELIHOOD_FUNCTION_OUTPUT = 1;
RANDOM_STARTING_PERTURBATIONS = 1;
/* Include relevant functions */
#include "matrices.mdl"; //rate matrices
#include "GY94_Header.ibf";
/* Read in the data */
DataSet raw_data = ReadDataFile("temp.fasta");
/* Filter the data to find and remove any s... |
global w;
global t;
global k;
LIKELIHOOD_FUNCTION_OUTPUT = 1;
RANDOM_STARTING_PERTURBATIONS = 1;
/* Include relevant functions */
#include "matrices_fix_k.mdl"; //rate matrices
#include "GY94_Header.ibf";
/* Read in the data */
DataSet raw_data = ReadDataFile("temp.fasta");
/* Filter the data to find and remove... |
Add filling char to bf | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ i
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++... | +++++++++++++++++++++++++++++++++++++++++++++ empty line sign
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ i
>++++++++++++++++++++++++++++++++++++++++++... |
Revert "Removes kafka from main config" | # Copyright (C) 2016, Missouri Cyber Team
# All Rights Reserved
# See the file "LICENSE" in the main distribution directory for details
module ROCK;
export {
const sensor_id = "sensor001-001" &redef;
}
# Load integration with Snort on ROCK
@load ./frameworks/files/unified2-integration
# Load integration with FSF
... | # Copyright (C) 2016, Missouri Cyber Team
# All Rights Reserved
# See the file "LICENSE" in the main distribution directory for details
module ROCK;
export {
const sensor_id = "sensor001-001" &redef;
}
# Load integration with Snort on ROCK
@load ./frameworks/files/unified2-integration
# Load integration with FSF
... |
Add archive formats from upstream. | @load ../__load__.bro
module FileExtraction;
const archive_types: set[string] = { "application/x-rar-compressed",
"application/x-bzip2",
"application/gzip",
"application/x-lzma",
"application/x-lzip",
"application/x-xz",
"application/x-lzop",
"application... | |
Add default value for enable_software_deduplication | ##! Packet source using Napatech
module Napatech;
export {
## The size of the software deduplication lru cache
const dedupe_lru_size = 1024 &redef;
## Because applications can share streams, the Host Buffer Allowance
## allows an application to consume a portion of the host buffer
## before the a... | ##! Packet source using Napatech
module Napatech;
export {
## Should the plugin try to deduplicate packets with the color1
## value of the DYN4 packet descriptor?
const enable_software_deduplication = T &redef;
## The size of the software deduplication lru cache
const dedupe_lru_size = 1024 &redef... |
Add return statement in demo_filter.c | #include "filters_api.h"
static PF_FILTER_RESULT demo_filter_keyboard_event(connectionInfo* info, void* param)
{
proxyKeyboardEventInfo* event_data = (proxyKeyboardEventInfo*) param;
return FILTER_PASS;
}
static PF_FILTER_RESULT demo_filter_mouse_event(connectionInfo* info, void* param)
{
proxyMouseEventInfo* even... | #include "filters_api.h"
static PF_FILTER_RESULT demo_filter_keyboard_event(connectionInfo* info, void* param)
{
proxyKeyboardEventInfo* event_data = (proxyKeyboardEventInfo*) param;
return FILTER_PASS;
}
static PF_FILTER_RESULT demo_filter_mouse_event(connectionInfo* info, void* param)
{
proxyMouseEventInfo* even... |
Add sent_messages array to testable controller interface | #import <Foundation/Foundation.h>
@class WKInterfaceController;
@class FakeInterfaceController;
@protocol TestableWKInterfaceController <NSObject>
- (void)awakeWithContext:(id)context;
- (void)willActivate;
- (void)didDeactivate;
@optional
- (void)pushControllerWithName:(NSString *)name context:(id)context;
- (v... | #import <Foundation/Foundation.h>
@class WKInterfaceController;
@class FakeInterfaceController;
@protocol TestableWKInterfaceController <NSObject>
- (void)awakeWithContext:(id)context;
- (void)willActivate;
- (void)didDeactivate;
@optional
- (NSArray *)sent_messages;
- (void)pushControllerWithName:(NSString *)na... |
Add chapter 1 extra exercises | #include <stdio.h>
main() {
float fahr, celsius;
float lower, upper, step;
lower = 0;
upper = 300;
step = 20;
celsius = lower;
printf("%6s\t%3s\n", "celsius", "fahr");
while (celsius <= upper) {
fahr = celsius * (9.0/5.0) + 32.0;
printf("%6.1f\t%3.0f\n", celsius, fah... | |
Add class comment. Reduce indirections in using statement. | // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/util/threadstackexecutorbase.h>
namespace proton {
class ExecutorThreadingServiceStats {
public:
using Stats = vespalib::ThreadStackExecutorBase::Stats;
pr... | // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <cstddef>
#include <vespa/vespalib/util/executor_stats.h>
namespace proton {
/*
* This class contains executor stats for the executors used by a
* document db.
*/
class Exec... |
Use new API on one or more tests | #include "test_parser.h"
void one_or_more_one(void **state) {
grammar_t *grammar = grammar_init(
non_terminal("One"),
rule_init(
"One",
one_or_more(
terminal("11")
)
), 1
);
parse_t *result = parse("11", grammar);
assert_non_null(result);
assert_int_equal(result->lengt... | #include "test_parser.h"
void one_or_more_one(void **state) {
grammar_t *grammar = grammar_init(
non_terminal("One"),
rule_init(
"One",
one_or_more(
terminal("11")
)
), 1
);
parse_result_t *result = parse("11", grammar);
assert_non_null(result);
assert_true(is_success(r... |
Remove nasty character at end of file that prevents compiles | #include <stdio.h>
#include "jpeglib.h"
#include <setjmp.h>
struct error_mgr2 {
struct jpeg_error_mgr pub; /* "public" fields */
jmp_buf setjmp_buffer; /* for return to caller */
};
typedef struct error_mgr2 * error_ptr2;
/*
* Here's the routine that will replace the standard error_exit method:
*/
void error... | #include <stdio.h>
#include "jpeglib.h"
#include <setjmp.h>
struct error_mgr2 {
struct jpeg_error_mgr pub; /* "public" fields */
jmp_buf setjmp_buffer; /* for return to caller */
};
typedef struct error_mgr2 * error_ptr2;
/*
* Here's the routine that will replace the standard error_exit method:
*/
void error... |
Change size of bool to 4 | #pragma once
#ifdef bool
#undef bool
#endif
typedef char bool;
#define true 1
#define false 0
typedef struct carp_thread* carp_thread_t;
typedef void(*carp_thread_routine)(void* arg);
typedef struct carp_library* carp_library_t;
/* Init/shutdown */
void carp_platform_init();
void carp_platform_shutdown();
/* --... | #pragma once
#ifdef bool
#undef bool
#endif
typedef int bool;
#define true 1
#define false 0
typedef struct carp_thread* carp_thread_t;
typedef void(*carp_thread_routine)(void* arg);
typedef struct carp_library* carp_library_t;
/* Init/shutdown */
void carp_platform_init();
void carp_platform_shutdown();
/* ---... |
Document the transformation matrix class | //Copyright (c) 2020 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#ifndef FMATRIX3X3_H
#define FMATRIX3X3_H
namespace cura
{
class Point3;
class FPoint3;
class FMatrix3x3
{
public:
double m[3][3];
FMatrix3x3();
Point3 apply(const FPoint3& p) const;
};
} //names... | //Copyright (c) 2020 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#ifndef FMATRIX3X3_H
#define FMATRIX3X3_H
namespace cura
{
class Point3;
class FPoint3;
/*!
* A 3x3 linear transformation matrix.
*/
class FMatrix3x3
{
public:
/*!
* The matrix data, row-endian.
*
* The f... |
Add include for math.h to lin hash | #ifndef TEST_LINEAR_HASH_H_
#define TEST_LINEAR_HASH_H_
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "../../../planckunit/src/planck_unit.h"
#include "../../../../dictionary/linear_hash/linear_hash.h"
#ifdef __cplusplus
extern "C" {
#endif
void
runalltests_linear_hash();
#ifdef __cplusplus
... | #ifndef TEST_LINEAR_HASH_H_
#define TEST_LINEAR_HASH_H_
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include "../../../planckunit/src/planck_unit.h"
#include "../../../../dictionary/linear_hash/linear_hash.h"
#ifdef __cplusplus
extern "C" {
#endif
void
runalltests_linear_hash();
#i... |
Fix silly mistake in test. | // RUN: clang-cc -emit-llvm %s -o -
typedef short __v4hi __attribute__ ((__vector_size__ (8)));
void f()
{
__v4hi A = (__v4hi)0LL;
}
__v4hi x = {1,2,3};
__v4hi y = {1,2,3,4};
typedef int x __attribute((vector_size(16)));
int a() { x b; return b[2LL]; }
| // RUN: clang-cc -emit-llvm %s -o -
typedef short __v4hi __attribute__ ((__vector_size__ (8)));
void f()
{
__v4hi A = (__v4hi)0LL;
}
__v4hi x = {1,2,3};
__v4hi y = {1,2,3,4};
typedef int vty __attribute((vector_size(16)));
int a() { vty b; return b[2LL]; }
|
Add GET message integration test - Make unit testing write fuller test objects - Make the number of buckets/keys in dummy object configurable - Add several helper functions like comparing binaries and objects - Improve error reporting in testing async callbacks | /*********************************************************************
*
* test_log.c: Riak C Unit Testing logger
*
* Copyright (c) 2007-2014 Basho Technologies, Inc. All Rights Reserved.
*
* This file is provided to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* exce... | |
Set one LED group on for light aiming | /**
* "Aim lights" light script
*
* Turn on all the lights for 30 seconds so they can be aimed
*/
// Copied from todbot
// format of light script lines: duration, command, arg1,arg2,arg3
typedef struct _blinkm_script_line {
uint8_t dur;
uint8_t cmd[4]; // cmd,arg1,arg2,arg3
} blinkm_script_line;
// start ... | |
Add definition for Physical Presence storage flag. | /** @file
Define the variable data structures used for physical presence storage data.
Copyright (c) 2016, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distributi... | |
Add closing bracket to open function in task 02 homework 02 | #include <stdio.h>
#include <string.h>
char* find(char *haystack, char needle);
int main(){
char input[401]={'\0'}, symbol, *result;
fgets(input, 401, stdin);
symbol=getchar();
result=find(input, symbol);
if(result!=NULL){
printf("%ld", result - input);
}
else{
printf("-1");
}
return 0;
}
char*... | #include <stdio.h>
#include <string.h>
char* find(char *haystack, char needle);
int main(){
char input[401]={'\0'}, symbol, *result;
fgets(input, 401, stdin);
symbol=getchar();
result=find(input, symbol);
if(result!=NULL){
printf("%d", (int)(result - input));
}
else{
printf("-1");
}
return 0;
}
... |
Reduce example uses additive calls | /*
* example2.c
*
* Created on: 3 May 2016
* Author: nick
*/
#include "ndm.h"
#include <mpi.h>
#include <stdio.h>
void recvFunction(void*, NDM_Metadata);
int main(int argc, char* argv[]) {
int provided;
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
ndmInit();
char uuid[10];
int... | /*
* example2.c
*
* Created on: 3 May 2016
* Author: nick
*/
#include "ndm.h"
#include <mpi.h>
#include <stdio.h>
void recvFunction(void*, NDM_Metadata);
void additiveRecvFunction(void*, NDM_Metadata);
int main(int argc, char* argv[]) {
int provided;
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, ... |
Fix type signatures for some java bulit-ins | #ifndef __JniHelpersCommon_h__
#define __JniHelpersCommon_h__
// Disable some annoying compiler warnings
#if WIN32
#pragma warning(disable: 4996) // "Security" warnings for vsnprintf
#endif
#if WIN32
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#include <jni.h>
#define kTypeInt "I"
#define kType... | #ifndef __JniHelpersCommon_h__
#define __JniHelpersCommon_h__
// Disable some annoying compiler warnings
#if WIN32
#pragma warning(disable: 4996) // "Security" warnings for vsnprintf
#endif
#if WIN32
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#include <jni.h>
#define kTypeInt "I"
#define kType... |
Add calibration file for board J2 (MAV102) | /*
* conf_imu_rev4.h
*
* Created: 20/11/2013 22:21:49
* Author: sfx
*/
#ifndef CONF_IMU_REV4_H_
#define CONF_IMU_REV4_H_
#define RAW_GYRO_X 0
#define RAW_GYRO_Y 1
#define RAW_GYRO_Z 2
#define RAW_ACC_X 0
#define RAW_ACC_Y 1
#define RAW_ACC_Z 2
#define RAW_COMPASS_X 2
#define RAW_COMPASS_Y 0
#define RAW_COM... | |
Put SynapticsSHM back into the driver to be able to use synclient -m once again | /*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and ... | |
Update files, Alura, Introdução a C - Parte 2, Aula 4.2 | #include <stdio.h>
#include <string.h>
void abertura() {
printf("*******************\n");
printf("* Jogo de Forca *\n");
printf("*******************\n\n");
}
int main() {
char palavrasecreta[20];
sprintf(palavrasecreta, "MELANCIA");
int acertou = 0;
int enforcou = 0;
char chutes[26];
int tentat... | #include <stdio.h>
#include <string.h>
void abertura() {
printf("*******************\n");
printf("* Jogo de Forca *\n");
printf("*******************\n\n");
}
void chuta() {
char chute;
printf("Qual letra? ");
scanf(" %c", &chute);
chutes[tentativas] = chute;
tentativas++;
}
int main() {
char pal... |
Revert "Only define __dead if it's missing" | #ifndef COMPAT_H
#define COMPAT_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef __dead
#define __dead
#endif
#ifndef HAVE_REALLOCARRAY
void *reallocarray(void *, size_t, size_t);
#endif /* !HAVE_REALLOCARRAY */
#endif /* COMPAT_H */
| #ifndef COMPAT_H
#define COMPAT_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef __FreeBSD__
#define __dead __dead2
#endif /* __FreeBSD__ */
#if defined(__linux__) || defined(__CYGWIN__)
#ifndef __dead
#ifdef __GNUC__
#define __dead __attribute__((__noreturn__))
#else
#define __dead
#endif
#endif
#endif /* ... |
Test case for annotate builtin. | // RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | grep llvm.annotation
int main() {
int x = 0;
return __builtin_annotation(x, "annotate");
}
| |
Fix import to be able to use Smartling.i18n as dynamic framework via cocoapods | // Copyright 2015 Smartling, Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this work except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | // Copyright 2015 Smartling, Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this work except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
Handle precision of fractions better | // Spellable.h
#ifndef SPELLABLE_H
#define SPELLABLE_H
#include <string>
template <class T>
class Spellable {
T* value;
public:
Spellable() {};
Spellable(T* value): value(value) {}
Spellable(T v) { value = new T(v); }
void SetValue(T* v) { value = v; }
void SetValue(T v) { value = new T(v); }
T GetValue() c... | // Spellable.h
#ifndef SPELLABLE_H
#define SPELLABLE_H
#include <string>
template <class T>
class Spellable {
T* value;
public:
// TODO: new values are never deleted!
Spellable() { value = NULL; };
Spellable(T* value): value(value) {}
Spellable(T v) { value = new T(v); }
void SetValue(T* v) { value = v; }
... |
Use int64_t for cgen intrinsics | /*
Copyright (c) 2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the follo... | /*
Copyright (c) 2015, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the follo... |
Add printing of file size | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
off_t get_file_size(const char *filename) {
struct stat buffer;
return (stat(filename, &buffer)==0 ? buffer.st_size : -1);
}
int file_is_readable(char *filename) {
if ( access(filename, R_... | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
off_t get_file_size(const char *filename) {
struct stat buffer;
return (stat(filename, &buffer)==0 ? buffer.st_size : -1);
}
int file_is_readable(char *filename) {
if ( access(filename, R_... |
Fix a typo (thanks to Robert Hatcher) | // @(#)root/hist:$Name: $:$Id: TH1I.h,v 1.1 2002/05/18 11:02:49 brun Exp $
// Author: Rene Brun 08/09/2003
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. ... | // @(#)root/hist:$Name: $:$Id: TH1I.h,v 1.1 2003/09/08 12:50:23 brun Exp $
// Author: Rene Brun 08/09/2003
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. ... |
Fix typo in created date. | //
// ServiceMBTA_sensitive.h
// MBTA-APIs
//
// Created by Steve Caine on 01/05/115.
// Copyright (c) 2015 Steve Caine. All rights reserved.
//
// your private key to the MBTA-v2 API goes here
#define key_MBTA_v2_API @""
// you should not commit any version of this file that contains the key
// to any source-co... | //
// ServiceMBTA_sensitive.h
// MBTA-APIs
//
// Created by Steve Caine on 01/05/15.
// Copyright (c) 2015 Steve Caine. All rights reserved.
//
// your private key to the MBTA-v2 API goes here
#define key_MBTA_v2_API @""
// you should not commit any version of this file that contains the key
// to any source-con... |
Remove double definition of default env variables | #ifndef SHELL_H
#define SHELL_H
#include <stdbool.h>
#define report_error() fprintf(stderr, "[%s: %s():%d] %s\n", __FILE__, \
__FUNCTION__, \
__LINE__, \
strerror(errno));
#define sizeof_array(x) (sizeof(x) / sizeof(*x))
#define DEFAULT_PROMPT "$ "
#define DEFAULT_PATH "/bin:/usr/bin/:/... | #ifndef SHELL_H
#define SHELL_H
#include <stdbool.h>
#define report_error() fprintf(stderr, "[%s: %s():%d] %s\n", __FILE__, \
__FUNCTION__, \
__LINE__, \
strerror(errno));
#define sizeof_array(x) (sizeof(x) / sizeof(*x))
typedef struct command_t{
char **array;
unsigned int eleme... |
Make get_temp() static. Split out format(). | // Copyright 2016, Jeffrey E. Bedard
#include "temperature.h"
#include "config.h"
#include "font.h"
#include "util.h"
#include <stdio.h>
uint8_t get_temp(void)
{
return xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE) / 1000;
}
// Returns x offset for next item
uint16_t draw_temp(xcb_connection_t * xc, const uint16_t... | // Copyright 2016, Jeffrey E. Bedard
#include "temperature.h"
#include "config.h"
#include "font.h"
#include "util.h"
#include <stdio.h>
static uint8_t get_temp(void)
{
return xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE) / 1000;
}
static uint8_t format(char * restrict buf, const uint8_t sz)
{
return snprintf(buf... |
Enable move and disable copy for key implementations. | #pragma once
#include "jwtxx/jwt.h"
#include <string>
namespace JWTXX
{
struct Key::Impl
{
virtual ~Impl() {}
virtual std::string sign(const void* data, size_t size) const = 0;
virtual bool verify(const void* data, size_t size, const std::string& signature) const = 0;
};
}
| #pragma once
#include "jwtxx/jwt.h"
#include <string>
namespace JWTXX
{
struct Key::Impl
{
// Need this for polymorphic behavior.
virtual ~Impl() = default;
// Need this due to the Rule of Five.
Impl() = default;
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
Impl(Imp... |
Add delegate for profile view controller. | //
// ProfileViewController.h
// PlayPlan
//
// Created by Zeacone on 15/11/8.
// Copyright © 2015年 Zeacone. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PlayPlan.h"
@interface ProfileViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
@end
| //
// ProfileViewController.h
// PlayPlan
//
// Created by Zeacone on 15/11/8.
// Copyright © 2015年 Zeacone. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PlayPlan.h"
@class ProfileViewController;
@protocol MainDelegate <NSObject>
- (void)dismissViewController:(MainViewController *)mainViewController... |
Test inability to inline certain functions | // RUN: %check -e %s
#define always_inline __attribute((always_inline))
always_inline hidden(int);
void always_inline __attribute((noinline)) noinline(void)
{
}
always_inline void print(const char *fmt, ...)
{
}
always_inline void old(a, b)
int a, b;
{
}
always_inline void addr(int x)
{
int *p = &x;
*p = 3;
}
... | |
Update the default return value of UserPhysicalPresent to TRUE. | /** @file
Provides a secure platform-specific method to detect physically present user.
Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this d... | /** @file
Provides a secure platform-specific method to detect physically present user.
Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this d... |
Fix test for previous commit | // RUN: %clang_cc1 -fsyntax-only -verify
// PR9137
void f0(int x) : {};
void f1(int x) try {};
| // RUN: %clang_cc1 -fsyntax-only -verify %s
// PR9137
void f0(int x) : {}; // expected-error{{expected function body after function declarator}}
void f1(int x) try {}; // expected-error{{expected function body after function declarator}}
|
Change weak reference to assign for backwards compatibility | //
// MFSideMenuShadow.h
// MFSideMenuDemoSearchBar
//
// Created by Michael Frederick on 5/13/13.
// Copyright (c) 2013 Frederick Development. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MFSideMenuShadow : NSObject
@property (nonatomic, assign) BOOL enabled;
@property (nonatomic, assign... | //
// MFSideMenuShadow.h
// MFSideMenuDemoSearchBar
//
// Created by Michael Frederick on 5/13/13.
// Copyright (c) 2013 Frederick Development. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MFSideMenuShadow : NSObject
@property (nonatomic, assign) BOOL enabled;
@property (nonatomic, assign... |
Use the %llvm-gcc% variable to find llvm-gcc for those of us that don't have it in our path and to ensure it uses the configured llvm-gcc not just any one randomly placed in the path. | // RUN: llvm-gcc %s -S -o -
// PR854
struct kernel_symbol {
unsigned long value;
};
unsigned long loops_per_jiffy = (1<<12);
static const char __kstrtab_loops_per_jiffy[]
__attribute__((section("__ksymtab_strings"))) = "loops_per_jiffy";
static const struct kernel_symbol __ksymtab_loops_per_jiffy
__attrib... | // RUN: %llvmgcc% %s -S -o -
// PR854
struct kernel_symbol {
unsigned long value;
};
unsigned long loops_per_jiffy = (1<<12);
static const char __kstrtab_loops_per_jiffy[]
__attribute__((section("__ksymtab_strings"))) = "loops_per_jiffy";
static const struct kernel_symbol __ksymtab_loops_per_jiffy
__attri... |
Update clang_getCursor() test to check searches on include directives | #define OBSCURE(X) X
#define DECORATION
typedef int T;
void OBSCURE(func)(int x) {
OBSCURE(T) DECORATION value;
}
// RUN: c-index-test -cursor-at=%s:1:11 %s | FileCheck -check-prefix=CHECK-1 %s
// CHECK-1: macro definition=OBSCURE
// RUN: c-index-test -cursor-at=%s:2:14 %s | FileCheck -check-prefix=CHECK-2 %s
// CH... | #define OBSCURE(X) X
#define DECORATION
typedef int T;
void OBSCURE(func)(int x) {
OBSCURE(T) DECORATION value;
}
#include "a.h"
// RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
// CHECK-1: macro definition=OBSCURE
// RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | ... |
Allow access to documents of depth 32 | #ifndef SUBDOC_PATH_H
#define SUBDOC_PATH_H
#include "subdoc-api.h"
#include "jsonsl_header.h"
#ifdef __cplusplus
extern "C" {
#endif
#define COMPONENTS_ALLOC 32
typedef struct subdoc_PATH_st {
struct jsonsl_jpr_st jpr_base;
struct jsonsl_jpr_component_st components_s[COMPONENTS_ALLOC];
int has_negix; /*... | #ifndef SUBDOC_PATH_H
#define SUBDOC_PATH_H
#include "subdoc-api.h"
#include "jsonsl_header.h"
#ifdef __cplusplus
extern "C" {
#endif
// Maximum number of components in a path. Set to 33 to allow 32 'actual'
// components plus the implicit root element.
#define COMPONENTS_ALLOC 33
typedef struct subdoc_PATH_st {
... |
Add digits() to count digits of `unsigned int` value | #ifndef __BITOPS_H__
#define __BITOPS_H__
#include <asm/bitops.h>
#include <types.h>
static inline int fls(int x)
{
return WORD_BITS - __clz(x);
}
static inline int ffs(int x)
{
/* mask the least significant bit only */
return fls(x & -x);
}
static inline int log2(int x)
{
if (!x)
return INF;
int sig... | #ifndef __BITOPS_H__
#define __BITOPS_H__
#include <asm/bitops.h>
#include <types.h>
static inline int fls(int x)
{
return WORD_BITS - __clz(x);
}
static inline int ffs(int x)
{
/* mask the least significant bit only */
return fls(x & -x);
}
static inline int digits(const unsigned int n)
{
assert(sizeof(... |
Deal with the LOGIN_NAME_MAX issue in the NetBSD->FreeBSD translation^H^H^Hhack layer. | /* $FreeBSD$ */
/* XXX: Depend on our system headers protecting against multiple includes. */
#include <paths.h>
#undef _PATH_FTPUSERS
#include <pwd.h>
#define _DIAGASSERT(x)
#include <sys/_types.h>
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
long long strsuftollx(const char *,... | /* $FreeBSD$ */
/* XXX: Depend on our system headers protecting against multiple includes. */
#include <paths.h>
#undef _PATH_FTPUSERS
#include <pwd.h>
#define _DIAGASSERT(x)
#include <sys/_types.h>
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
long long strsuftollx(const char *,... |
Remove unused node-counter in routines | #define T_INT 0
#define T_CHR 1
#define T_RTN 2
struct stack_node {
struct stack_node *cdr;
union node_data data;
char type;
}
union node_data {
struct routine routine;
int numval;
}
struct routine {
struct routine *parent;
struct iq_node *nodes;
int num_nodes;
}
struct iq_node {
... | #define T_INT 0
#define T_CHR 1
#define T_RTN 2
struct stack_node {
struct stack_node *cdr;
union node_data data;
char type;
}
union node_data {
struct routine routine;
int numval;
}
struct routine {
struct routine *parent;
struct iq_node *nodes;
}
struct iq_node {
struct iq_node *ne... |
Add required and CGFloat -> float | //
// SEEngineProtocol.h
// Pods
//
// Created by Danil Tulin on 3/14/16.
//
//
#import <Foundation/Foundation.h>
@protocol EngineProtocol <NSObject>
- (void)feedBGRAImageData:(u_int8_t *)data
width:(NSUInteger)width
heieght:(NSUInteger)height;
@property (nonatomic) CGFloat progress;
@end
| //
// SEEngineProtocol.h
// Pods
//
// Created by Danil Tulin on 3/14/16.
//
//
#import <Foundation/Foundation.h>
@protocol EngineProtocol <NSObject>
@required
- (void)feedBGRAImageData:(u_int8_t *)data
width:(NSUInteger)width
heieght:(NSUInteger)height;
@property (nonatomic) float progress;
@end
|
Enlarge snippet size and rank volumn. | /* for MAX_TXT_SEG_BYTES & MAX_TXT_SEG_LEN */
#include "txt-seg/config.h"
#define MAX_TERM_BYTES MAX_TXT_SEG_BYTES
/* consider both math & term */
#define MAX_QUERY_BYTES (MAX_TXT_SEG_BYTES * 32)
#define MAX_QUERY_WSTR_LEN (MAX_TXT_SEG_LEN * 32)
#define MAX_MERGE_POSTINGS 4096
#define SNIPPET_PADDING 80
#def... | /* for MAX_TXT_SEG_BYTES & MAX_TXT_SEG_LEN */
#include "txt-seg/config.h"
#define MAX_TERM_BYTES MAX_TXT_SEG_BYTES
/* consider both math & term */
#define MAX_QUERY_BYTES (MAX_TXT_SEG_BYTES * 32)
#define MAX_QUERY_WSTR_LEN (MAX_TXT_SEG_LEN * 32)
#define MAX_MERGE_POSTINGS 4096
#define SNIPPET_PADDING 320
#de... |
Change body of the toggleUserLoggedStatus method. | // JPet User - JPetUser.h
#ifndef JPET_USER_H
#define JPET_USER_H
#include "TNamed.h"
class JPetUser: public TNamed
{
protected:
int m_id;
std::string m_name;
std::string m_lastName;
std::string m_login;
std::string m_password;
bool m_isRoot;
std::string m_creationDate;
std::string m_lastLoginDate;
... | // JPet User - JPetUser.h
#ifndef JPET_USER_H
#define JPET_USER_H
#include "TNamed.h"
class JPetUser: public TNamed
{
protected:
int m_id;
std::string m_name;
std::string m_lastName;
std::string m_login;
std::string m_password;
bool m_isRoot;
std::string m_creationDate;
std::string m_lastLoginDate;
... |
Add additional string iteration program example | #include <cs50.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
// declare main so that it takes input from command line
int main(int argc, string argv[])
{
for (int i = 1; i < argc; i++)
{
for (int j = 0, k = strlen(argv[i]); j < k; j++)
{
if (j % 2 == 0)
{
... | |
Modify Chapter 27, drill to comply with C89 standard | /* Chapter 27, drill
1. Write a Hello World program
2. Define two variables holding "Hello" and "World!", concatenate them with
a space in between and output them as "Hello World!"
3. Define a function taking a char* p and an int x, print their values in
the format "p is 'foo' and x is 7". Ca... | /* Chapter 27, drill
1. Write a Hello World program
2. Define two variables holding "Hello" and "World!", concatenate them with
a space in between and output them as "Hello World!"
3. Define a function taking a char* p and an int x, print their values in
the format "p is 'foo' and x is 7". Ca... |
Add idle time function for windows | #include <QtGlobal>
#if defined Q_WS_X11
#include <X11/extensions/scrnsaver.h>
#endif
// return idle time in seconds
int getIdleSecs()
{
#if defined Q_WS_X11
int code, idle_sec;
XScreenSaverInfo *ssinfo = XScreenSaverAllocInfo();
if (!ssinfo)
goto fail;
Display *display = XOpenDisplay(0);
... | #include <QtGlobal>
// headers
#if defined Q_WS_X11
#include <X11/extensions/scrnsaver.h>
#elif defined Q_WS_WIN
#include <windows.h>
#endif
// ^ headers
// return idle time in seconds
int getIdleSecs()
{
// linux
#if defined Q_WS_X11
int code, idle_sec;
XScreenSaverInfo *ssinfo = XScreenSaverAllocInfo();
... |
Add test about witness un-CIL invariant being incorrect when branches joined | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();
void __VERIFIER_assert(int cond) {
if (!(cond)) {
ERROR: __VERIFIER_error();
}
return;
}
int main()
{
int x = __VERIFIER_nondet_int();
if (x > 0 && x < 2)
__VERIFIER_assert(x == 1);
... | |
Add KERN_ADDRESS_TBL for each version | #ifndef LOADER_H
#define LOADER_H
#include "../../../libwiiu/src/coreinit.h"
#include "../../../libwiiu/src/socket.h"
#include "../../../libwiiu/src/types.h"
void _start();
void _entryPoint();
/* Arbitrary kernel write syscall */
void kern_write(void *addr, uint32_t value);
#endif /* LOADER_H */ | #ifndef LOADER_H
#define LOADER_H
#include "../../../libwiiu/src/coreinit.h"
#include "../../../libwiiu/src/socket.h"
#include "../../../libwiiu/src/types.h"
/* Kernel address table */
#if VER == 200
#define KERN_ADDRESS_TBL 0x0
#elif VER == 210
#define KERN_ADDRESS_TBL 0x0
#elif VER == 300
#define KERN_AD... |
Change default live to /run/s6-rc | /* ISC license. */
#ifndef S6RC_CONSTANTS_H
#define S6RC_CONSTANTS_H
#define S6RC_COMPILED_BASE "/etc/s6-rc/compiled"
#define S6RC_LIVE_BASE "/s6/s6-rc"
#define S6RC_COMPILED_DIR_LEN 32
#define S6RC_ONESHOT_RUNNER "s6rc-oneshot-runner"
#define S6RC_ONESHOT_RUNNER_LEN (sizeof S6RC_ONESHOT_RUNNER - 1)
#endif
| /* ISC license. */
#ifndef S6RC_CONSTANTS_H
#define S6RC_CONSTANTS_H
#define S6RC_COMPILED_BASE "/etc/s6-rc/compiled"
#define S6RC_LIVE_BASE "/run/s6-rc"
#define S6RC_COMPILED_DIR_LEN 32
#define S6RC_ONESHOT_RUNNER "s6rc-oneshot-runner"
#define S6RC_ONESHOT_RUNNER_LEN (sizeof S6RC_ONESHOT_RUNNER - 1)
#endif
|
Clarify the dynamic linking structure. | /// @file sapi-dylink.h
/// @brief Define the record used for runtime linking.
/// This structure allows forth to easily look up things on the C
/// side of the world.
///
/// Special Rules:
/// - The very first item is the size of the record.
///
// This could be packed more tightly, but its now exactly
// 16 by... | /// @file sapi-dylink.h
/// @brief Define the record used for runtime linking.
/// This structure allows forth to easily look up things on the C
/// side of the world.
///
/// Special Rules:
/// - The very first item is the size of the record.
///
// This could be packed more tightly, but its now exactly
// 16 by... |
Make sure to mark all the methods in the dynamic sizing data source as required | #import <UIKit/UIKit.h>
@protocol UITableViewDataSourceDynamicSizing;
@interface UITableView (DynamicSizing)
- (void)registerClass:(Class)cellClass forDynamicCellReuseIdentifier:(NSString *)identifier;
- (void)registerNib:(UINib *)nib forDynamicCellReuseIdentifier:(NSString *)identifier;
- (CGFloat)minimumHeightForCe... | #import <UIKit/UIKit.h>
@protocol UITableViewDataSourceDynamicSizing;
@interface UITableView (DynamicSizing)
- (void)registerClass:(Class)cellClass forDynamicCellReuseIdentifier:(NSString *)identifier;
- (void)registerNib:(UINib *)nib forDynamicCellReuseIdentifier:(NSString *)identifier;
- (CGFloat)minimumHeightForCe... |
Include both <sys/param.h> and <sys/vmparam.h> since both SUNOS and ULTRIX will need them. | #include <setjmp.h>
/*
Portability: A single method works on all the platforms we have tried
so far, but this may not be true for all platforms.
*/
#if defined(ULTRIX42) || defined(ULTRIX43) || defined(SUNOS41)
# define SETJMP _setjmp
# define LONGJMP _longjmp
extern "C" {
int SETJMP( jmp_buf env );
void LONG... | #include <setjmp.h>
#include <sys/param.h>
#include <sys/vmparam.h>
/*
Portability: A single method works on all the platforms we have tried
so far, but this may not be true for all platforms.
*/
#if defined(ULTRIX42) || defined(ULTRIX43) || defined(SUNOS41)
# define SETJMP _setjmp
# define LONGJMP _longjmp
exter... |
Add ending newline to test. | // RUN: clang -emit-llvm < %s 2>&1 | grep 'addrspace(1)' | count 5
int foo __attribute__((address_space(1)));
int ban[10] __attribute__((address_space(1)));
int bar() { return foo; }
int baz(int i) { return ban[i]; } | // RUN: clang -emit-llvm < %s 2>&1 | grep 'addrspace(1)' | count 5
int foo __attribute__((address_space(1)));
int ban[10] __attribute__((address_space(1)));
int bar() { return foo; }
int baz(int i) { return ban[i]; }
|
Add another missing file :( | // Copyright (c) 2007, 2008 libmv authors.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, p... | |
Fix build for the iPhone Simulator | #ifdef HAVE_FORK
#define HAVE_FORK 1
#endif
#if HAVE_FORK
# if TARGET_OS_IPHONE || APPLE_SDK_IPHONEOS
# define HAVE_SYSTEM 0
# else
# define HAVE_SYSTEM 1
# endif
#else
# define HAVE_SYSTEM 0
#endif
#if HAVE_SYSTEM
#include "p/sh.h"
#endif
#include "p/spp.h"
#include "p/acr.h"
#include "p/pod.h"
#include "p/cpp.h"... | #ifdef HAVE_FORK
#define HAVE_FORK 1
#endif
#if HAVE_FORK
# if TARGET_OS_IPHONE || APPLE_SDK_IPHONEOS || APPLE_SDK_IPHONESIMULATOR
# define HAVE_SYSTEM 0
# else
# define HAVE_SYSTEM 1
# endif
#else
# define HAVE_SYSTEM 0
#endif
#if HAVE_SYSTEM
#include "p/sh.h"
#endif
#include "p/spp.h"
#include "p/acr.h"
#include... |
Add comment about init_list constructor. | //-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
template<class T>
matrix<T>::matrix():data_(),rows_(0),cols_(0){}
template<class T>
matrix<T>::matrix( std::size_t rows, std::size_t cols ):
... | //-----------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------
template<class T>
matrix<T>::matrix():data_(),rows_(0),cols_(0){}
template<class T>
matrix<T>::matrix( std::size_t rows, std::size_t cols ):
... |
Add another nodes by for loop way. | #include <stdio.h>
#include <stdlib.h>
typedef struct n
{
int data;
struct n * next;
} node;
/* Print Linked list values */
void showList(node * list){
int i = 1;
while( list != NULL){
printf("#%d. node, data: %d at pointed: %p, and points to %p\n", i, list->data, list, list->next);
list = list->next;... | |
Add an ERR_CAST() function to complement ERR_PTR and co. | #ifndef _LINUX_ERR_H
#define _LINUX_ERR_H
#include <linux/compiler.h>
#include <asm/errno.h>
/*
* Kernel pointers have redundant information, so we can use a
* scheme where we can return either an error code or a dentry
* pointer with the same return value.
*
* This should be a per-architecture thing, to allow ... | #ifndef _LINUX_ERR_H
#define _LINUX_ERR_H
#include <linux/compiler.h>
#include <asm/errno.h>
/*
* Kernel pointers have redundant information, so we can use a
* scheme where we can return either an error code or a dentry
* pointer with the same return value.
*
* This should be a per-architecture thing, to allow ... |
Fix 32-bit compile by making the per-thread address data 64-bit | #ifndef __THREAD_INFO_H
#define __THREAD_INFO_H
#include "globals.h"
#include "sift_writer.h"
#include "bbv_count.h"
#include "pin.H"
#include <deque>
typedef struct {
Sift::Writer *output;
ADDRINT dyn_addresses[Sift::MAX_DYNAMIC_ADDRESSES];
UINT32 num_dyn_addresses;
Bbv *bbv;
UINT64 thread_num;
AD... | #ifndef __THREAD_INFO_H
#define __THREAD_INFO_H
#include "globals.h"
#include "sift_writer.h"
#include "bbv_count.h"
#include "pin.H"
#include <deque>
typedef struct {
Sift::Writer *output;
UINT64 dyn_addresses[Sift::MAX_DYNAMIC_ADDRESSES];
UINT32 num_dyn_addresses;
Bbv *bbv;
UINT64 thread_num;
ADD... |
Add intermediate TextureVideoFrame typedef for Chromium | /*
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | |
Implement function to draw circle | #include <math.h>
#include <glib.h>
#include <gtk/gtk.h>
#include "fake-lock-screen-pattern.h"
void flsp_draw_circle(cairo_t *context, gint x, gint y,
gint radius, GdkRGBA circle, GdkRGBA border)
{
cairo_set_line_width(context, 9);
cairo_set_source_rgb(context, border.red, border.green, borde... | |
Fix for building without notify | /* Copyright (C) 2003 Timo Sirainen */
#include "lib.h"
#include "ioloop-internal.h"
#ifdef IOLOOP_NOTIFY_NONE
struct io *io_loop_notify_add(struct ioloop *ioloop __attr_unused__,
const char *path __attr_unused__,
io_callback_t *callback __attr_unused__,
void *context __attr_unused__)
{
r... | /* Copyright (C) 2003 Timo Sirainen */
#include "lib.h"
#include "ioloop-internal.h"
#ifdef IOLOOP_NOTIFY_NONE
#undef io_add_notify
struct io *io_add_notify(const char *path __attr_unused__,
io_callback_t *callback __attr_unused__,
void *context __attr_unused__)
{
return NULL;
}
void io_loop_notify_remove(... |
Remove seL4_Yield() since it's removed from the RT kernel. | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <sel4/sel4.h>
l... | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <sel4/sel4.h>
l... |
Add empty SF_IMPORTANT macro for release build | // Copyright (c) 2016 Sift Science. All rights reserved.
@import Foundation;
/** Debug output that can be turned on/off by SF_DEBUG_ENABLE macro. */
#ifdef SF_DEBUG_ENABLE
#define SF_DEBUG(FORMAT, ...) NSLog(@"%s:%d " FORMAT, __FUNCTION__, __LINE__, ## __VA_ARGS__)
#else
#define SF_DEBUG(...)
#endif
/** Log messages... | // Copyright (c) 2016 Sift Science. All rights reserved.
@import Foundation;
/** Debug output that can be turned on/off by SF_DEBUG_ENABLE macro. */
#ifdef SF_DEBUG_ENABLE
#define SF_DEBUG(FORMAT, ...) NSLog(@"%s:%d " FORMAT, __FUNCTION__, __LINE__, ## __VA_ARGS__)
#else
#define SF_DEBUG(...)
#endif
/** Log messages... |
Use offsetof() builtin with GCC | /* stddef.h */
/*
* Copyright (c) 2014 Wind River Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | /* stddef.h */
/*
* Copyright (c) 2014 Wind River Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... |
Disable Jtag came enable by default | /*
* startup.h
*
* Created on: Nov 15, 2016
* Author: RoyerAriel
*/
#ifndef STARTUP_C_
#define STARTUP_C_
#include "Timer.h"
void startup()
{
//Start Systick Timer at 1ms
Systick_Startup();
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //0x2000000
}
#endif /* STARTUP_C_ */
| /*
* startup.h
*
* Created on: Nov 15, 2016
* Author: RoyerAriel
*/
#ifndef STARTUP_C_
#define STARTUP_C_
#include "Timer.h"
void startup()
{
//Start Systick Timer at 1ms
Systick_Startup();
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //0x2000000disable jtag
}
#endif /* STARTU... |
Allow non printing chars to also work well | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define STTY "/bin/stty "
const char RAW[] = STTY "raw";
const char COOKED[] = STTY "cooked";
const char default_str[] = "I AM AN IDIOT ";
int main(int argc, char **argv) {
system(RAW);
const char *str;
if ( argc == 2 )
str = argv[1];
else
s... | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define STTY "/bin/stty "
const char RAW[] = STTY "raw";
const char COOKED[] = STTY "cooked";
const char default_str[] = "I AM AN IDIOT ";
int main(int argc, char **argv) {
system(RAW);
const char *str;
if ( argc == 2 )
str = argv[1];
else
s... |
Add qstr - query string utility | // ** QueryString
//
// This program reads chars from stdin without echo and put to stdout.
//
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>
int main(int argc, char * args[])
{
struct termios old_tio, new_tio;
unsigned char c;
/* get the terminal settings for stdin */
tcgetattr(... | |
Fix a broken test in rev. 85199. | // RUN: clang-cc -E -C %s | FileCheck -strict-whitespace %s
// CHECK: boo bork bar // zot
// RUN: clang-cc -E -CC %s | FileCheck -strict-whitespace %s
// CHECK: boo bork /* blah*/ bar // zot
// RUN: clang-cc -E %s | FileCheck -strict-whitespace %s
// CHECK: boo bork bar
#define FOO bork // blah
boo FOO bar // zot
| // RUN: clang-cc -E -C %s | FileCheck -strict-whitespace %s &&
// CHECK: boo bork bar // zot
// RUN: clang-cc -E -CC %s | FileCheck -strict-whitespace %s &&
// CHECK: boo bork /* blah*/ bar // zot
// RUN: clang-cc -E %s | FileCheck -strict-whitespace %s
// CHECK: boo bork bar
#define FOO bork // blah
boo FOO bar //... |
Implement accept of incoming requests | #include <netinet/in.h>
#include <stdio.h>
#include <sys/socket.h>
int main(int argc, char** argv)
{
int listen_fd;
struct sockaddr_in serv_addr;
listen_fd = socket(AF_INET, SOCK_STREAM, 0);
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_addr.sin_port = htons(8080);
bin... | #include <netinet/in.h>
#include <stdio.h>
#include <sys/socket.h>
#include <unistd.h>
#define TRUE 1
#define BUFFER_SIZE 8096
int main(int argc, char** argv)
{
int listen_fd;
int connection_fd;
socklen_t length;
int err;
int read_len;
char buffer[BUFFER_SIZE+1];
struct sockaddr_in serv_addr;
struct sock... |
Change include to forward declaration | /// \file
/// \brief This header contains functionality needed for serializing and deserealizing to/from a stream
#pragma once
#include "ISerializable.h"
#include "IStorage.h"
#include <iostream>
/// Contains all the functionality provided by the library.
namespace simpson
{
/// Serialize object to ostream
std::ost... | /// \file
/// \brief This header contains functionality needed for serializing and deserealizing to/from a stream
#pragma once
#include "IStorage.h"
#include <iostream>
/// Contains all the functionality provided by the library.
namespace simpson
{
class ISerializable;
/// Serialize object to ostream
std::ostream&... |
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level | //
// Licensed under the terms in License.txt
//
// Copyright 2010 Allen Ding. All rights reserved.
//
#import <Foundation/Foundation.h>
#define KW_VERSION 0.5
// Blocks being unavailable cripples the usability of Kiwi, but is supported
// because they are not available on anything less than a device running 3.2.
#i... | //
// Licensed under the terms in License.txt
//
// Copyright 2010 Allen Ding. All rights reserved.
//
#import <Foundation/Foundation.h>
#define KW_VERSION 0.5
// Blocks being unavailable cripples the usability of Kiwi, but is supported
// because they are not available on anything less than a device running 3.2.
#i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.