Repository navigation
COMP: Declare the exported functions that no header declares #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hjmjohnson
wants to merge
6
commits into
master
Choose a base branch
from
pr/fix-missing-prototypes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
49f5b83
ENH: Declare the three functions that have a published counterpart
hjmjohnson 6a1c119
BUG: Recurse into the children in axml_recur_find_xml
hjmjohnson b56a4ca
COMP: Give the fsliolib internal functions static linkage
hjmjohnson 8721faf
COMP: Declare nifti_fileexists where it is defined
hjmjohnson 604baeb
STYLE: Derive the aux_file bound from sizeof
hjmjohnson 5c2f709
COMP: Give the pigz writers internal linkage
hjmjohnson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #include <stdio.h> | ||
| #include <string.h> | ||
|
|
||
| #include "afni_xml.h" | ||
|
|
||
| static int is_target(afni_xml_t * ax, int depth) | ||
| { | ||
| (void)depth; | ||
| return ax->name && strcmp(ax->name, "target") == 0; | ||
| } | ||
|
|
||
| static int check(const char * label, afni_xml_t * got, afni_xml_t * want) | ||
| { | ||
| if( got == want ) return 0; | ||
| fprintf(stderr, "FAIL %s: got %p, want %p\n", label, (void *)got, (void *)want); | ||
| return 1; | ||
| } | ||
|
|
||
| int main(void) | ||
| { | ||
| char root_name[] = "root", mid_name[] = "mid"; | ||
| char other_name[] = "other", target_name[] = "target"; | ||
| afni_xml_t root, mid, other, target; | ||
| afni_xml_t * root_kids[2]; | ||
| afni_xml_t * mid_kids[1]; | ||
| int nfail = 0; | ||
|
|
||
| memset(&root, 0, sizeof(root)); | ||
| memset(&mid, 0, sizeof(mid)); | ||
| memset(&other, 0, sizeof(other)); | ||
| memset(&target, 0, sizeof(target)); | ||
|
|
||
| root.name = root_name; | ||
| other.name = other_name; | ||
| mid.name = mid_name; | ||
| target.name = target_name; | ||
|
|
||
| root_kids[0] = &other; | ||
| root_kids[1] = ∣ | ||
| root.nchild = 2; | ||
| root.xchild = root_kids; | ||
|
|
||
| mid_kids[0] = ⌖ | ||
| mid.nchild = 1; | ||
| mid.xchild = mid_kids; | ||
|
|
||
| nfail += check("depth limit reaches target", axml_recur_find_xml(is_target, &root, 0, 2), &target); | ||
| nfail += check("depth limit stops short", axml_recur_find_xml(is_target, &root, 0, 1), NULL); | ||
| nfail += check("unlimited depth", axml_recur_find_xml(is_target, &root, 0, 0), &target); | ||
| nfail += check("leaf without match", axml_recur_find_xml(is_target, &other, 0, 0), NULL); | ||
|
|
||
| if( nfail ) return 1; | ||
| printf("axml_recur_find_xml: all checks passed\n"); | ||
| return 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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.