This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LINUX_LIST_H | |
#define LINUX_LIST_H | |
#include <stddef.h> | |
/** | |
* container_of - cast a member of a structure out to the containing structure | |
* @ptr: the pointer to the member. | |
* @type: the type of the container struct this is embedded in. | |
* @member: the name of the member within the struct. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec4 mat4_col(const mat4 *m, int c) | |
{ | |
vec4 res; | |
res.x = m->frows[0][c]; | |
res.y = m->frows[1][c]; | |
res.z = m->frows[2][c]; | |
res.w = m->frows[3][c]; | |
return res; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <item/ast.h> | |
#include <item/io.h> | |
int main(int argc, char **argv) | |
{ | |
item_mod *mod = item_create_mod(); | |
item_type *i32 = item_e2b(item_get_int(mod, 32)); | |
item_fun *fun = item_create_fun(mod, i32, "main", L_GLOBAL); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#define b ;break;case | |
#define w (c=getc(f)) | |
int c,x=1,y,u,r=1;char m[30000],*s=m;int main(int i,char**j){FILE*f=fopen(j[1],"r");while(w-'$'){++x;y+=c=='\n'?x=1:0;}for(;;){switch w{case'#':return fclose(f);b'\\':i=u;u=-r;r=-i;b'/':i=u;u=r;r=i;b'}':s++b'{':s--b',':*s=getchar()b'.':putchar(*s)b'^':u=*s?(r=0)+1:u;b'<':r=*s?(u=0)-1:r;b'v':u=*s?(r=0)-1:u;b'>':r=*s?(u=0)+1:r;b'+':++*s;b'-':--*s;b'!':x+=r;y-=u;}x+=r;y-=u;rewind(f);for(i=0;i<y;i+=w=='\n');for(i=0;i<x;++i)w;}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Char | |
writeOut :: Int -> String | |
writeOut 1 = "one" | |
writeOut 2 = "two" | |
writeOut 3 = "three" | |
writeOut 4 = "four" | |
writeOut 5 = "five" | |
writeOut 6 = "six" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(void) | |
{ | |
int i = 1 + 2; | |
int j = i + 1; | |
if (j) | |
return i; | |
return j; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum sound { | |
CONSONANT, | |
SHORT_VOWEL, | |
LONG_VOWEL, | |
}; | |
enum sound getsound(FILE *word) | |
{ | |
int ch = fgetc(word); | |
if (isconsonant(ch)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern puts(); | |
main(argc, argv) | |
int argc; | |
char **argv; | |
{ | |
return puts("Hello, world!") >= 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(void) | |
{ | |
int i; | |
for (i = 0; i < 10; ++i) | |
; | |
return i; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct foo { | |
int i; | |
}; | |
int main(void) | |
{ | |
struct foo bar; | |
int i; | |
for (i = 0; i < 10; i++) | |
continue; |