mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-21 15:56:24 +08:00
Add quotes to code_c (#3674) PeterMoore24
* Added fibonacci to code_c * Added FreeBSD boot and GCC quotes to code_c * Added python and vkd3d quotes to code_c * fixed quote lenghts Co-authored-by: Miodec <jack@monkeytype.com>
This commit is contained in:
parent
42a70c61bd
commit
677481b3fb
|
@ -30,6 +30,36 @@
|
|||
"source": "clc-wiki - rightrot",
|
||||
"length": 183,
|
||||
"id": 4
|
||||
},
|
||||
{
|
||||
"text": "#include <stdio.h>\\nint fib(int n)\\n{\\n\\tif (n <= 1)\\n\\t\\treturn n;\\n\\treturn fib(n - 1) + fib(n - 2);\\n}\\nint main()\\n{\\n\\tint n = 9;\\n\\tprintf(\"%d\", fib(n));\\n\\tgetchar();\\n\\treturn 0;\\n}",
|
||||
"source": "Geeks for Geeks - C Program For Fibonacci Numbers",
|
||||
"length": 189,
|
||||
"id": 5
|
||||
},
|
||||
{
|
||||
"text": "int\\nmain(int argc, char **argv)\\n{\\n\\tstruct api_signature *sig = NULL;\\n\\tint load_type, load_unit, load_slice, load_partition;\\n\\tint i;\\n\\tconst char *ldev;",
|
||||
"source": "FreeBSD Boot Sequence",
|
||||
"length": 160,
|
||||
"id": 6
|
||||
},
|
||||
{
|
||||
"text": "tree\\nc_sizeof (exp)\\n\\ttree exp;\\n{\\n\\tif (pedantic)\\n\\t{\\n\\t\\tenum tree_code code = TREE_CODE (TREE_TYPE (exp));\\n\\t\\tif (code == FUNCTION_TYPE)\\n\\t\\t\\twarning (\"sizeof applied to a value of function type\");\\n\\t\\tif (code == VOID_TYPE)\\n\\t\\t\\twarning (\"sizeof applied to a value of void type\");\\n\\t}\\n\\treturn size_in_bytes (exp);\\n}",
|
||||
"source": "GCC Version 0.9",
|
||||
"length": 335,
|
||||
"id": 7
|
||||
},
|
||||
{
|
||||
"text": "static int initialized;\\nstatic void PyThread__init_thread(void); /* Forward */\\nvoid\\nPyThread_init_thread(void)\\n{\\n#ifdef Py_DEBUG\\n\\tconst char *p = Py_GETENV(\"PYTHONTHREADDEBUG\");\\n\\tif (p) {\\n\\t\\tif (*p)\\n\\t\\t\\tthread_debug = atoi(p);\\n\\t\\telse\\n\\t\\t\\tthread_debug = 1;\\n\\t}\\n#endif /* Py_DEBUG */\\n\\tif (initialized)\\n\\t\\treturn;\\n\\tinitialized = 1;\\n\\tdprintf((\"PyThread_init_thread called\"));\\n\\tPyThread__init_thread();\\n}",
|
||||
"source": "Python 3.10.8 Source Code",
|
||||
"length": 432,
|
||||
"id": 8
|
||||
},
|
||||
{
|
||||
"text": "static bool read_shader(struct vkd3d_shader_code *shader, FILE *f)\\n{\\n\\tsize_t size = 4096;\\n\\tstruct stat st;\\n\\tsize_t pos = 0;\\n\\tuint8_t *data;\\n\\tsize_t ret;\\n\\tmemset(shader, 0, sizeof(*shader));\\n\\tif (fstat(fileno(f), &st) == -1)\\n\\t{\\n\\t\\tfprintf(stderr, \"Could not stat input.\");\\n\\t\\treturn false;\\n\\t}\\n\\tif (S_ISREG(st.st_mode))\\n\\t\\tsize = st.st_size;\\n\\tif (!(data = malloc(size)))\\n\\t{\\n\\t\\tfprintf(stderr, \"Out of memory.\");\\n\\t\\treturn false;\\n\\t}\\n\\tfor (;;)\\n\\t{\\n\\t\\tif (pos >= size)\\n\\t\\t{\\n\\t\\t\\tif (size > SIZE_MAX / 2 || !(data = realloc(data, size * 2)))\\n\\t\\t\\t{\\n\\t\\t\\t\\tfprintf(stderr, \"Out of memory.\");\\n\\t\\t\\t\\tfree(data);\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t\\tsize *= 2;\\n\\t\\t}\\n\\t\\tif (!(ret = fread(&data[pos], 1, size - pos, f)))\\n\\t\\t\\tbreak;\\n\\t\\tpos += ret;\\n\\t}\\n\\tif (!feof(f))\\n\\t{\\n\\t\\tfree(data);\\n\\t\\treturn false;\\n\\t}\\n\\tshader->code = data;\\n\\tshader->size = pos;\\n\\treturn true;\\n}",
|
||||
"source": "vkd3d 3D Graphics Library",
|
||||
"length": 932,
|
||||
"id": 9
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue