Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
cbd27e92
Commit
cbd27e92
authored
Nov 04, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alignof, array_size, crc: provide comments to allow testing examples.
parent
5378c864
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
ccan/alignof/_info
ccan/alignof/_info
+3
-0
ccan/array_size/_info
ccan/array_size/_info
+5
-1
ccan/crc/_info
ccan/crc/_info
+1
-0
No files found.
ccan/alignof/_info
View file @
cbd27e92
...
...
@@ -19,10 +19,13 @@
* #include <stdlib.h>
* #include <ccan/alignof/alignof.h>
*
* // Output contains "ALIGNOF(char) == 1"
* // Will also print out whether an onstack char array can hold a long.
* int main(int argc, char *argv[])
* {
* char arr[sizeof(int)];
*
* printf("ALIGNOF(char) == %zu\n", ALIGNOF(char));
* if ((unsigned long)arr % ALIGNOF(int)) {
* printf("arr %p CANNOT hold an int\n", arr);
* exit(1);
...
...
ccan/array_size/_info
View file @
cbd27e92
...
...
@@ -12,17 +12,21 @@
* macro or constant.
*
* Example:
* // Outputs "Initialized 32 values"
* #include <ccan/array_size/array_size.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // We currently use 32 random values.
* static unsigned int vals[32];
*
*
static void init_values
(void)
*
int main
(void)
* {
* unsigned int i;
* for (i = 0; i < ARRAY_SIZE(vals); i++)
* vals[i] = random();
* printf("Initialized %u values\n", i);
* return 0;
* }
*
* License: LGPL (2 or any later version)
...
...
ccan/crc/_info
View file @
cbd27e92
...
...
@@ -15,6 +15,7 @@
* #include <stdio.h>
* #include <stdlib.h>
*
* // Given IHATEMATH outputs 0x98a3b8df
* int main(int argc, char *argv[])
* {
* if (argc != 2) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment