doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
76a11ba1-c3e2-4306-86a8-2db5ed2a762f
{ "language": "C" }
```c #include <stdio.h> #include <string.h> void abertura() { printf("*******************\n"); printf("* Jogo de Forca *\n"); printf("*******************\n\n"); } int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; char chutes[26]; int t...
```c #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() { cha...
09de498f-8fd3-48f3-a146-dff0f82f7ad7
{ "language": "C" }
```c #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 */ ``` Revert "Only define __dead if it's missing"
```c #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 #endi...
ca98d373-f284-4820-931e-cd8e4e427c2f
{ "language": "C" }
```c ``` Test case for annotate builtin.
```c // RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | grep llvm.annotation int main() { int x = 0; return __builtin_annotation(x, "annotate"); } ```
e430ea19-b453-43d5-8fb0-9f0386e3ed66
{ "language": "C" }
```c // 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 ...
```c // 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 ...
d5cb23f4-c42f-4e35-96ac-4358442949f3
{ "language": "C" }
```c // 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 GetValu...
```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 = ...
2962e2a9-57a0-454a-bd74-48a9322b2f3c
{ "language": "C" }
```c /** * Win32 EntropySource Header File * (C) 1999-2008 Jack Lloyd */ #ifndef BOTAN_ENTROPY_SRC_WIN32_H__ #define BOTAN_ENTROPY_SRC_WIN32_H__ #include <botan/entropy_src.h> namespace Botan { /** * Win32 Entropy Source */ class BOTAN_DLL Win32_EntropySource : public EntropySource { public: std::string...
```c /** * Win32 EntropySource Header File * (C) 1999-2008 Jack Lloyd */ #ifndef BOTAN_ENTROPY_SRC_WIN32_H__ #define BOTAN_ENTROPY_SRC_WIN32_H__ #include <botan/entropy_src.h> namespace Botan { /** * Win32 Entropy Source */ class BOTAN_DLL Win32_EntropySource : public EntropySource { public: std::string...
ff082502-41ba-47e4-b55e-262faff11232
{ "language": "C" }
```c /* 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 ...
```c /* 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 ...
da574ac0-d1ff-41c6-8fba-ec97febf76e6
{ "language": "C" }
```c #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> #include <errno.h> #include <sys/stat.h> off_t get_file_size(const char *filename) { struct stat buffer; return (stat(filename, &buffer)==0 ? buffer.st_size : -1); } int file_is_readable(char *filename) { if ( access(filenam...
```c #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> #include <errno.h> #include <sys/stat.h> off_t get_file_size(const char *filename) { struct stat buffer; return (stat(filename, &buffer)==0 ? buffer.st_size : -1); } int file_is_readable(char *filename) { if ( access(filenam...
23990b8f-0345-4147-93ef-94c409478eec
{ "language": "C" }
```c // @(#)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. ...
```c // @(#)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. ...
89aec90d-dfa6-4c05-98d1-e2744a8ece48
{ "language": "C" }
```c // // 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 sour...
```c // // 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 sourc...
1b54637c-468d-4b1e-8b3a-bbba808faf5d
{ "language": "C" }
```c #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/b...
```c #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 ...
dd722929-3d1a-4317-b914-4d7914006364
{ "language": "C" }
```c // Copyright 2016, Jeffrey E. Bedard #include "temperature.h" #include "config.h" #include "font.h" #include "util.h" #include <stdio.h> uint8_t get_temp(void) { return xstatus_system_value(XSTATUS_SYSFILE_TEMPERATURE) / 1000; } // Returns x offset for next item uint16_t draw_temp(xcb_connection_t * xc, const uin...
```c // 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 snprint...
3c54d90b-8dd9-4e1e-9a1f-2f74959d4dcd
{ "language": "C" }
```c // RUN: %ocheck 1 '-DNULL=(void *)0' // RUN: %ocheck 0 '-DNULL=0' int null_is_ptr_type() { char s[1][1+(int)NULL]; int i = 0; sizeof s[i++]; return i; } main() { return null_is_ptr_type(); } ``` Fix standard-nonconst vla test commands
```c // RUN: %ocheck 1 %s '-DNULL=(void *)0' // RUN: %ocheck 0 %s '-DNULL=0' int null_is_ptr_type() { char s[1][1+(int)NULL]; int i = 0; sizeof s[i++]; return i; } main() { return null_is_ptr_type(); } ```
e948df3a-f114-4ca9-bdc2-9c96d8d6079c
{ "language": "C" }
```c #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; }; } ``` Enable move and dis...
```c #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; Imp...
b60dbf1e-a9bd-41bf-aaa7-fd8279056179
{ "language": "C" }
```c // // 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 ``` Add delegate for profil...
```c // // 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 *)mainViewContr...
79ccac0c-08ba-484b-a005-787e6962b720
{ "language": "C" }
```c ``` Test inability to inline certain functions
```c // RUN: %check -e %s #define always_inline __attribute((always_inline)) always_inline hidden(int); void always_inline __attribute((noinline)) noinline(void) { } always_inline void print(const char *fmt, ...) { } always_inline void old(a, b) int a, b; { } always_inline void addr(int x) { int *p = &x; *p = ...
c776fedf-6785-476a-a4d8-81fe86aed8f3
{ "language": "C" }
```c /** @file Provides a secure platform-specific method to detect physically present user. Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies t...
```c /** @file Provides a secure platform-specific method to detect physically present user. Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies t...
e7914d0d-b17b-468a-822f-962feb1dd01d
{ "language": "C" }
```c // RUN: %clang_cc1 -fsyntax-only -verify // PR9137 void f0(int x) : {}; void f1(int x) try {}; ``` Fix test for previous commit
```c // 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}} ```
fec3ffb9-3b37-40e6-aa6f-9aa73ceb657c
{ "language": "C" }
```c // // 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, a...
```c // // 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, a...
d967341f-9ea0-44aa-843d-1bbed951bac8
{ "language": "C" }
```c // RUN: llvm-gcc %s -S -o - // PR854 struct kernel_symbol { unsigned long value; }; unsigned long loops_per_jiffy = (1<<12); static const char __kstrtab_loops_per_jiffy[] __attribute__((section("__ksymtab_strings"))) = "loops_per_jiffy"; static const struct kernel_symbol __ksymtab_loops_per_jiffy __a...
```c // 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 __...
c32c627a-8bca-4806-aa07-8c5ff05c0e5e
{ "language": "C" }
```c #define OBSCURE(X) X #define DECORATION typedef int T; void OBSCURE(func)(int x) { OBSCURE(T) DECORATION value; } // RUN: c-index-test -cursor-at=%s:1:11 %s | FileCheck -check-prefix=CHECK-1 %s // CHECK-1: macro definition=OBSCURE // RUN: c-index-test -cursor-at=%s:2:14 %s | FileCheck -check-prefix=CHECK-2 %s ...
```c #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 ...
fd2df8b7-f7e7-4e98-8165-4fcf68e2faa7
{ "language": "C" }
```c #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_negi...
```c #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...
34304c4d-762e-42c1-b12a-62e3f8860e97
{ "language": "C" }
```c #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; in...
```c #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(si...
a1d416bd-f13c-402d-9960-68b6da19af50
{ "language": "C" }
```c /* $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 ch...
```c /* $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 ch...
74c0393a-4756-4e9d-adfb-86997634bc19
{ "language": "C" }
```c #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 ...
```c #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_nod...
69f23896-6161-48c6-9ac0-0963a2e31e0c
{ "language": "C" }
```c // // 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 ``` A...
```c // // 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; @e...
4746efa9-4b65-48c4-a1b7-fca70fb1d3fc
{ "language": "C" }
```c /* 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...
```c /* 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 32...
1c8aa599-da8f-4fb5-bb1b-d61a317f58ae
{ "language": "C" }
```c // 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_lastLoginDa...
```c // 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_lastLoginDa...
035b88de-b12f-46de-aae5-04a43094a882
{ "language": "C" }
```c ``` Add additional string iteration program example
```c #include <cs50.h> #include <ctype.h> #include <stdio.h> #include <string.h> // declare main so that it takes input from command line int main(int argc, string argv[]) { for (int i = 1; i < argc; i++) { for (int j = 0, k = strlen(argv[i]); j < k; j++) { if (j % 2 == 0) ...
5da4904f-0f9b-4a56-b8c5-5553eb4da4cf
{ "language": "C" }
```c /* Chapter 27, drill 1. Write a Hello World program 2. Define two variables holding "Hello" and "World!", concatenate them with a space in between and output them as "Hello World!" 3. Define a function taking a char* p and an int x, print their values in the format "p is 'foo' and x is 7...
```c /* Chapter 27, drill 1. Write a Hello World program 2. Define two variables holding "Hello" and "World!", concatenate them with a space in between and output them as "Hello World!" 3. Define a function taking a char* p and an int x, print their values in the format "p is 'foo' and x is 7...
63723dca-aac3-4601-895b-40f033747af0
{ "language": "C" }
```c #include <QtGlobal> #if defined Q_WS_X11 #include <X11/extensions/scrnsaver.h> #endif // return idle time in seconds int getIdleSecs() { #if defined Q_WS_X11 int code, idle_sec; XScreenSaverInfo *ssinfo = XScreenSaverAllocInfo(); if (!ssinfo) goto fail; Display *display = XOpenDisplay(0)...
```c #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 = XScreenSaverAllocInf...
798af64b-d00d-4c83-bc90-886cb891c7e4
{ "language": "C" }
```c ``` Add test about witness un-CIL invariant being incorrect when branches joined
```c extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: __VERIFIER_error(); } return; } int main() { int x = __VERIFIER_nondet_int(); if (x > 0 && x < 2) __VERIFIER_assert(x == 1...
32ac4848-fcf4-4537-a39e-fc703cad6845
{ "language": "C" }
```c #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 */``` Add KERN...
```c #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 KE...
cd334d3f-09b7-41f6-bc3b-1a70947d0ede
{ "language": "C" }
```c /* 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 ``...
```c /* 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 `...
507f74c4-fd5f-4951-9df4-cf9b4981ee67
{ "language": "C" }
```c /// @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 // ...
```c /// @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 // ...
0e4f86b7-747c-4e41-82ce-d523fdd36830
{ "language": "C" }
```c #import <UIKit/UIKit.h> @protocol UITableViewDataSourceDynamicSizing; @interface UITableView (DynamicSizing) - (void)registerClass:(Class)cellClass forDynamicCellReuseIdentifier:(NSString *)identifier; - (void)registerNib:(UINib *)nib forDynamicCellReuseIdentifier:(NSString *)identifier; - (CGFloat)minimumHeight...
```c #import <UIKit/UIKit.h> @protocol UITableViewDataSourceDynamicSizing; @interface UITableView (DynamicSizing) - (void)registerClass:(Class)cellClass forDynamicCellReuseIdentifier:(NSString *)identifier; - (void)registerNib:(UINib *)nib forDynamicCellReuseIdentifier:(NSString *)identifier; - (CGFloat)minimumHeight...
821cdf3b-a045-438f-a461-aa2222fc771a
{ "language": "C" }
```c #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...
```c #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 ...
93694703-c8c6-41cd-844e-980885cb2466
{ "language": "C" }
```c // RUN: clang -emit-llvm < %s 2>&1 | grep 'addrspace(1)' | count 5 int foo __attribute__((address_space(1))); int ban[10] __attribute__((address_space(1))); int bar() { return foo; } int baz(int i) { return ban[i]; }``` Add ending newline to test.
```c // RUN: clang -emit-llvm < %s 2>&1 | grep 'addrspace(1)' | count 5 int foo __attribute__((address_space(1))); int ban[10] __attribute__((address_space(1))); int bar() { return foo; } int baz(int i) { return ban[i]; } ```
c490e6f8-3cde-4968-a50f-38ee4593dab1
{ "language": "C" }
```c ``` Add another missing file :(
```c // 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, mer...
308b66ac-67b8-4b04-9d64-7a7372d3e02e
{ "language": "C" }
```c #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/c...
```c #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" #in...
cbede934-2b49-4902-afdc-54059fd415c9
{ "language": "C" }
```c //----------------------------------------------------------------------------- // 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 ...
```c //----------------------------------------------------------------------------- // 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 ...
83baf43b-5375-468d-80e7-341d3e0d36cc
{ "language": "C" }
```c ``` Add another nodes by for loop way.
```c #include <stdio.h> #include <stdlib.h> typedef struct n { int data; struct n * next; } node; /* Print Linked list values */ void showList(node * list){ int i = 1; while( list != NULL){ printf("#%d. node, data: %d at pointed: %p, and points to %p\n", i, list->data, list, list->next); list = list->...
ac7135e0-7b42-4022-996d-4e6aafb363ec
{ "language": "C" }
```c #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 a...
```c #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 a...
b1c222dd-f5f3-4548-b91f-a1e18b76060b
{ "language": "C" }
```c #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; ...
```c #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; ...
824cfcc5-0aa6-497b-8675-0e8dfa44701b
{ "language": "C" }
```c ``` Add intermediate TextureVideoFrame typedef for Chromium
```c /* * 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 cont...
6a0efecd-f0a6-41e4-b302-f53669eb01c3
{ "language": "C" }
```c ``` Implement function to draw circle
```c #include <math.h> #include <glib.h> #include <gtk/gtk.h> #include "fake-lock-screen-pattern.h" void flsp_draw_circle(cairo_t *context, gint x, gint y, gint radius, GdkRGBA circle, GdkRGBA border) { cairo_set_line_width(context, 9); cairo_set_source_rgb(context, border.red, border.green, ...
2e9937be-6540-45f4-bf96-54939a02c229
{ "language": "C" }
```c /* Copyright (C) 2003 Timo Sirainen */ #include "lib.h" #include "ioloop-internal.h" #ifdef IOLOOP_NOTIFY_NONE struct io *io_loop_notify_add(struct ioloop *ioloop __attr_unused__, const char *path __attr_unused__, io_callback_t *callback __attr_unused__, void *context __attr_unused__)...
```c /* 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_re...
2d361d92-d69c-4310-b70f-ad44ec0bda93
{ "language": "C" }
```c /* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <sel4/sel4....
```c /* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <sel4/sel4....
12c0a5d6-cead-41a9-84b4-7541cdd38016
{ "language": "C" }
```c // 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 mes...
```c // 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 mes...
055c687b-9461-41a3-9338-f6e54b88a95a
{ "language": "C" }
```c /* 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 re...
```c /* 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 re...
f4a562bc-58de-4e06-af5c-41818febf360
{ "language": "C" }
```c #include <stddef.h> #include <unistd.h> int main(int argc, char *argv[]) { const char *args[2] = {"T7037", NULL}; execv("./T7037", args); } ``` Make T7037 work on both Windows and other platforms
```c #include <stddef.h> #include <unistd.h> int main(int argc, char *argv[]) { #ifdef __MINGW32__ const #endif char * args[2] = {"T7037", NULL}; execv("./T7037", args); } ```
f5d5f53c-5d98-4f99-a187-acd46ef2f88b
{ "language": "C" }
```c /* * startup.h * * Created on: Nov 15, 2016 * Author: RoyerAriel */ #ifndef STARTUP_C_ #define STARTUP_C_ #include "Timer.h" void startup() { //Start Systick Timer at 1ms Systick_Startup(); AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //0x‭2000000‬ } #endif /* STARTUP_C_ */ ...
```c /* * startup.h * * Created on: Nov 15, 2016 * Author: RoyerAriel */ #ifndef STARTUP_C_ #define STARTUP_C_ #include "Timer.h" void startup() { //Start Systick Timer at 1ms Systick_Startup(); AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //0x‭2000000‬disable jtag } #endif /* S...
c9c08d39-42e9-4ff3-a159-23616e8dc22f
{ "language": "C" }
```c #include <stdio.h> #include <stdlib.h> #include <string.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { system(RAW); const char *str; if ( argc == 2 ) str = argv[1]; else ...
```c #include <stdio.h> #include <stdlib.h> #include <string.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { system(RAW); const char *str; if ( argc == 2 ) str = argv[1]; else ...
801cf4c1-810f-4a95-801b-85aa3cefdd49
{ "language": "C" }
```c /* * Copyright 2016, Data61 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) * ABN 41 687 119 230. * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG...
```c /* * Copyright 2016, Data61 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) * ABN 41 687 119 230. * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG...
ceb07df6-50ef-4d86-add2-ee5611250993
{ "language": "C" }
```c ``` Add qstr - query string utility
```c // ** QueryString // // This program reads chars from stdin without echo and put to stdout. // #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <termios.h> int main(int argc, char * args[]) { struct termios old_tio, new_tio; unsigned char c; /* get the terminal settings for stdin */ tcget...
51a55814-66c6-441d-8be0-1adf8009724b
{ "language": "C" }
```c // RUN: clang-cc -E -C %s | FileCheck -strict-whitespace %s // CHECK: boo bork bar // zot // RUN: clang-cc -E -CC %s | FileCheck -strict-whitespace %s // CHECK: boo bork /* blah*/ bar // zot // RUN: clang-cc -E %s | FileCheck -strict-whitespace %s // CHECK: boo bork bar #define FOO bork // blah boo FOO bar // ...
```c // RUN: clang-cc -E -C %s | FileCheck -strict-whitespace %s && // CHECK: boo bork bar // zot // RUN: clang-cc -E -CC %s | FileCheck -strict-whitespace %s && // CHECK: boo bork /* blah*/ bar // zot // RUN: clang-cc -E %s | FileCheck -strict-whitespace %s // CHECK: boo bork bar #define FOO bork // blah boo FOO b...
3340750f-bcbd-45fb-b9b7-049d289d2df4
{ "language": "C" }
```c #include <netinet/in.h> #include <stdio.h> #include <sys/socket.h> int main(int argc, char** argv) { int listen_fd; struct sockaddr_in serv_addr; listen_fd = socket(AF_INET, SOCK_STREAM, 0); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); serv_addr.sin_port = htons(8080); ...
```c #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...
a6c36f64-43a3-4d44-baa3-9aa84ad535df
{ "language": "C" }
```c /// \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...
```c /// \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::ost...
502a2052-d6f3-4e55-9760-c9109ebdb97f
{ "language": "C" }
```c // // 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....
```c // // 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....
5c5693f4-316a-48ad-9e6e-5434a0010c13
{ "language": "C" }
```c // A test for the propagation of the -mmcu option to -cc1 and -cc1as // RUN: %clang -### -target avr -mmcu=atmega328p -save-temps %s 2>&1 | FileCheck %s // CHECK: clang{{.*}} "-cc1" {{.*}} "-target-cpu" "atmega328p" // CHECK: clang{{.*}} "-cc1as" {{.*}} "-target-cpu" "atmega328p" ``` Add a missing -no-canonical-...
```c // A test for the propagation of the -mmcu option to -cc1 and -cc1as // RUN: %clang -### -target avr -no-canonical-prefixes -mmcu=atmega328p -save-temps %s 2>&1 | FileCheck %s // CHECK: clang{{.*}} "-cc1" {{.*}} "-target-cpu" "atmega328p" // CHECK: clang{{.*}} "-cc1as" {{.*}} "-target-cpu" "atmega328p" ```
b52f24cb-e4fb-44fe-a9fc-2ad28e54fa62
{ "language": "C" }
```c // // BIObjCHelpers.h // BIObjCHelpersExample // // Created by Bogdan Iusco on 1/19/15. // Copyright (c) 2015 Bogdan Iusco. All rights reserved. // // Starters #import "BIStarterProtocol.h" #import "BILifecycle.h" #import "BIStartersFactory.h" #import "BIOperationQueue.h" // Views #import "BITableView.h" //...
```c // // BIObjCHelpers.h // BIObjCHelpersExample // // Created by Bogdan Iusco on 1/19/15. // Copyright (c) 2015 Bogdan Iusco. All rights reserved. // // Starters #import "BIStarterProtocol.h" #import "BILifecycle.h" #import "BIStartersFactory.h" #import "BIOperationQueue.h" #import "BILaunchStartersFactory.h" ...
710a9954-585d-4dfc-bcd6-d47e1a4389a4
{ "language": "C" }
```c #include <libutil.h> #ifndef TAILQ_END #define TAILQ_END(head) NULL #endif ``` Add SIMPLEQ->STAILQ macros for freebsd.
```c #include <libutil.h> #ifndef TAILQ_END #define TAILQ_END(head) NULL #endif #ifndef SIMPLEQ_HEAD #define SIMPLEQ_HEAD STAILQ_HEAD #define SIMPLEQ_HEAD_INITIALIZER STAILQ_HEAD_INITIALIZER #define SIMPLEQ_ENTRY STAILQ_ENTRY #define SIMPLEQ_INIT STAILQ_INIT #define SIMPLEQ_INSERT_AFTER STAILQ_INSERT_AFTER #...
dd23db1d-1cc0-41d0-9c6a-d1cefd0fc745
{ "language": "C" }
```c ``` Revert "Revert "Created a preliminary getMessage method""
```c //This is a preliminary version of this file for testing and learning purposes //Author: Jonas Iacobi #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h> char* getMessage(char* filename){ char* msg = NULL; int msgLength, txtLength; FILE *fp = fopen( filename, "r"); if(fp){...
1d426aa1-b90b-4056-a997-ad5d5657df63
{ "language": "C" }
```c #ifndef _STACK_H_ #define _STACK_H_ /* * data stack for use with automaton infrastructure */ #include "dataStackEntry.h" typedef struct stack Stack; Stack *stack_create(int size); void stack_destroy(Stack *st); void reset(Stack *st); void push(Stack *st, DataStackEntry d...
```c /* * Copyright (c) 2013, Court of the University of Glasgow * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * ...
07819c01-46b2-4e87-a345-f183d7c2f90f
{ "language": "C" }
```c /* ISC license. */ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE #include <stdlib.h> int main (void) { arc4random_addrandom("", 1) ; return 0 ; } ``` Fix arc4random_addrandom detection for -Werror=pointer-sign
```c /* ISC license. */ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE #include <stdlib.h> int main (void) { unsigned char *blah = "" ; arc4random_addrandom(blah, 1) ; return 0 ; } ```
b71a4b01-95a8-4f51-9d3a-406a0f985065
{ "language": "C" }
```c #include <stdio.h> #include "bincookie.h" int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]); printf("Example: %s Cookies.binarycookies\n", argv[0]); return 1; } binarycookies_t *bc = binarycookies_init...
```c #include <stdio.h> #include "bincookie.h" int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]); printf("Example: %s Cookies.binarycookies\n", argv[0]); return 1; } binarycookies_t *bc = binarycookies_init...
99fe8a8d-2195-4a6c-94b0-c6086b337533
{ "language": "C" }
```c // Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ #pragma once #include <string> #include "googleurl/src/gurl.h" ...
```c // Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ #pragma once #include <string> #include "googleurl/src/gurl.h" ...
db1051d3-93cf-4477-a8f6-7d5f4bba14b9
{ "language": "C" }
```c /* ===-- assembly.h - compiler-rt assembler support macros -----------------=== * * The LLVM Compiler Infrastructure * * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. * * ===--------------------------------------------------...
```c /* ===-- assembly.h - compiler-rt assembler support macros -----------------=== * * The LLVM Compiler Infrastructure * * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. * * ===--------------------------------------------------...
03898186-3eb5-400a-9d0f-7b91be82154b
{ "language": "C" }
```c #ifndef PHEVALUATOR_CARD_H #define PHEVALUATOR_CARD_H #ifdef __cplusplus #include <unordered_map> #include <string> namespace phevaluator { class Card { public: Card() {} Card(int id) : id_(id) {} Card(std::string name) { const std::unordered_map<char, int> rankMap = { {'2', 0}, {'3', 1}, {'...
```c #ifndef PHEVALUATOR_CARD_H #define PHEVALUATOR_CARD_H #ifdef __cplusplus #include <unordered_map> #include <string> namespace phevaluator { class Card { public: Card() {} Card(int id) : id_(id) {} Card(std::string name) { const std::unordered_map<char, int> rankMap = { {'2', 0}, {'3', 1}, {'...
04198309-85db-43b0-88e1-0047eb50eff9
{ "language": "C" }
```c ``` Add function parameter qualifier type tests
```c // RUN: %ucc -fsyntax-only %s typedef int array[3]; const array yo; // int const yo[3]; // ^~ no const here h(array); // int h(int [3]); i(const array); // int i(int const [3]); // ^~ no const here j(int[const]); // int j(int *const); _Static_asser...
28c6a34e-2414-4d82-8b5b-8118086f7a2a
{ "language": "C" }
```c #ifndef __BYTESTREAM__ #define __BYTESTREAM__ #include <stdint.h> #include <unistd.h> #define BS_RO 0 #define BS_RW 1 typedef struct _ByteStream { char* filename; size_t size; uint8_t* data; uint32_t offset; int exhausted; } ByteStream; ByteStream* bsalloc(unsigned int size); ByteStream* bsmap(char...
```c #ifndef __BYTESTREAM__ #define __BYTESTREAM__ #include <stdint.h> #include <unistd.h> #define BS_RO 0 #define BS_RW 1 // MAP_ANONYMOUS is MAP_ANON on OSX, so this will let us compile #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif typedef struct _ByteStream { char* filename; size_t size; uin...
2445ca41-d743-4c8b-9589-dbe2209059c8
{ "language": "C" }
```c #ifndef __LIB_DBG__ #define __LIB_DBG__ #define DEBUG #ifdef DEBUG # define printk(fmt, ...) \ ({ \ char ____fmt[] = fmt; \ trace_printk(____fmt, sizeof(____fmt), \ ##__VA_ARGS__); \ }) #else # define printk(fmt, ...) \ do { } while (0) #endif #endif /* __LIB_DBG__ */ ``` Re...
```c #ifndef __LIB_DBG__ #define __LIB_DBG__ #ifdef DEBUG # define printk(fmt, ...) \ ({ \ char ____fmt[] = fmt; \ trace_printk(____fmt, sizeof(____fmt), \ ##__VA_ARGS__); \ }) #else # define printk(fmt, ...) \ do { } while (0) #endif #endif /* __LIB_DBG__ */ ```
d2c6378c-ad14-4223-b163-7c8fbd0a50ba
{ "language": "C" }
```c // // 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....
```c // // 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....
6a2916e9-f0f0-4136-b2f9-4b6ddd3313a1
{ "language": "C" }
```c ``` Add a resource strategy interface
```c #ifndef APIMOCK_RESOURCESTRATEGY_H #define APIMOCK_RESOURCESTRATEGY_H #include "requestdata.h" #include "responsedata.h" namespace ApiMock { class ResourceStrategy { public: virtual ~ResourceStrategy() {} virtual ResponseData CreateResponse(const RequestData& request) = 0; }; } #endif```
2ca83a15-09e5-4be7-a939-fc9999a49aa9
{ "language": "C" }
```c #ifndef QT4COMPAT_H #define QT4COMPAT_H #include <QtCore/QtGlobal> #ifndef Q_LIKELY # define Q_LIKELY(s) s #endif #ifndef Q_UNLIKELY # define Q_UNLIKELY(s) s #endif #ifndef Q_UNREACHABLE # define Q_UNREACHABLE() Q_ASSERT(false) #endif #ifndef Q_ASSUME # define Q_ASSUME(s) if (s) {} else { Q_UNREACHABLE(); } #...
```c #ifndef QT4COMPAT_H #define QT4COMPAT_H #include <QtCore/QtGlobal> #if !defined(Q_UNREACHABLE) && !defined(Q_ASSUME) # if defined(Q_CC_INTEL) || defined(Q_CC_MSVC) # define Q_UNREACHABLE() __assume(0) # define Q_ASSUME(s) __assume(s) # elif defined(Q_CC_CLANG) # define Q_UNREACHABLE() __builtin_unreachable() ...
bcf7a22e-b729-4de9-995f-09de9df081b9
{ "language": "C" }
```c #ifndef ICAL_STREAMPOS_H #define ICAL_STREAMPOS_H namespace ical { /** * Represents a postion in the (source) stream. It is used for constructing * nice error messages. * * Note: only CRLF ("\r\n") is considered as a line ending in order to match * the definition of 'content line' from RFC 5545. */ class ...
```c #ifndef ICAL_STREAMPOS_H #define ICAL_STREAMPOS_H namespace ical { /** * Represents a postion in the (source) stream. It is used for constructing * nice error messages. * * Note: only CRLF ("\r\n") is considered as a line ending in order to match * the definition of 'content line' from RFC 5545. */ class ...
a1d7f117-4248-413f-a438-7a9e709f942f
{ "language": "C" }
```c #ifndef ICMPV4_H #define ICMPV4_H #include "syshead.h" #include "netdev.h" #define ICMP_V4_REPLY 0x00 #define ICMP_V4_DST_UNREACHABLE 0x03 #define ICMP_V4_SRC_QUENCH 0x04 #define ICMP_V4_REDIRECT 0x05 #define ICMP_V4_ECHO 0x08 #define ICMP_V4_ROUTER_ADV 0x09 #define ICMP_V4_...
```c #ifndef ICMPV4_H #define ICMPV4_H #include "syshead.h" #include "netdev.h" #define ICMP_V4_REPLY 0x00 #define ICMP_V4_DST_UNREACHABLE 0x03 #define ICMP_V4_SRC_QUENCH 0x04 #define ICMP_V4_REDIRECT 0x05 #define ICMP_V4_ECHO 0x08 #define ICMP_V4_ROUTER_ADV 0x09 #define ICMP_V4_...
60575cc7-9614-49ae-9446-e3de470c2d12
{ "language": "C" }
```c #ifndef SPECIFIC_INLINE_ASM_GCTXT #define SPECIFIC_INLINE_ASM_GCTXT #endif ``` Define the INLINE_ASM_GCTXT() macro for aarch64. This was breaking the MEMLEAK source on arm.
```c #ifndef SPECIFIC_INLINE_ASM_GCTXT #define SPECIFIC_INLINE_ASM_GCTXT #define INLINE_ASM_GCTXT(uc) getcontext(&uc) #endif ```
7a422421-bec4-4b45-af54-2ab1c50b0185
{ "language": "C" }
```c // RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3.*4' #include <stddef.h> ``` Change this test to reflect the state we are moving in. The Clang builtin headers are no longer going to receive the old 'implicit extern "C" block' semantics. This hint is actually ignored by both Clang and GCC at this point,...
```c // RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3' #include <stddef.h> ```
b87bd74c-abe7-4b9f-8653-7dc751045d00
{ "language": "C" }
```c #ifdef __aarch64__ # define STATIC_CHAIN_REG "x18" #elif defined(__alpha__) # define STATIC_CHAIN_REG "r1" #elif defined(__arm__) # define STATIC_CHAIN_REG "ip" #elif defined(__sparc__) # if defined(__arch64__) || defined(__sparcv9) # define STATIC_CHAIN_REG "g5" # else # define STATIC_CHAIN_REG "g2" # endif ...
```c #ifdef __aarch64__ # define STATIC_CHAIN_REG "x18" #elif defined(__alpha__) # define STATIC_CHAIN_REG "$1" #elif defined(__arm__) # define STATIC_CHAIN_REG "ip" #elif defined(__sparc__) # if defined(__arch64__) || defined(__sparcv9) # define STATIC_CHAIN_REG "g5" # else # define STATIC_CHAIN_REG "g2" # endif ...
a09c7e64-dba3-430f-ac5a-60ee548a7c4b
{ "language": "C" }
```c // Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #pragma once // Internal build flag for namespace discrimination #define AUTOWIRING_IS_BEING_BUILT // Only include these headers in cases where a pch can be generated // Currently this is only supported on MSVC #ifdef _MSC_VER #include <thread> ...
```c // Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #pragma once // Internal build flag for namespace discrimination #define AUTOWIRING_IS_BEING_BUILT // Only include these headers in cases where a pch can be generated // Currently this is only supported on MSVC #ifdef _MSC_VER #ifndef NOMINMAX ...
c7e2c562-3d16-4ddc-bf20-61e92eb161e2
{ "language": "C" }
```c // // ObjectiveChain.h // Objective-Chain // // Created by Martin Kiss on 30.12.13. // // ``` Add first classes to umbrella header
```c // // ObjectiveChain.h // Objective-Chain // // Created by Martin Kiss on 30.12.13. // // #import "OCAConnection.h" #import "OCAProducer.h" ```
adf2f3e7-f79f-468b-947e-d6a6056d431a
{ "language": "C" }
```c /* metatag.c: Program for adding metadata to a file * By: Forrest Kerslager, Nick Noto, David Taylor, Kevin Yeap, * Connie Yu * * 2014/06/06 * */ #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char** argv){ char* buffer; int fd, i, len; if(argc < 3){ ...
```c /* metatag.c: Program for adding metadata to a file * By: Forrest Kerslager, Nick Noto, David Taylor, Kevin Yeap, * Connie Yu * * 2014/06/06 * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_LEN 1024 int main(int argc, char** argv){ char* buffer; int fd, i, len; ...
4eda07ae-3470-43ed-99d2-a61324bcba3c
{ "language": "C" }
```c // Offset of each register in the register map, // as it's saved by asm_entry_amd64.s #pragma once #define RAX 0x00 #define RBX 0x08 #define RCX 0x10 #define RDX 0x18 #define RSI 0x20 #define RDI 0x28 #define R8 0x30 #define R9 0x38 #define R10 0x40 #define R11 0x48 #define R12 0x50 #define R13 0x58 #define R1...
```c // Offset of each register in the register map, // as it's saved by asm_entry_amd64.s #pragma once #define RAX 0x00 #define RBX 0x08 #define RCX 0x10 #define RDX 0x18 #define RSI 0x20 #define RDI 0x28 #define R8 0x30 #define R9 0x38 #define R10 0x40 #define R11 0x48 #define R12 0x50 #define R13 0x58 #define R1...
3e1ae930-552f-41d0-b82b-39f971084938
{ "language": "C" }
```c // @(#)root/base:$Name: $:$Id: TVersionCheck.h,v 1.2 2007/05/10 16:04:32 rdm Exp $ // Author: Fons Rademakers 9/5/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. ...
```c // @(#)root/base:$Name: $:$Id: TVersionCheck.h,v 1.3 2007/05/10 18:16:58 rdm Exp $ // Author: Fons Rademakers 9/5/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. ...
c5796b6e-734f-41ad-b290-b7082c94beb2
{ "language": "C" }
```c #ifndef ERROR_H #define ERROR_H /* * Note that we include "fmt" in the variadic argument list, because C99 * apparently doesn't allow variadic macros to be invoked without any vargs * parameters. */ #define ERROR(...) var_error(__FILE__, __LINE__, __VA_ARGS__) #define FAIL() simple_error(__FILE_...
```c #ifndef ERROR_H #define ERROR_H /* * Note that we include "fmt" in the variadic argument list, because C99 * apparently doesn't allow variadic macros to be invoked without any vargs * parameters. */ #define ERROR(...) var_error(__FILE__, __LINE__, __VA_ARGS__) #define FAIL() simple_error(__FILE_...
803cff87-cd5d-4bb9-8612-1a7ac347514d
{ "language": "C" }
```c // Copyright 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "Internals\MCefRefPtr.h" #include "RequestContextSettings.h" #include "include\cef_request_context.h...
```c // Copyright 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "Internals\MCefRefPtr.h" #include "RequestContextSettings.h" #include "include\cef_request_context.h...
5ea16086-570c-4a61-a71a-b8691009e321
{ "language": "C" }
```c /** * common.h * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ #ifndef GIT_STASHD_COMMON_H #define GIT_STASHD_COMMON_H #include <errno.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #define _GNU_SOURCE #define NOOPT_FOUND_V -1 #define ...
```c /** * common.h * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ #ifndef GIT_STASHD_COMMON_H #define GIT_STASHD_COMMON_H #include <errno.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #define _GNU_SOURCE #define NULL_BYTE 1 #define NOT_F...
b1e16d0d-04b1-4dd7-bb62-35d608c9f413
{ "language": "C" }
```c #ifndef __CMPTEST_H__ #define __CMPTEST_H__ #include <stdio.h> #include "sodium.h" #define TEST_NAME_RES TEST_NAME ".res" #define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp" #ifdef HAVE_ARC4RANDOM # undef rand # define rand(X) arc4random(X) #endif FILE *fp_res; int xmain(void); int main(void) { FIL...
```c #ifndef __CMPTEST_H__ #define __CMPTEST_H__ #include <stdio.h> #include "sodium.h" #define TEST_NAME_RES TEST_NAME ".res" #define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp" #ifdef HAVE_ARC4RANDOM # undef rand # define rand(X) arc4random(X) #endif FILE *fp_res; int xmain(void); int main(void) { FIL...
8913221e-1762-44e5-8682-c037a89366c1
{ "language": "C" }
```c // RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE="%t/" LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s int main(int argc, const char *argv[]) { if (argc < 2) return 1; return 0; } // CHECK: LLVM Profile: Failed to write file ``` Remove quotes around env variable, NFC
```c // RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%t/ LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s int main(int argc, const char *argv[]) { if (argc < 2) return 1; return 0; } // CHECK: LLVM Profile: Failed to write file ```
e53e1871-5e79-4cbd-af09-52414542c12e
{ "language": "C" }
```c #include "output_http.h" #include "output_ts_base.h" namespace Mist{ class OutHLS : public TSOutput{ public: OutHLS(Socket::Connection &conn); ~OutHLS(); static void init(Util::Config *cfg); void sendTS(const char *tsData, size_t len = 188); void sendNext(); void onHTTP(); bool isR...
```c #include "output_http.h" #include "output_ts_base.h" namespace Mist{ class OutHLS : public TSOutput{ public: OutHLS(Socket::Connection &conn); ~OutHLS(); static void init(Util::Config *cfg); void sendTS(const char *tsData, size_t len = 188); void sendNext(); void onHTTP(); bool isR...
44f56a61-a2d1-4cb1-a58e-f58413076e16
{ "language": "C" }
```c ``` Add Usb register controller header file dfine
```c /* * arch/arm/mach-w90x900/include/mach/regs-usb.h * * Copyright (c) 2008 Nuvoton technology corporation. * * Wan ZongShun <mcuos.com@gmail.com> * * 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 Softwa...
e4be859b-0a91-4444-8745-1e730eabaf58
{ "language": "C" }
```c #ifndef SKILLCOMPONENT_H_ #define SKILLCOMPONENT_H_ /** * Enumeration for identifying different skills. */ enum skill_t { Melee, Swords, BastardSword, Maces, SpikedMace, FirstAid }; /** * Data structure to represent an Entity's skill. */ typedef struct { skill_t skill; ///< The type of skill int rank...
```c #ifndef SKILLCOMPONENT_H_ #define SKILLCOMPONENT_H_ /** * Data structure to represent an Entity's skill. */ typedef struct { int ranks; ///< Current ranks in the skill int xp; ///< Amount of XP earned towards next rank } SkillComponent; /** * Enumeration for identifying different skills. */ enum skill_t { ...
0c0e81f8-c3ff-409d-b96d-387a4a5b1ecd
{ "language": "C" }
```c // @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 08:46:10 brun Exp $ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ global gMC; #pragma link C++ enum PDG_t; #pragma link C++ enum TMCProcess; #pragma link C++ class TVirtual...
```c // @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 09:25:02 brun Exp $ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ global gMC; #pragma link C++ enum PDG_t; #pragma link C++ enum TMCProcess; #pragma link C++ class TVirtual...
829ef1c7-7888-4394-a6b5-0b3b1948913c
{ "language": "C" }
```c #include <stdint.h> #include "ports.h" #include "pic.h" #include "gdt.h" #include "idt.h" #include "irq.h" #include "screen.h" void entry(void) { pic_remap(IRQ0, IRQ8); pic_set_masks(0, 0); gdt_init((struct GDT *)(0x500)); idt_init((struct IDT *)(0x500 + sizeof(struct GDT))); __asm__ __volatile__ ("sti"); ...
```c #include <stdint.h> #include "ports.h" #include "pic.h" #include "gdt.h" #include "idt.h" #include "irq.h" #include "screen.h" void entry(void) { pic_remap(IRQ0, IRQ8); pic_set_masks(0, 0); idt_init((struct IDT *)(0x500)); gdt_init((struct GDT *)(0x500 + sizeof(struct IDT))); __asm__ __volatile__ ("sti"); ...
13c891dd-8f7a-4a98-80a7-6a1e4f8f9968
{ "language": "C" }
```c #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/wait.h> #define GITBUF 2048 int main(int argc, char **argv) { int pid, ret; int pipes[2]; char gitbuff[GITBUF]; size_t gitlen; char b; char *br; int childst; if(pipe(pipes) != 0) { perror("Erro...
```c #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/wait.h> #define GITBUF 2048 int main(int argc, char **argv) { int pid, ret; int pipes[2]; char gitbuff[GITBUF]; size_t gitlen; char b; char *br; int childst; if(pipe(pipes) != 0) { perror("Erro...
850fd3e2-0ae8-49cb-a151-ce89af4b1bc4
{ "language": "C" }
```c // RUN: %ucc -o %t %s // RUN: %ocheck 0 %t // RUN: %t | %output_check 'Hello 5 2.3' 'Hello 5 2.3' // should run without segfaulting main() { printf("Hello %d %.1f\n", 5, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3); // this causes an infinite loop in glibc's printf()...
```c // RUN: %ucc -o %t %s // RUN: %ocheck 0 %t // RUN: %t | %output_check 'Hello 5 5.9' '7.3 8.7 10.1 11.5 12.9 14.3 15.7 17.1 18.5 19.9' 'Hello 5 15.7' '14.3 12.9 11.5 10.1 8.7 7.3 5.9 4.5 3.1 1.7 0.3' // should run without segfaulting main() { printf("Hello %d %.1f\n" "%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %...
c764f2bb-890c-4996-9aaa-f45ef694de84
{ "language": "C" }
```c /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
```c /* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
c9f08eb9-9e1a-4bf2-bca5-dc43c9d84518
{ "language": "C" }
```c // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ #define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ namespace webkit_glue { // Chromium sets the minimum interval t...
```c // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ #define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ namespace webkit_glue { // Chromium sets the minimum interval t...
727594b9-41f2-4224-82a8-f6bdc8bf40a7
{ "language": "C" }
```c /* * mswin32_config.h Hand made MSWin32 configuration file. * Copyright (c) 1996 Applied Logic Systems, Inc. * * Author: Chuck Houpt * Creation: 1/30/96 */ #include "dfltsys.h" #define MSWin32 1 #define OSStr "mswin32" #ifdef __GNUC__ #define EXTERNAL_STATE 1 #endif /* Temp. disable threading until t...
```c /* * mswin32_config.h Hand made MSWin32 configuration file. * Copyright (c) 1996 Applied Logic Systems, Inc. * * Author: Chuck Houpt * Creation: 1/30/96 */ #include "dfltsys.h" #define MSWin32 1 #define OSStr "mswin32" #ifdef __GNUC__ #define EXTERNAL_STATE 1 #endif /* Temp. disable threading until t...